Compare commits
	
		
			2 Commits
		
	
	
		
			f56cdad6d0
			...
			1a0253c56b
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					1a0253c56b | ||
| 
						 | 
					63f5bd86c0 | 
@ -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
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -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)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -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{},
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user