Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wechat-client-sdk
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
go
wechat-client-sdk
Commits
ad2d45e8
Commit
ad2d45e8
authored
Oct 14, 2022
by
yemin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
2eb7aa7e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
Auth.go
smapro/Auth.go
+1
-1
PhoneNumber.go
smapro/PhoneNumber.go
+2
-3
client_test.go
test/client_test.go
+5
-5
No files found.
miniprogram/auth/client
.go
→
smapro/Auth
.go
View file @
ad2d45e8
package
auth
package
smapro
import
(
"encoding/json"
...
...
miniprogram/phonenumber/client
.go
→
smapro/PhoneNumber
.go
View file @
ad2d45e8
package
phonenumber
package
smapro
import
(
"encoding/json"
...
...
@@ -44,4 +44,4 @@ type PhoneInfoResponse struct {
type
WatermarkResponse
struct
{
Timestamp
int32
`json:"timestamp"`
Appid
string
`json:"appid"`
}
\ No newline at end of file
}
test/client_test.go
View file @
ad2d45e8
...
...
@@ -2,27 +2,26 @@ package test
import
(
"fmt"
"git.168cad.top/go/wechat-client-sdk/miniprogram/auth"
"git.168cad.top/go/wechat-client-sdk/miniprogram/phonenumber"
"git.168cad.top/go/wechat-client-sdk/smapro"
"log"
"testing"
)
func
TestCode2Session
(
t
*
testing
.
T
)
{
r
,
err
:=
auth
.
Code2Session
(
"033DEr0w36huoZ2Ga22w3wXeTR1DEr0g"
,
""
,
""
)
r
,
err
:=
smapro
.
Code2Session
(
"033DEr0w36huoZ2Ga22w3wXeTR1DEr0g"
,
""
,
""
)
log
.
Println
(
err
)
log
.
Println
(
fmt
.
Sprintf
(
"%+v
\n
"
,
*
r
))
}
func
TestNewAccessToken
(
t
*
testing
.
T
)
{
r
,
err
:=
auth
.
NewAccessToken
(
""
,
""
)
r
,
err
:=
smapro
.
NewAccessToken
(
""
,
""
)
log
.
Println
(
err
)
log
.
Println
(
fmt
.
Sprintf
(
"%+v
\n
"
,
*
r
))
}
func
TestGetUserPhoneNumber
(
t
*
testing
.
T
)
{
accessToken
:=
"61_uqRWPGxxveyZnFoqCsddx9uY5w6uTZtHckodV8sS80OKtEBKJHM1udwD8ImlOa8UXnO_o3A4Qi3cwNtBvoC_fXSFnmXzJaD1cw-dMwaRGoz7XxTLhxvAeA_Bou4TWqPAmXnmmTknNwe9mU3_PVPiAGAZFZ"
r
,
err
:=
phonenumber
.
GetUserPhoneNumber
(
"fa46d5412a1c7053de2f930a043fa92b4d253eb83ce4e23d0fe0304bef65ded1"
,
accessToken
)
r
,
err
:=
smapro
.
GetUserPhoneNumber
(
"fa46d5412a1c7053de2f930a043fa92b4d253eb83ce4e23d0fe0304bef65ded1"
,
accessToken
)
log
.
Println
(
err
)
log
.
Println
(
fmt
.
Sprintf
(
"%+v
\n
"
,
*
r
))
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment