新增获取sdk主题接口
This commit is contained in:
parent
41056c6039
commit
526f0ef14b
@ -163,3 +163,10 @@ func (c *Client) GetAnchorUser(req *GetAnchorUserReq) (resp *GetAnchorUserResp,
|
|||||||
err = c.DoAction(req, resp)
|
err = c.DoAction(req, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetSdkTheme 获取sdk主题
|
||||||
|
func (c *Client) GetSdkTheme(req *GetSdkThemeReq) (response *GetSdkThemeResp, err error) {
|
||||||
|
response = CreateGetSdkThemeResp()
|
||||||
|
err = c.DoAction(req, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package game
|
package game
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -271,3 +272,19 @@ func TestGetAnchorUser(t *testing.T) {
|
|||||||
fmt.Println(getAnchorUser.Data.UserName)
|
fmt.Println(getAnchorUser.Data.UserName)
|
||||||
fmt.Println(getAnchorUser.Data.Id)
|
fmt.Println(getAnchorUser.Data.Id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetSdkTheme(t *testing.T) {
|
||||||
|
client, err := NewClient()
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
req := CreateGetSdkThemeReq(1058, "1.2.0")
|
||||||
|
sdkTheme, err := client.GetSdkTheme(req)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println(sdkTheme.Status, sdkTheme.Code, sdkTheme.Msg)
|
||||||
|
b, _ := json.Marshal(sdkTheme.Data)
|
||||||
|
fmt.Println(string(b))
|
||||||
|
}
|
||||||
|
|||||||
@ -592,3 +592,75 @@ func CreateGetGameRoleNameResp() *GetGameRoleNameResp {
|
|||||||
BaseResponse: &responses.BaseResponse{},
|
BaseResponse: &responses.BaseResponse{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetSdkThemeReq struct {
|
||||||
|
*requests.RpcRequest
|
||||||
|
GameId int64 `position:"Query" field:"game_id" default:"-" `
|
||||||
|
GameVersion string `position:"Query" field:"game_version" default:"-" `
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetSdkThemeResp struct {
|
||||||
|
*responses.BaseResponse
|
||||||
|
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 {
|
||||||
|
req := &GetSdkThemeReq{
|
||||||
|
RpcRequest: &requests.RpcRequest{},
|
||||||
|
GameId: gameId,
|
||||||
|
GameVersion: gameVersion,
|
||||||
|
}
|
||||||
|
req.InitWithApiInfo(HOST, VERSION, "/api/game/getSdkTheme")
|
||||||
|
req.Method = requests.GET
|
||||||
|
return req
|
||||||
|
}
|
||||||
|
|
||||||
|
func CreateGetSdkThemeResp() *GetSdkThemeResp {
|
||||||
|
return &GetSdkThemeResp{
|
||||||
|
BaseResponse: &responses.BaseResponse{},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user