7
0

Compare commits

...

2 Commits

Author SHA1 Message Date
liguanjie
2fd0842825 feat(stat/site):封装回调权重缓存刷新方法 2026-02-28 16:16:16 +08:00
liguanjie
9f7e9c1faa feat(stat/site):封装回调权重缓存刷新方法 2026-02-28 16:04:36 +08:00
3 changed files with 52 additions and 0 deletions

View File

@ -150,3 +150,10 @@ func (c *Client) SetSiteKey(req *SetSiteKeyReq) (resp *SetSiteKeyResp, err error
err = c.DoAction(req, resp) err = c.DoAction(req, resp)
return return
} }
// CallbackWeightUpdate 回调权重更新
func (c *Client) CallbackWeightUpdate(req *CallbackWeightUpdateReq) (resp *CallbackWeightUpdateResp, err error) {
resp = CreateCallbackWeightUpdateResp()
err = c.DoAction(req, resp)
return
}

View File

@ -336,3 +336,17 @@ func TestSetSiteKey(t *testing.T) {
} }
_ = resp _ = resp
} }
func TestCallbackWeightUpdate(t *testing.T) {
client, err := NewClient()
if err != nil {
t.Log(err)
return
}
resp, err := client.CallbackWeightUpdate(CreateCallbackWeightUpdateReq())
if err != nil {
t.Log(err)
return
}
t.Log(resp)
}

View File

@ -52,3 +52,34 @@ func CreateSetSiteKeyResp() *GetUserTotalPayResp {
BaseResponse: &responses.BaseResponse{}, BaseResponse: &responses.BaseResponse{},
} }
} }
// CallbackWeightUpdateReq 回调权重更新,用于刷新回调权重缓存
type CallbackWeightUpdateReq struct {
*requests.RpcRequest
}
// CreateCallbackWeightUpdateReq
// 创建回调权重更新请求
func CreateCallbackWeightUpdateReq() *CallbackWeightUpdateReq {
req := &CallbackWeightUpdateReq{
&requests.RpcRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "api/site/callbackWeight")
req.Method = requests.POST
req.FormParams = make(map[string]string)
req.FormParams["act"] = "update"
return req
}
type CallbackWeightUpdateResp struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
}
func CreateCallbackWeightUpdateResp() *CallbackWeightUpdateResp {
return &CallbackWeightUpdateResp{
BaseResponse: &responses.BaseResponse{},
}
}