Commit ad2d45e8 by yemin

no message

parent 2eb7aa7e
package auth package smapro
import ( import (
"encoding/json" "encoding/json"
......
package phonenumber package smapro
import ( import (
"encoding/json" "encoding/json"
...@@ -44,4 +44,4 @@ type PhoneInfoResponse struct { ...@@ -44,4 +44,4 @@ type PhoneInfoResponse struct {
type WatermarkResponse struct { type WatermarkResponse struct {
Timestamp int32 `json:"timestamp"` Timestamp int32 `json:"timestamp"`
Appid string `json:"appid"` Appid string `json:"appid"`
} }
\ No newline at end of file
...@@ -2,27 +2,26 @@ package test ...@@ -2,27 +2,26 @@ package test
import ( import (
"fmt" "fmt"
"git.168cad.top/go/wechat-client-sdk/miniprogram/auth" "git.168cad.top/go/wechat-client-sdk/smapro"
"git.168cad.top/go/wechat-client-sdk/miniprogram/phonenumber"
"log" "log"
"testing" "testing"
) )
func TestCode2Session(t *testing.T) { func TestCode2Session(t *testing.T) {
r,err:=auth.Code2Session("033DEr0w36huoZ2Ga22w3wXeTR1DEr0g","","") r,err:=smapro.Code2Session("033DEr0w36huoZ2Ga22w3wXeTR1DEr0g","","")
log.Println(err) log.Println(err)
log.Println(fmt.Sprintf("%+v\n", *r)) log.Println(fmt.Sprintf("%+v\n", *r))
} }
func TestNewAccessToken(t *testing.T) { func TestNewAccessToken(t *testing.T) {
r,err := auth.NewAccessToken("","") r,err := smapro.NewAccessToken("","")
log.Println(err) log.Println(err)
log.Println(fmt.Sprintf("%+v\n", *r)) log.Println(fmt.Sprintf("%+v\n", *r))
} }
func TestGetUserPhoneNumber(t *testing.T) { func TestGetUserPhoneNumber(t *testing.T) {
accessToken := "61_uqRWPGxxveyZnFoqCsddx9uY5w6uTZtHckodV8sS80OKtEBKJHM1udwD8ImlOa8UXnO_o3A4Qi3cwNtBvoC_fXSFnmXzJaD1cw-dMwaRGoz7XxTLhxvAeA_Bou4TWqPAmXnmmTknNwe9mU3_PVPiAGAZFZ" 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(err)
log.Println(fmt.Sprintf("%+v\n", *r)) log.Println(fmt.Sprintf("%+v\n", *r))
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment