7
0

feat(stat): 新增上报用户口令绑定接口

This commit is contained in:
余 欣怀 2025-11-20 14:20:39 +08:00
parent 2895a34a18
commit 713b43d2ba
3 changed files with 66 additions and 0 deletions

View File

@ -112,3 +112,11 @@ func (c *Client) GetLiveCode(req *GetLiveCodeReq) (resp *GetLiveCodeResp, err er
err = c.DoAction(req, resp) err = c.DoAction(req, resp)
return return
} }
func (c *Client) BindLiveCode(req *BindLiveCodeReq) (resp *BindLiveCodeResp, err error) {
resp = &BindLiveCodeResp{
BaseResponse: &responses.BaseResponse{},
}
err = c.DoAction(req, resp)
return
}

View File

@ -3,6 +3,7 @@ package stat
import ( import (
"fmt" "fmt"
"testing" "testing"
"time"
) )
func TestSyncGameServerList(t *testing.T) { func TestSyncGameServerList(t *testing.T) {
@ -174,3 +175,26 @@ func TestClient_GetLiveCode(t *testing.T) {
} }
t.Log(resp.Code, resp.Msg, resp.Data) t.Log(resp.Code, resp.Msg, resp.Data)
} }
func TestClient_BindLiveCode(t *testing.T) {
client, err := NewClient()
if err != nil {
t.Fatal(err)
}
req := CreateBindLiveCodeReq(BindLiveCodeParam{
AnchorName: "梦无敌111",
BindTime: time.Now().Unix(),
GameId: 3706,
GameSign: "qwldy",
LiveCode: "梦无敌111",
LiveSiteId: 203902,
RegDate: "2023-10-09",
Uid: 123456,
UserName: "grtest1001",
})
resp, err := client.BindLiveCode(req)
if err != nil {
t.Fatal(err)
}
t.Log(resp.Code, resp.Msg)
}

View File

@ -3,6 +3,7 @@ package stat
import ( import (
"crypto/md5" "crypto/md5"
"encoding/hex" "encoding/hex"
"encoding/json"
"fmt" "fmt"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" "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/responses"
@ -113,3 +114,36 @@ func CreateUserRoleRegPageResp() *UserRoleRegResp {
BaseResponse: &responses.BaseResponse{}, BaseResponse: &responses.BaseResponse{},
} }
} }
// ======== 上报用户绑定口令数据 =========
type BindLiveCodeParam struct {
Uid int64 `json:"uid"`
UserName string `json:"user_name"`
GameId int64 `json:"game_id"`
GameSign string `json:"game_sign"`
RegDate string `json:"reg_date"`
LiveCode string `json:"live_code"`
LiveSiteId int64 `json:"live_site_id"`
AnchorName string `json:"anchor_name"`
BindTime int64 `json:"bind_time"`
}
type BindLiveCodeReq = requests.JsonRequest
type BindLiveCodeResp struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
}
func CreateBindLiveCodeReq(param BindLiveCodeParam) *BindLiveCodeReq {
req := &requests.JsonRequest{}
_param, _ := json.Marshal(param)
paramMap := make(map[string]any)
_ = json.Unmarshal(_param, &paramMap)
req.InitWithApiInfo(HOST, VERSION, "/user/bindLiveCode")
req.Method = requests.POST
req.JsonParams = paramMap
return req
}