Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc79297cea | ||
| 2994bc6a56 | |||
|
|
2fd0842825 | ||
|
|
9f7e9c1faa |
@ -1,7 +1,6 @@
|
|||||||
package game
|
package game
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -285,6 +284,5 @@ func TestGetSdkTheme(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
fmt.Println(sdkTheme.Status, sdkTheme.Code, sdkTheme.Msg)
|
fmt.Println(sdkTheme.Status, sdkTheme.Code, sdkTheme.Msg)
|
||||||
b, _ := json.Marshal(sdkTheme.Data)
|
fmt.Println(sdkTheme.Data)
|
||||||
fmt.Println(string(b))
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -603,49 +603,7 @@ type GetSdkThemeResp struct {
|
|||||||
*responses.BaseResponse
|
*responses.BaseResponse
|
||||||
Code int `json:"code"`
|
Code int `json:"code"`
|
||||||
Msg string `json:"msg"`
|
Msg string `json:"msg"`
|
||||||
Data SdkTheme `json:"data"`
|
Data map[string]any `json:"data"`
|
||||||
}
|
|
||||||
|
|
||||||
type SdkTheme struct {
|
|
||||||
Theme struct {
|
|
||||||
Colors struct {
|
|
||||||
Theme []string `json:"theme"`
|
|
||||||
Important string `json:"important"`
|
|
||||||
Normal string `json:"normal"`
|
|
||||||
Tips string `json:"tips"`
|
|
||||||
Divider string `json:"divider"`
|
|
||||||
Background string `json:"background"`
|
|
||||||
TextClickable string `json:"text_clickable"`
|
|
||||||
RadioSelected string `json:"radio_selected"`
|
|
||||||
RadioUnselected string `json:"radio_unselected"`
|
|
||||||
ImportantText string `json:"important_text"`
|
|
||||||
TextInput string `json:"text_input"`
|
|
||||||
} `json:"colors"`
|
|
||||||
GradientAngle int `json:"gradient_angle"`
|
|
||||||
ButtonCornerRadius []int `json:"button_corner_radius"`
|
|
||||||
BackgroundCornerRadius []int `json:"background_corner_radius"`
|
|
||||||
BackgroundImg string `json:"background_img"`
|
|
||||||
ButtonSimpleImg string `json:"button_simple_img"`
|
|
||||||
ButtonThemeImg string `json:"button_theme_img"`
|
|
||||||
BackgroundImgGraphic string `json:"background_img_graphic"`
|
|
||||||
BackgroundImgGraphicPosition []int `json:"background_img_graphic_position"`
|
|
||||||
ButtonThemeImgGraphic string `json:"button_theme_img_graphic"`
|
|
||||||
ButtonThemeImgGraphicPosition []int `json:"button_theme_img_graphic_position"`
|
|
||||||
ButtonSimpleImgGraphic string `json:"button_simple_img_graphic"`
|
|
||||||
ButtonSimpleImgGraphicPosition []int `json:"button_simple_img_graphic_position"`
|
|
||||||
} `json:"theme"`
|
|
||||||
Icon struct {
|
|
||||||
MenuCenter string `json:"menu_center"`
|
|
||||||
MenuCs string `json:"menu_cs"`
|
|
||||||
MenuActivity string `json:"menu_activity"`
|
|
||||||
MenuVip string `json:"menu_vip"`
|
|
||||||
FloatDefault string `json:"float_default"`
|
|
||||||
FloatActiveLeft string `json:"float_active_left"`
|
|
||||||
FloatActiveRight string `json:"float_active_right"`
|
|
||||||
FloatInactiveLeft string `json:"float_inactive_left"`
|
|
||||||
FloatInactiveRight string `json:"float_inactive_right"`
|
|
||||||
CommonCs string `json:"common_cs"`
|
|
||||||
} `json:"icon"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateGetSdkThemeReq(gameId int64, gameVersion string) *GetSdkThemeReq {
|
func CreateGetSdkThemeReq(gameId int64, gameVersion string) *GetSdkThemeReq {
|
||||||
|
|||||||
@ -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
|
||||||
|
}
|
||||||
|
|||||||
@ -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)
|
||||||
|
}
|
||||||
|
|||||||
@ -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{},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user