新增设置支付redis相关数据接口
This commit is contained in:
		
							parent
							
								
									a329d30296
								
							
						
					
					
						commit
						eb6157ce05
					
				@ -33,3 +33,14 @@ func (c *Client) OpenGame(req *OpenGameReq) (resp *OpenGameResp, err error) {
 | 
			
		||||
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewPayRedisData 设置支付redis相关数据
 | 
			
		||||
func (c *Client) NewPayRedisData(req *NewPayRedisDataReq) (resp *NewPayRedisDataResp, err error) {
 | 
			
		||||
	resp = CreateNewPayRedisDataResp()
 | 
			
		||||
	err = c.DoAction(req, resp)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -19,3 +19,18 @@ func TestOpenGame(t *testing.T) {
 | 
			
		||||
 | 
			
		||||
	fmt.Println(resp.Code, resp.Msg)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func TestNewPayRedisData(t *testing.T) {
 | 
			
		||||
	client, err := NewClient()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		panic(err)
 | 
			
		||||
	}
 | 
			
		||||
	req := CreateNewPayRedisDataReq()
 | 
			
		||||
 | 
			
		||||
	resp, err := client.NewPayRedisData(req)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		panic(err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	fmt.Println(resp.Code, resp.Msg)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -15,6 +15,14 @@ type OpenGameResp struct {
 | 
			
		||||
	*responses.BaseResponse
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type NewPayRedisDataReq struct {
 | 
			
		||||
	*requests.RpcRequest
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type NewPayRedisDataResp struct {
 | 
			
		||||
	*responses.BaseResponse
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// GetHttpContentBytes 因为http://script.gaore.com/open_game.php?game_id=这个接口返回的不是json,反序列化会报错,所以返回一个固定的json
 | 
			
		||||
func (baseResponse *OpenGameResp) GetHttpContentBytes() []byte {
 | 
			
		||||
	b, _ := json.Marshal(map[string]interface{}{"code": 200, "msg": "success"})
 | 
			
		||||
@ -40,3 +48,21 @@ func CreateOpenGameResp() *OpenGameResp {
 | 
			
		||||
		BaseResponse: &responses.BaseResponse{},
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// CreateNewPayRedisDataReq 设置支付redis相关数据
 | 
			
		||||
func CreateNewPayRedisDataReq() *NewPayRedisDataReq {
 | 
			
		||||
	req := &NewPayRedisDataReq{
 | 
			
		||||
		&requests.RpcRequest{},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	req.InitWithApiInfo(HOST, VERSION, "pay/new_pay_redis_data.php")
 | 
			
		||||
	req.Method = requests.GET
 | 
			
		||||
 | 
			
		||||
	return req
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func CreateNewPayRedisDataResp() *NewPayRedisDataResp {
 | 
			
		||||
	return &NewPayRedisDataResp{
 | 
			
		||||
		BaseResponse: &responses.BaseResponse{},
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user