package game

import (
	"fmt"
	"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
	"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
)

type GetGameOsInfoReq struct {
	*requests.RpcRequest
}

type GetGameOsInfoResp struct {
	*responses.BaseResponse
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data Data   `json:"data"`
}

type Data struct {
	OsRelList2 []OsRelList2      `json:"os_rel_list2"`
	OsList     map[string]OsList `json:"os_list"`
}

type OsRelList2 struct {
	TwPlatID int `json:"tw_plat_id"`
	TwOs     int `json:"tw_os"`
	Os       int `json:"os"`
	OsTwo    int `json:"os_two"`
}

type OsList struct {
	Name  string `json:"name"`
	OsTwo map[string]interface{}
}

func CreateGetGameOsInfoReq() *GetGameOsInfoReq {
	req := &GetGameOsInfoReq{
		RpcRequest: &requests.RpcRequest{},
	}
	req.InitWithApiInfo(HOST, VERSION, "/api/game/getGameOsInfo")
	req.Method = requests.POST
	return req
}

func CreateGetGameOsInfoResp() *GetGameOsInfoResp {
	return &GetGameOsInfoResp{
		BaseResponse: &responses.BaseResponse{},
	}
}

type GetGameInfoReq struct {
	*requests.RpcRequest
}

type GetGameInfoResp struct {
	*responses.BaseResponse
	Code int          `json:"code"`
	Msg  string       `json:"msg"`
	Data GameInfoData `json:"data"`
}

type GetGameInfoReqData struct {
	GameId  int
	NoCache int
}

type GameInfoData struct {
	AcceptRelatedGame     int    `json:"accept_related_game"`
	ActCodeState          int    `json:"act_code_state"`
	AgentSign             string `json:"agent_sign"`
	AppId                 string `json:"app_id"`
	AppName               string `json:"app_name"`
	Autologin             int    `json:"autologin"`
	BName                 string `json:"b_name"`
	BackResult            int    `json:"back_result"`
	BusinessPurpose       int    `json:"business_purpose"`
	ChannelShow           int    `json:"channel_show"`
	ClientType            int    `json:"client_type"`
	Company               string `json:"company"`
	CreatedAt             string `json:"created_at"`
	CreatedRealname       string `json:"created_realname"`
	CreatedUsername       string `json:"created_username"`
	DisableBack           int    `json:"disable_back"`
	DisablePay            int    `json:"disable_pay"`
	DisableRegister       int    `json:"disable_register"`
	DisableRelatedBack    int    `json:"disable_related_back"`
	DisableUnrelatedLogin int    `json:"disable_unrelated_login"`
	Discount              int    `json:"discount"`
	Divide                int    `json:"divide"`
	DownloadDomain        string `json:"download_domain"`
	DownloadId            int    `json:"download_id"`
	ExchangeRate          int    `json:"exchange_rate"`
	ExtData               string `json:"ext_data"`
	Fcmathod              int    `json:"fcmathod"`
	FirstLetter           string `json:"first_letter"`
	FlashAuthId           string `json:"flash_auth_id"`
	FlashAuthKey          string `json:"flash_auth_key"`
	FlashAuthLogo         string `json:"flash_auth_logo"`
	FlashAuthName         string `json:"flash_auth_name"`
	FlashAuthStatus       int    `json:"flash_auth_status"`
	GameByname            string `json:"game_byname"`
	GameIconImg           string `json:"game_icon_img"`
	GameSign              string `json:"game_sign"`
	GameTsUrl             string `json:"game_ts_url"`
	GameVersion           string `json:"game_version"`
	GameZsUrl             string `json:"game_zs_url"`
	GetRoleUrl            string `json:"get_role_url"`
	HideRedButton         int    `json:"hide_red_button"`
	Icon                  string `json:"icon"`
	Icp                   string `json:"icp"`
	IcpUrl                string `json:"icp_url"`
	Id                    int    `json:"id"`
	IsAugment             int    `json:"is_augment"`
	IsOpen                int    `json:"is_open"`
	IsSync                int    `json:"is_sync"`
	MarketName            string `json:"market_name"`
	MediaAbbr             string `json:"media_abbr"`
	MobileLoginState      int    `json:"mobile_login_state"`
	MobileRegState        int    `json:"mobile_reg_state"`
	Name                  string `json:"name"`
	ObjectiveId           int    `json:"objective_id"`
	OpenGame              int    `json:"open_game"`
	Os                    int    `json:"os"`
	OsTwo                 int    `json:"os_two"`
	Owner                 int    `json:"owner"`
	PackageNameId         int    `json:"package_name_id"`
	PayUrl                string `json:"pay_url"`
	PlatId                int    `json:"plat_id"`
	Platform              int    `json:"platform"`
	ProtocolPreState      int    `json:"protocol_pre_state"`
	Rank                  int    `json:"rank"`
	RegisterProtocolState int    `json:"register_protocol_state"`
	RelateGame            string `json:"relate_game"`
	ReleaseState          int    `json:"release_state"`
	Remark                string `json:"remark"`
	RequestDomain         string `json:"request_domain"`
	ResultCode            string `json:"result_code"`
	ScreenType            int    `json:"screen_type"`
	ServerGroupId         int    `json:"server_group_id"`
	ServerSign            int    `json:"server_sign"`
	SimId                 int    `json:"sim_id"`
	SpareRequestDomain    string `json:"spare_request_domain"`
	TwOs                  int    `json:"tw_os"`
	TwPlatId              int    `json:"tw_plat_id"`
	UpdatedAt             string `json:"updated_at"`
	UpdatedRealname       string `json:"updated_realname"`
	UpdatedUsername       string `json:"updated_username"`
}

func CreateGetGameInfoByIdReq(gameId, noCache int) *GetGameInfoReq {
	req := &GetGameInfoReq{
		RpcRequest: &requests.RpcRequest{},
	}
	req.InitWithApiInfo(HOST, VERSION, fmt.Sprintf("/api/game/getGameById/%d?no_cache=%d", gameId, noCache))
	req.Method = requests.GET
	return req
}

func CreateGetGameInfoByIdResp() *GetGameInfoResp {
	return &GetGameInfoResp{
		BaseResponse: &responses.BaseResponse{},
	}
}