新增stat SetSiteKey接口
This commit is contained in:
parent
c889a01a15
commit
32e21d0594
@ -142,3 +142,11 @@ func (c *Client) UserLogin(req *UserLoginRequest) (resp *UserLoginResponse, err
|
|||||||
err = c.DoAction(req, resp)
|
err = c.DoAction(req, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Client) SetSiteKey(req *SetSiteKeyReq) (resp *SetSiteKeyResp, err error) {
|
||||||
|
resp = &SetSiteKeyResp{
|
||||||
|
BaseResponse: &responses.BaseResponse{},
|
||||||
|
}
|
||||||
|
err = c.DoAction(req, resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
@ -314,3 +314,25 @@ func TestUserLogin(t *testing.T) {
|
|||||||
}
|
}
|
||||||
t.Log(resp.Code, resp.Data)
|
t.Log(resp.Code, resp.Data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSetSiteKey(t *testing.T) {
|
||||||
|
client, err := NewClient()
|
||||||
|
if err != nil {
|
||||||
|
t.Log(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, err := client.SetSiteKey(CreateSetSiteKeyReq(SetSiteKeyParam{
|
||||||
|
AgentId: 1213123,
|
||||||
|
SiteId: 1231122,
|
||||||
|
GameId: 1,
|
||||||
|
AdSource: 1,
|
||||||
|
ConvertSourceType: "1",
|
||||||
|
Key: "1",
|
||||||
|
Token: "1",
|
||||||
|
}))
|
||||||
|
if err != nil {
|
||||||
|
t.Log(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_ = resp
|
||||||
|
}
|
||||||
|
|||||||
54
services/stat/site.go
Normal file
54
services/stat/site.go
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
package stat
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/spf13/cast"
|
||||||
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||||
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||||
|
)
|
||||||
|
|
||||||
|
type SetSiteKeyReq struct {
|
||||||
|
*requests.RpcRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
type SetSiteKeyParam struct {
|
||||||
|
AgentId int64 `json:"agent_id"`
|
||||||
|
SiteId int64 `json:"site_id"`
|
||||||
|
GameId int64 `json:"game_id"`
|
||||||
|
AdSource int64 `json:"ad_source"`
|
||||||
|
ConvertSourceType string `json:"convert_source_type"`
|
||||||
|
Key string `json:"key"`
|
||||||
|
Token string `json:"token"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type SetSiteKeyResp struct {
|
||||||
|
*responses.BaseResponse
|
||||||
|
Code int `json:"code"`
|
||||||
|
Msg string `json:"msg"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateSetSiteKeyReq 写toutiao_key
|
||||||
|
func CreateSetSiteKeyReq(data SetSiteKeyParam) *SetSiteKeyReq {
|
||||||
|
req := &SetSiteKeyReq{
|
||||||
|
&requests.RpcRequest{},
|
||||||
|
}
|
||||||
|
|
||||||
|
req.InitWithApiInfo(HOST, VERSION, "api/site/setSiteKey")
|
||||||
|
req.Method = requests.POST
|
||||||
|
req.FormParams = make(map[string]string)
|
||||||
|
req.FormParams["agentid"] = cast.ToString(data.AgentId)
|
||||||
|
req.FormParams["siteid"] = cast.ToString(data.SiteId)
|
||||||
|
req.FormParams["game_id"] = cast.ToString(data.GameId)
|
||||||
|
req.FormParams["ad_source"] = cast.ToString(data.AdSource)
|
||||||
|
req.FormParams["convert_source_type"] = data.ConvertSourceType
|
||||||
|
req.FormParams["key"] = data.Key
|
||||||
|
req.FormParams["token"] = data.Token
|
||||||
|
|
||||||
|
return req
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateSetSiteKeyResp 写头条key
|
||||||
|
func CreateSetSiteKeyResp() *GetUserTotalPayResp {
|
||||||
|
return &GetUserTotalPayResp{
|
||||||
|
BaseResponse: &responses.BaseResponse{},
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user