Compare commits
No commits in common. "ade7ca2d03c21ad30ad374b36b75685bc4cfcda9" and "f3ab307f1810ca0be9c4d9f00442cf5655e9ddb7" have entirely different histories.
ade7ca2d03
...
f3ab307f18
@ -3,7 +3,6 @@ package passport
|
|||||||
import (
|
import (
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -41,17 +40,3 @@ func (c *Client) GetUserRoleList(req *GetUserRoleListRequest) (response *GetUser
|
|||||||
err = c.DoAction(req, response)
|
err = c.DoAction(req, response)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// EditCard
|
|
||||||
// 新增或修改实名信息
|
|
||||||
func (c *Client) EditCard(req EditCardRequestParam) (response string, err error) {
|
|
||||||
editCardRequest := CreateEditCardRequest(req)
|
|
||||||
createEditCardResponse := CreateEditCardResponse()
|
|
||||||
err = c.DoAction(editCardRequest, createEditCardResponse)
|
|
||||||
if err != nil && strings.Contains(err.Error(), "json Unmarshal:") {
|
|
||||||
return createEditCardResponse.GetHttpContentString(), nil
|
|
||||||
} else if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
return createEditCardResponse.GetHttpContentString(), nil
|
|
||||||
}
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package passport
|
package passport
|
||||||
|
|
||||||
import (
|
import "testing"
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
// 单元测试
|
// 单元测试
|
||||||
|
|
||||||
@ -33,30 +31,3 @@ func TestGetUserRoleList(t *testing.T) {
|
|||||||
t.Logf("resp code:%+v", resp.Code)
|
t.Logf("resp code:%+v", resp.Code)
|
||||||
t.Logf("resp data:%+v", resp.Data)
|
t.Logf("resp data:%+v", resp.Data)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestEditCard(t *testing.T) {
|
|
||||||
client, err := NewClient()
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
editCardRequest := EditCardRequestParam{
|
|
||||||
Uid: 32455414,
|
|
||||||
GameId: 5010,
|
|
||||||
Imei: "11111111",
|
|
||||||
IsReal: 0,
|
|
||||||
DirectStatus: 1,
|
|
||||||
AuthChannel: "gjfcm_wzcq",
|
|
||||||
DirectExtData: "测试测试测试",
|
|
||||||
Pi: "",
|
|
||||||
Ip: "",
|
|
||||||
Ipv6: "",
|
|
||||||
UserName: "asfasfd",
|
|
||||||
RealName: "这艘啊",
|
|
||||||
IdCard: "33032419950123532X",
|
|
||||||
Mandatory: "3123123123",
|
|
||||||
}
|
|
||||||
editCardResponse, err := client.EditCard(editCardRequest)
|
|
||||||
t.Logf("%v", editCardResponse)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -1,97 +0,0 @@
|
|||||||
package passport
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
const weeDongKey = "aVCxX2B3yswpxCMjaaSUHFXAzLYyuGhW"
|
|
||||||
|
|
||||||
func weeDongGetSign(ts int64) string {
|
|
||||||
return utils.Md5(utils.Md5(fmt.Sprintf("%d", ts)+weeDongKey) + weeDongKey)
|
|
||||||
}
|
|
||||||
|
|
||||||
type EditCardRequestParam struct {
|
|
||||||
Uid int64 `position:"Body" field:"uid"`
|
|
||||||
GameId int64 `position:"Body" field:"game_id"`
|
|
||||||
Imei string `position:"Body" field:"imei"`
|
|
||||||
IsReal int64 `position:"Body" field:"is_real"`
|
|
||||||
DirectStatus int64 `position:"Body" field:"direct_status"`
|
|
||||||
AuthChannel string `position:"Body" field:"auth_channel"`
|
|
||||||
DirectExtData string `position:"Body" field:"direct_ext_data"`
|
|
||||||
Pi string `position:"Body" field:"pi"`
|
|
||||||
Ip string `position:"Body" field:"ip"`
|
|
||||||
Ipv6 string `position:"Body" field:"ipv6"`
|
|
||||||
UserName string `position:"Body" field:"user_name"`
|
|
||||||
RealName string `position:"Body" field:"truename"`
|
|
||||||
IdCard string `position:"Body" field:"idcard"`
|
|
||||||
Mandatory string `position:"Body" field:"mandatory"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type EditCardResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
}
|
|
||||||
|
|
||||||
type EditCardRequest struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
Uid int64 `position:"Body" field:"uid"`
|
|
||||||
GameId int64 `position:"Body" field:"game_id"`
|
|
||||||
Imei string `position:"Body" field:"imei"`
|
|
||||||
IsReal int64 `position:"Body" field:"is_real"`
|
|
||||||
DirectStatus int64 `position:"Body" field:"direct_status"`
|
|
||||||
AuthChannel string `position:"Body" field:"auth_channel"`
|
|
||||||
DirectExtData string `position:"Body" field:"direct_ext_data"`
|
|
||||||
Pi string `position:"Body" field:"pi"`
|
|
||||||
Ip string `position:"Body" field:"ip"`
|
|
||||||
Ipv6 string `position:"Body" field:"ipv6"`
|
|
||||||
UserName string `position:"Body" field:"user_name"`
|
|
||||||
RealName string `position:"Body" field:"truename"`
|
|
||||||
IdCard string `position:"Body" field:"idcard"`
|
|
||||||
Mandatory string `position:"Body" field:"mandatory"`
|
|
||||||
Action string `position:"Body" field:"action"`
|
|
||||||
Flag string `position:"Body" field:"flag"`
|
|
||||||
Time string `position:"Body" field:"time"`
|
|
||||||
IsDirect int64 `position:"Body" field:"is_direct"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// CreateEditCardRequest 记录实名结果接口
|
|
||||||
func CreateEditCardRequest(param EditCardRequestParam) (req *EditCardRequest) {
|
|
||||||
ts := time.Now().Unix()
|
|
||||||
sign := weeDongGetSign(ts)
|
|
||||||
|
|
||||||
req = &EditCardRequest{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
Action: "edit_card",
|
|
||||||
Flag: sign,
|
|
||||||
Time: fmt.Sprintf("%v", ts),
|
|
||||||
IsDirect: 0,
|
|
||||||
//
|
|
||||||
Uid: param.Uid,
|
|
||||||
GameId: param.GameId,
|
|
||||||
Imei: param.Imei,
|
|
||||||
IsReal: param.IsReal,
|
|
||||||
DirectStatus: param.DirectStatus,
|
|
||||||
AuthChannel: param.AuthChannel,
|
|
||||||
DirectExtData: param.DirectExtData,
|
|
||||||
Pi: param.Pi,
|
|
||||||
Ip: param.Ip,
|
|
||||||
Ipv6: param.Ipv6,
|
|
||||||
UserName: param.UserName,
|
|
||||||
RealName: param.RealName,
|
|
||||||
IdCard: param.IdCard,
|
|
||||||
Mandatory: param.Mandatory,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/weedong.php")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateEditCardResponse() (response *EditCardResponse) {
|
|
||||||
response = &EditCardResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user