You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dingdanxia/jd.jy_order_details.go

55 lines
2.3 KiB

2 years ago
package dingdanxia
import (
2 years ago
"context"
4 months ago
"go.dtapp.net/gojson"
2 years ago
"go.dtapp.net/gorequest"
"net/http"
)
type JdJyOrderDetailsResponse struct {
Code int `json:"code"`
Msg string `json:"msg"` // 描述
TotalResults int `json:"total_results"` // 总条数
Data []struct {
Orderid string `json:"orderid"` // 订单ID
Paytime string `json:"paytime"` // 订单支付时间
Payprice string `json:"payprice"` // 订单支付金额
Profit string `json:"profit"` // 订单返佣金额
Smstitle string `json:"smstitle"` // 订单标题
Sid string `json:"sid"` // 渠道方用户唯一标识
Quantity string `json:"quantity"` // 退款笔数
Refundtime string `json:"refundtime"` // 退款时间
Money string `json:"money"` // 退款金额
RefundMoney string `json:"refund_money"` // 退佣金额
CreateTime string `json:"create_time"` // 数据入库更新时间(订单状态改变,该时间会变)
Status int `json:"status"` // 订单状态(1-已提交已付款、8-已完成确认收货、9-已退款)
Type int `json:"type"` // 订单类型活动名称4-外卖 6-闪购 8-优选 2-酒店
} `json:"data"`
}
type JdJyOrderDetailsResult struct {
Result JdJyOrderDetailsResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
4 months ago
func newJdJyOrderDetailsResult(result JdJyOrderDetailsResponse, body []byte, http gorequest.Response) *JdJyOrderDetailsResult {
return &JdJyOrderDetailsResult{Result: result, Body: body, Http: http}
2 years ago
}
// JdJyOrderDetails 【官方不维护】 京佣订单
4 months ago
func (c *Client) JdJyOrderDetails(ctx context.Context, notMustParams ...gorequest.Params) (*JdJyOrderDetailsResult, error) {
2 years ago
// 参数
2 years ago
params := gorequest.NewParamsWith(notMustParams...)
2 years ago
// 请求
2 years ago
request, err := c.request(ctx, apiUrl+"/jd/jy_order_details", params, http.MethodPost)
4 months ago
if err != nil {
return newJdJyOrderDetailsResult(JdJyOrderDetailsResponse{}, request.ResponseBody, request), err
}
2 years ago
// 定义
var response JdJyOrderDetailsResponse
4 months ago
err = gojson.Unmarshal(request.ResponseBody, &response)
return newJdJyOrderDetailsResult(response, request.ResponseBody, request), err
2 years ago
}