6
0

Compare commits

..

2 Commits

Author SHA1 Message Date
liguanjie
1a0253c56b 【cs服务】图片上传,设置10s超时 2025-08-18 16:38:09 +08:00
liguanjie
63f5bd86c0 【game】根据主体获取用户协议 2025-08-15 17:41:18 +08:00
4 changed files with 58 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"errors"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"time"
)
const (
@ -62,6 +63,9 @@ func (client *Client) Upload(req *UploadRequest) (resp *UploadResponse, err erro
}
// 必须设置content
req.SetContent(req.FileStream)
// 考虑网络不佳的情况,提高超时时间
req.SetReadTimeout(10 * time.Second)
resp = CreateUploadResponse()
err = client.DoAction(req, resp)
return

View File

@ -109,3 +109,10 @@ func (c *Client) GetGameRealAuthInfo(req *GetGameRealAuthInfoReq) (resp *GetGame
err = c.DoAction(req, resp)
return
}
// GetProtocolByCompany 根据主体获取用户协议
func (c *Client) GetProtocolByCompany(req *GetProtocolByCompanyRep) (resp *GetProtocolByCompanyResp, err error) {
resp = CreateGetProtocolByCompanyResp()
err = c.DoAction(req, resp)
return
}

View File

@ -194,3 +194,20 @@ func TestGetGameVersion(t *testing.T) {
}
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)
}

View File

@ -35,3 +35,33 @@ func CreateGetProtocolByGameIdResp() *GetProtocolByGameIdResp {
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{},
}
}