diff --git a/services/stat/client.go b/services/stat/client.go index 909627e..ca915f2 100644 --- a/services/stat/client.go +++ b/services/stat/client.go @@ -112,3 +112,11 @@ func (c *Client) GetLiveCode(req *GetLiveCodeReq) (resp *GetLiveCodeResp, err er err = c.DoAction(req, resp) return } + +func (c *Client) BindLiveCode(req *BindLiveCodeReq) (resp *BindLiveCodeResp, err error) { + resp = &BindLiveCodeResp{ + BaseResponse: &responses.BaseResponse{}, + } + err = c.DoAction(req, resp) + return +} diff --git a/services/stat/client_test.go b/services/stat/client_test.go index 2b85881..308d292 100644 --- a/services/stat/client_test.go +++ b/services/stat/client_test.go @@ -3,6 +3,7 @@ package stat import ( "fmt" "testing" + "time" ) func TestSyncGameServerList(t *testing.T) { @@ -174,3 +175,26 @@ func TestClient_GetLiveCode(t *testing.T) { } 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) +} diff --git a/services/stat/user.go b/services/stat/user.go index 5d59692..ffea1f3 100644 --- a/services/stat/user.go +++ b/services/stat/user.go @@ -3,6 +3,7 @@ package stat import ( "crypto/md5" "encoding/hex" + "encoding/json" "fmt" "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" @@ -113,3 +114,36 @@ func CreateUserRoleRegPageResp() *UserRoleRegResp { 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, ¶mMap) + req.InitWithApiInfo(HOST, VERSION, "/user/bindLiveCode") + req.Method = requests.POST + req.JsonParams = paramMap + return req +}