新增同步微信投诉工单接口
This commit is contained in:
parent
791e916418
commit
c493e56a8b
@ -65,7 +65,6 @@ func (baseResponse *BaseResponse) parseFromHttpResponse(httpResponse *http.Respo
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println(string(body))
|
||||
baseResponse.httpStatus = httpResponse.StatusCode
|
||||
baseResponse.httpHeaders = httpResponse.Header
|
||||
baseResponse.httpContentBytes = body
|
||||
|
||||
@ -44,3 +44,10 @@ func (c *Client) NewPayRedisData(req *NewPayRedisDataReq) (resp *NewPayRedisData
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// SyncWxComplaint 同步微信投诉工单
|
||||
func (c *Client) SyncWxComplaint(req *SyncWxComplaintRequest) (resp *SyncWxComplaintResp, err error) {
|
||||
resp = CreateSyncWxComplaintResp()
|
||||
err = c.DoAction(req, resp)
|
||||
return
|
||||
}
|
||||
|
||||
@ -34,3 +34,20 @@ func TestNewPayRedisData(t *testing.T) {
|
||||
|
||||
fmt.Println(resp.Code, resp.Msg)
|
||||
}
|
||||
|
||||
func TestCreateSyncSyncWxComplaintReq(t *testing.T) {
|
||||
client, err := NewClient()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
req := CreateSyncSyncWxComplaintReq("chinaums", "631678630", "2025-12-30", "2025-12-30")
|
||||
|
||||
resp, err := client.SyncWxComplaint(req)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(resp.Code, resp.Msg)
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"time"
|
||||
)
|
||||
|
||||
type OpenGameReq struct {
|
||||
@ -23,12 +24,33 @@ type NewPayRedisDataResp struct {
|
||||
*responses.BaseResponse
|
||||
}
|
||||
|
||||
type SyncWxComplaintData struct {
|
||||
MchId string `json:"mch_id"`
|
||||
}
|
||||
|
||||
type SyncWxComplaintRequest struct {
|
||||
*requests.RpcRequest
|
||||
MchId string `position:"Body" field:"mch_id" default:"" `
|
||||
Channel string `position:"Body" field:"channel" default:"" `
|
||||
StartDate string `position:"Body" field:"start_date" default:"" `
|
||||
EndDate string `position:"Body" field:"end_date" default:"" `
|
||||
}
|
||||
|
||||
type SyncWxComplaintResp 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"})
|
||||
return b
|
||||
}
|
||||
|
||||
func (baseResponse *SyncWxComplaintResp) GetHttpContentBytes() []byte {
|
||||
b, _ := json.Marshal(map[string]interface{}{"code": 200, "msg": "success"})
|
||||
return b
|
||||
}
|
||||
|
||||
// CreateOpenGameReq 创建同步到游戏中心请求
|
||||
func CreateOpenGameReq(gameId int) *OpenGameReq {
|
||||
req := &OpenGameReq{
|
||||
@ -66,3 +88,27 @@ func CreateNewPayRedisDataResp() *NewPayRedisDataResp {
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
}
|
||||
|
||||
func CreateSyncSyncWxComplaintReq(channel string, mchID string, startDate string, endDate string) *SyncWxComplaintRequest {
|
||||
req := &SyncWxComplaintRequest{
|
||||
RpcRequest: &requests.RpcRequest{},
|
||||
}
|
||||
|
||||
req.InitWithApiInfo(HOST, VERSION, "complaint/sync_wx_complaint.php")
|
||||
req.Method = requests.POST
|
||||
req.MchId = mchID
|
||||
req.Channel = channel
|
||||
req.StartDate = startDate
|
||||
req.EndDate = endDate
|
||||
// 设置超时时间
|
||||
req.SetConnectTimeout(600 * time.Second)
|
||||
// 设置读取超时时间
|
||||
req.SetReadTimeout(600 * time.Second)
|
||||
return req
|
||||
}
|
||||
|
||||
func CreateSyncWxComplaintResp() *SyncWxComplaintResp {
|
||||
return &SyncWxComplaintResp{
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user