7
0

Compare commits

..

No commits in common. "master" and "v1.2.49" have entirely different histories.

5 changed files with 48 additions and 56 deletions

View File

@ -1,6 +1,7 @@
package game
import (
"encoding/json"
"fmt"
"testing"
"time"
@ -284,5 +285,6 @@ func TestGetSdkTheme(t *testing.T) {
return
}
fmt.Println(sdkTheme.Status, sdkTheme.Code, sdkTheme.Msg)
fmt.Println(sdkTheme.Data)
b, _ := json.Marshal(sdkTheme.Data)
fmt.Println(string(b))
}

View File

@ -601,9 +601,51 @@ type GetSdkThemeReq struct {
type GetSdkThemeResp struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data map[string]any `json:"data"`
Code int `json:"code"`
Msg string `json:"msg"`
Data SdkTheme `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 {

View File

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

View File

@ -336,17 +336,3 @@ func TestSetSiteKey(t *testing.T) {
}
_ = 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,34 +52,3 @@ func CreateSetSiteKeyResp() *GetUserTotalPayResp {
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{},
}
}