first commit
This commit is contained in:
		
							
								
								
									
										169
									
								
								app/main/api/desc/admin/order.api
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										169
									
								
								app/main/api/desc/admin/order.api
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,169 @@ | ||||
| syntax = "v1" | ||||
|  | ||||
| info ( | ||||
| 	title:   "订单服务" | ||||
| 	desc:    "订单服务" | ||||
| 	author:  "Liangzai" | ||||
| 	email:   "2440983361@qq.com" | ||||
| 	version: "v1" | ||||
| ) | ||||
|  | ||||
| @server ( | ||||
| 	prefix: api/v1/admin/order | ||||
| 	group:  admin_order | ||||
| 	jwt:    JwtAuth | ||||
| ) | ||||
| service main { | ||||
| 	@doc "获取订单列表" | ||||
| 	@handler AdminGetOrderList | ||||
| 	get /list (AdminGetOrderListReq) returns (AdminGetOrderListResp) | ||||
|  | ||||
| 	@doc "获取订单详情" | ||||
| 	@handler AdminGetOrderDetail | ||||
| 	get /detail/:id (AdminGetOrderDetailReq) returns (AdminGetOrderDetailResp) | ||||
|  | ||||
| 	@doc "创建订单" | ||||
| 	@handler AdminCreateOrder | ||||
| 	post /create (AdminCreateOrderReq) returns (AdminCreateOrderResp) | ||||
|  | ||||
| 	@doc "更新订单" | ||||
| 	@handler AdminUpdateOrder | ||||
| 	put /update/:id (AdminUpdateOrderReq) returns (AdminUpdateOrderResp) | ||||
|  | ||||
| 	@doc "删除订单" | ||||
| 	@handler AdminDeleteOrder | ||||
| 	delete /delete/:id (AdminDeleteOrderReq) returns (AdminDeleteOrderResp) | ||||
|  | ||||
| 	@doc "订单退款" | ||||
| 	@handler AdminRefundOrder | ||||
| 	post /refund/:id (AdminRefundOrderReq) returns (AdminRefundOrderResp) | ||||
| } | ||||
|  | ||||
| type ( | ||||
| 	// 列表请求 | ||||
| 	AdminGetOrderListReq { | ||||
| 		Page            int64   `form:"page,default=1"`                   // 页码 | ||||
| 		PageSize        int64   `form:"pageSize,default=20"`              // 每页数量 | ||||
| 		OrderNo         string  `form:"order_no,optional"`                // 商户订单号 | ||||
| 		PlatformOrderId string  `form:"platform_order_id,optional"`       // 支付订单号 | ||||
| 		ProductName     string  `form:"product_name,optional"`            // 产品名称 | ||||
| 		PaymentPlatform string  `form:"payment_platform,optional"`        // 支付方式 | ||||
| 		PaymentScene    string  `form:"payment_scene,optional"`           // 支付平台 | ||||
| 		Amount          float64 `form:"amount,optional"`                  // 金额 | ||||
| 		Status          string  `form:"status,optional"`                  // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败 | ||||
| 		IsPromotion     int64   `form:"is_promotion,optional,default=-1"` // 是否推广订单:0-否,1-是 | ||||
| 		CreateTimeStart string  `form:"create_time_start,optional"`       // 创建时间开始 | ||||
| 		CreateTimeEnd   string  `form:"create_time_end,optional"`         // 创建时间结束 | ||||
| 		PayTimeStart    string  `form:"pay_time_start,optional"`          // 支付时间开始 | ||||
| 		PayTimeEnd      string  `form:"pay_time_end,optional"`            // 支付时间结束 | ||||
| 		RefundTimeStart string  `form:"refund_time_start,optional"`       // 退款时间开始 | ||||
| 		RefundTimeEnd   string  `form:"refund_time_end,optional"`         // 退款时间结束 | ||||
| 	} | ||||
|  | ||||
| 	// 列表响应 | ||||
| 	AdminGetOrderListResp { | ||||
| 		Total int64           `json:"total"` // 总数 | ||||
| 		Items []OrderListItem `json:"items"` // 列表 | ||||
| 	} | ||||
|  | ||||
| 	// 列表项 | ||||
| 	OrderListItem { | ||||
| 		Id              int64   `json:"id"`                // 订单ID | ||||
| 		OrderNo         string  `json:"order_no"`          // 商户订单号 | ||||
| 		PlatformOrderId string  `json:"platform_order_id"` // 支付订单号 | ||||
| 		ProductName     string  `json:"product_name"`      // 产品名称 | ||||
| 		PaymentPlatform string  `json:"payment_platform"`  // 支付方式 | ||||
| 		PaymentScene    string  `json:"payment_scene"`     // 支付平台 | ||||
| 		Amount          float64 `json:"amount"`            // 金额 | ||||
| 		Status          string  `json:"status"`            // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败 | ||||
| 		QueryState      string  `json:"query_state"`       // 查询状态:pending-待查询,success-查询成功,failed-查询失败 processing-查询中 | ||||
| 		CreateTime      string  `json:"create_time"`       // 创建时间 | ||||
| 		PayTime         string  `json:"pay_time"`          // 支付时间 | ||||
| 		RefundTime      string  `json:"refund_time"`       // 退款时间 | ||||
| 		IsPromotion     int64   `json:"is_promotion"`      // 是否推广订单:0-否,1-是 | ||||
| 	} | ||||
|  | ||||
| 	// 详情请求 | ||||
| 	AdminGetOrderDetailReq { | ||||
| 		Id int64 `path:"id"` // 订单ID | ||||
| 	} | ||||
|  | ||||
| 	// 详情响应 | ||||
| 	AdminGetOrderDetailResp { | ||||
| 		Id              int64   `json:"id"`                // 订单ID | ||||
| 		OrderNo         string  `json:"order_no"`          // 商户订单号 | ||||
| 		PlatformOrderId string  `json:"platform_order_id"` // 支付订单号 | ||||
| 		ProductName     string  `json:"product_name"`      // 产品名称 | ||||
| 		PaymentPlatform string  `json:"payment_platform"`  // 支付方式 | ||||
| 		PaymentScene    string  `json:"payment_scene"`     // 支付平台 | ||||
| 		Amount          float64 `json:"amount"`            // 金额 | ||||
| 		Status          string  `json:"status"`            // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败 | ||||
| 		QueryState      string  `json:"query_state"`       // 查询状态:pending-待查询,success-查询成功,failed-查询失败 processing-查询中 | ||||
| 		CreateTime      string  `json:"create_time"`       // 创建时间 | ||||
| 		PayTime         string  `json:"pay_time"`          // 支付时间 | ||||
| 		RefundTime      string  `json:"refund_time"`       // 退款时间 | ||||
| 		IsPromotion     int64   `json:"is_promotion"`      // 是否推广订单:0-否,1-是 | ||||
| 		UpdateTime      string  `json:"update_time"`       // 更新时间 | ||||
| 	} | ||||
|  | ||||
| 	// 创建请求 | ||||
| 	AdminCreateOrderReq { | ||||
| 		OrderNo         string  `json:"order_no"`               // 商户订单号 | ||||
| 		PlatformOrderId string  `json:"platform_order_id"`      // 支付订单号 | ||||
| 		ProductName     string  `json:"product_name"`           // 产品名称 | ||||
| 		PaymentPlatform string  `json:"payment_platform"`       // 支付方式 | ||||
| 		PaymentScene    string  `json:"payment_scene"`          // 支付平台 | ||||
| 		Amount          float64 `json:"amount"`                 // 金额 | ||||
| 		Status          string  `json:"status,default=pending"` // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败 | ||||
| 		IsPromotion     int64   `json:"is_promotion,default=0"` // 是否推广订单:0-否,1-是 | ||||
| 	} | ||||
|  | ||||
| 	// 创建响应 | ||||
| 	AdminCreateOrderResp { | ||||
| 		Id int64 `json:"id"` // 订单ID | ||||
| 	} | ||||
|  | ||||
| 	// 更新请求 | ||||
| 	AdminUpdateOrderReq { | ||||
| 		Id              int64    `path:"id"`                         // 订单ID | ||||
| 		OrderNo         *string  `json:"order_no,optional"`          // 商户订单号 | ||||
| 		PlatformOrderId *string  `json:"platform_order_id,optional"` // 支付订单号 | ||||
| 		ProductName     *string  `json:"product_name,optional"`      // 产品名称 | ||||
| 		PaymentPlatform *string  `json:"payment_platform,optional"`  // 支付方式 | ||||
| 		PaymentScene    *string  `json:"payment_scene,optional"`     // 支付平台 | ||||
| 		Amount          *float64 `json:"amount,optional"`            // 金额 | ||||
| 		Status          *string  `json:"status,optional"`            // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败 | ||||
| 		PayTime         *string  `json:"pay_time,optional"`          // 支付时间 | ||||
| 		RefundTime      *string  `json:"refund_time,optional"`       // 退款时间 | ||||
| 		IsPromotion     *int64   `json:"is_promotion,optional"`      // 是否推广订单:0-否,1-是 | ||||
| 	} | ||||
|  | ||||
| 	// 更新响应 | ||||
| 	AdminUpdateOrderResp { | ||||
| 		Success bool `json:"success"` // 是否成功 | ||||
| 	} | ||||
|  | ||||
| 	// 删除请求 | ||||
| 	AdminDeleteOrderReq { | ||||
| 		Id int64 `path:"id"` // 订单ID | ||||
| 	} | ||||
|  | ||||
| 	// 删除响应 | ||||
| 	AdminDeleteOrderResp { | ||||
| 		Success bool `json:"success"` // 是否成功 | ||||
| 	} | ||||
|  | ||||
| 	// 退款请求 | ||||
| 	AdminRefundOrderReq { | ||||
| 		Id           int64   `path:"id"`            // 订单ID | ||||
| 		RefundAmount float64 `json:"refund_amount"` // 退款金额 | ||||
| 		RefundReason string  `json:"refund_reason"` // 退款原因 | ||||
| 	} | ||||
|  | ||||
| 	// 退款响应 | ||||
| 	AdminRefundOrderResp { | ||||
| 		Status   string  `json:"status"`    // 退款状态 | ||||
| 		RefundNo string  `json:"refund_no"` // 退款单号 | ||||
| 		Amount   float64 `json:"amount"`    // 退款金额 | ||||
| 	} | ||||
| ) | ||||
		Reference in New Issue
	
	Block a user