【cs服务】
1、用户提交工单
This commit is contained in:
		
							parent
							
								
									ce7d7f2ee7
								
							
						
					
					
						commit
						c0ced849fc
					
				@ -99,3 +99,8 @@ func (client *Client) OrderRestart(req *OrderRestartRequest) (resp *OrderRestart
 | 
			
		||||
	err = client.DoAction(req, resp)
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
func (client *Client) OrderSubmit(req *OrderSubmitRequest) (resp *OrderSubmitResponse, err error) {
 | 
			
		||||
	resp = CreateOrderSubmitResponse()
 | 
			
		||||
	err = client.DoAction(req, resp)
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -244,3 +244,49 @@ func TestOrderRestart(t *testing.T) {
 | 
			
		||||
	}
 | 
			
		||||
	fmt.Printf(fmt.Sprintf("%v", res))
 | 
			
		||||
}
 | 
			
		||||
func TestOrderSubmit(t *testing.T) {
 | 
			
		||||
	client, newErr := NewClient()
 | 
			
		||||
	if newErr != nil {
 | 
			
		||||
		panic(newErr)
 | 
			
		||||
	}
 | 
			
		||||
	req := CreateOrderSubmitRequest(OrderSubmitParam{
 | 
			
		||||
		GameId:            7991,
 | 
			
		||||
		UserName:          "ws45265737",
 | 
			
		||||
		Uid:               65598086,
 | 
			
		||||
		RoleId:            "10676785",
 | 
			
		||||
		RoleName:          "流水行者",
 | 
			
		||||
		ServerName:        "血阳琉璃",
 | 
			
		||||
		OrderTemplateCode: "btu7RoDj",
 | 
			
		||||
		Detail:            "我的问题是,组队这个玩法的初衷是希望实现大家能和身边认识的朋友一起下洞的目标。但是现在看来,很多玩家都选择了在游戏中随机匹配队友,而我们发现,组队机制暴露的绝大部分玩家体验问题都是在随机匹配中出现的。<br/>比如恶意踢人,又比如匹配到的玩家等级比较低,不符合自己本次下洞的目标,再或者是组队进入洞窟却发现队友已经快要收尾结束探险了。",
 | 
			
		||||
		Phone:             "13725263463",
 | 
			
		||||
		ApplyIp:           "183.63.75.58",
 | 
			
		||||
		OrderParts: []OrderSubmitPart{
 | 
			
		||||
			{
 | 
			
		||||
				PartKey:   "email",
 | 
			
		||||
				PartName:  "联系邮箱",
 | 
			
		||||
				PartValue: "kingson2011@126.com",
 | 
			
		||||
				PicValue:  nil,
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				PartKey:   "pay_pic",
 | 
			
		||||
				PartName:  "充值凭证",
 | 
			
		||||
				PartValue: "",
 | 
			
		||||
				PicValue: []string{
 | 
			
		||||
					"uploads/d1a/d1aba28357b89e7ebfc77e5c43fc81b7.jpeg",
 | 
			
		||||
					"uploads/c37/c3726c5cf7175ed048f6c68416dbf30b.jpeg",
 | 
			
		||||
					"uploads/ca2/ca285ae8feae8c60d51b53079fa9b2a9.jpeg",
 | 
			
		||||
				},
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		SmsCode: "7204",
 | 
			
		||||
	})
 | 
			
		||||
	res, err := client.OrderSubmit(req)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		t.Error(err)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	if res.Code != 0 {
 | 
			
		||||
		t.Error("工单提交失败")
 | 
			
		||||
	}
 | 
			
		||||
	fmt.Printf(fmt.Sprintf("%v", res))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -206,3 +206,77 @@ func CreateOrderRestartResponse() (resp *OrderRestartResponse) {
 | 
			
		||||
		BaseResponse: &responses.BaseResponse{},
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// OrderSubmitParam 工单提交
 | 
			
		||||
type OrderSubmitParam struct {
 | 
			
		||||
	GameId            int64             `json:"game_id"`
 | 
			
		||||
	UserName          string            `json:"user_name"`
 | 
			
		||||
	Uid               int64             `json:"uid"`
 | 
			
		||||
	RoleId            string            `json:"role_id"`
 | 
			
		||||
	RoleName          string            `json:"role_name"`
 | 
			
		||||
	ServerName        string            `json:"server_name"`
 | 
			
		||||
	OrderTemplateCode string            `json:"order_template_code"`
 | 
			
		||||
	Detail            string            `json:"detail"`
 | 
			
		||||
	Phone             string            `json:"phone"`
 | 
			
		||||
	ApplyIp           string            `json:"apply_ip"`
 | 
			
		||||
	OrderParts        []OrderSubmitPart `json:"order_parts"`
 | 
			
		||||
	SmsCode           string            `json:"sms_code"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type OrderSubmitPart struct {
 | 
			
		||||
	PartId    int64    `json:"part_id"`
 | 
			
		||||
	PartKey   string   `json:"part_key"`
 | 
			
		||||
	PartName  string   `json:"part_name"`
 | 
			
		||||
	PartValue string   `json:"part_value"`
 | 
			
		||||
	PartType  int64    `json:"part_type"`
 | 
			
		||||
	PicValue  []string `json:"pic_value"`
 | 
			
		||||
}
 | 
			
		||||
type OrderSubmitRequest struct {
 | 
			
		||||
	*requests.JsonRequest
 | 
			
		||||
	GameId            int64             `position:"Json" field:"game_id"`
 | 
			
		||||
	UserName          string            `position:"Json" field:"user_name"`
 | 
			
		||||
	Uid               int64             `position:"Json" field:"uid"`
 | 
			
		||||
	RoleId            string            `position:"Json" field:"role_id"`
 | 
			
		||||
	RoleName          string            `position:"Json" field:"role_name"`
 | 
			
		||||
	ServerName        string            `position:"Json" field:"server_name"`
 | 
			
		||||
	OrderTemplateCode string            `position:"Json" field:"order_template_code"`
 | 
			
		||||
	Detail            string            `position:"Json" field:"detail"`
 | 
			
		||||
	Phone             string            `position:"Json" field:"phone"`
 | 
			
		||||
	ApplyIp           string            `position:"Json" field:"apply_ip"`
 | 
			
		||||
	OrderParts        []OrderSubmitPart `position:"Json" field:"order_parts"`
 | 
			
		||||
	SmsCode           string            `position:"Json" field:"sms_code"`
 | 
			
		||||
}
 | 
			
		||||
type OrderSubmitResponse struct {
 | 
			
		||||
	*responses.BaseResponse
 | 
			
		||||
	Code int    `json:"code"`
 | 
			
		||||
	Msg  string `json:"msg"`
 | 
			
		||||
	Data struct {
 | 
			
		||||
		OrderNum string `json:"order_num"`
 | 
			
		||||
	} `json:"data"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func CreateOrderSubmitRequest(param OrderSubmitParam) (req *OrderSubmitRequest) {
 | 
			
		||||
	req = &OrderSubmitRequest{
 | 
			
		||||
		JsonRequest:       &requests.JsonRequest{},
 | 
			
		||||
		GameId:            param.GameId,
 | 
			
		||||
		UserName:          param.UserName,
 | 
			
		||||
		Uid:               param.Uid,
 | 
			
		||||
		RoleId:            param.RoleId,
 | 
			
		||||
		RoleName:          param.RoleName,
 | 
			
		||||
		ServerName:        param.ServerName,
 | 
			
		||||
		OrderTemplateCode: param.OrderTemplateCode,
 | 
			
		||||
		Detail:            param.Detail,
 | 
			
		||||
		Phone:             param.Phone,
 | 
			
		||||
		ApplyIp:           param.ApplyIp,
 | 
			
		||||
		OrderParts:        param.OrderParts,
 | 
			
		||||
		SmsCode:           param.SmsCode,
 | 
			
		||||
	}
 | 
			
		||||
	req.InitWithApiInfo(HOST, VERSION, "/v1/work_order/order_submit")
 | 
			
		||||
	req.Method = requests.POST
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
func CreateOrderSubmitResponse() (resp *OrderSubmitResponse) {
 | 
			
		||||
	return &OrderSubmitResponse{
 | 
			
		||||
		BaseResponse: &responses.BaseResponse{},
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user