【game】根据主体获取用户协议
This commit is contained in:
parent
f56cdad6d0
commit
63f5bd86c0
@ -109,3 +109,10 @@ func (c *Client) GetGameRealAuthInfo(req *GetGameRealAuthInfoReq) (resp *GetGame
|
|||||||
err = c.DoAction(req, resp)
|
err = c.DoAction(req, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetProtocolByCompany 根据主体获取用户协议
|
||||||
|
func (c *Client) GetProtocolByCompany(req *GetProtocolByCompanyRep) (resp *GetProtocolByCompanyResp, err error) {
|
||||||
|
resp = CreateGetProtocolByCompanyResp()
|
||||||
|
err = c.DoAction(req, resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -194,3 +194,20 @@ func TestGetGameVersion(t *testing.T) {
|
|||||||
}
|
}
|
||||||
t.Log(resp)
|
t.Log(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestClient_GetProtocolByCompany(t *testing.T) {
|
||||||
|
client, err := NewClient()
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
req := CreateGetProtocolByCompanyRep()
|
||||||
|
req.Company = "GR"
|
||||||
|
req.Type = 0
|
||||||
|
resp, err := client.GetProtocolByCompany(req)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
t.Log(resp.Code, resp.Msg, resp.Data.Content)
|
||||||
|
}
|
||||||
|
@ -35,3 +35,33 @@ func CreateGetProtocolByGameIdResp() *GetProtocolByGameIdResp {
|
|||||||
BaseResponse: &responses.BaseResponse{},
|
BaseResponse: &responses.BaseResponse{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetProtocolByCompanyRep struct {
|
||||||
|
*requests.RpcRequest
|
||||||
|
Company string `position:"Query" field:"company"`
|
||||||
|
Type int `position:"Query" field:"type"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetProtocolByCompanyResp struct {
|
||||||
|
*responses.BaseResponse
|
||||||
|
Code int `json:"code"`
|
||||||
|
Msg string `json:"msg"`
|
||||||
|
Data struct {
|
||||||
|
Content string `json:"content"`
|
||||||
|
} `json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func CreateGetProtocolByCompanyRep() *GetProtocolByCompanyRep {
|
||||||
|
req := &GetProtocolByCompanyRep{
|
||||||
|
RpcRequest: &requests.RpcRequest{},
|
||||||
|
}
|
||||||
|
req.InitWithApiInfo(HOST, VERSION, "/api/news/getProtocolByCompany")
|
||||||
|
req.Method = requests.GET
|
||||||
|
return req
|
||||||
|
}
|
||||||
|
|
||||||
|
func CreateGetProtocolByCompanyResp() *GetProtocolByCompanyResp {
|
||||||
|
return &GetProtocolByCompanyResp{
|
||||||
|
BaseResponse: &responses.BaseResponse{},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user