对接文档重构:两种发货对接方式分开展示

- 左侧目录按分组展示:基础接口 / 发货链接模式 / 自建发货页模式 / 回调 / 附录
- 概述页发货对接方式对比表强化(适用场景/接口顺序/建议)
- 创建订单响应示例 data 统一为约定字段,补充 201/200 状态说明
- 对外响应字段 upstream_order 更名为 delivery(result_data 存储键兼容旧数据)
This commit is contained in:
yml2213
2026-08-03 14:48:30 +08:00
parent 4019b657c4
commit b7b9132242
4 changed files with 61 additions and 26 deletions
+6 -3
View File
@@ -48,7 +48,10 @@ func deliverySubmittedUpstream(order *model.FulfillmentOrder) bool {
return true
}
m := resultDataMap(order.ResultData)
if _, ok := m["upstream_order"]; ok {
if _, ok := m["delivery"]; ok {
return true
}
if _, ok := m["upstream_order"]; ok { // 兼容历史数据
return true
}
return resultDataString(order.ResultData, "provider_order_stage") == deliveryStageSubmitted
@@ -144,7 +147,7 @@ type DeliverySubmitResult struct {
Message string `json:"message"`
ProviderOrderNo string `json:"provider_order_no,omitempty"`
GameAccount map[string]interface{} `json:"game_account,omitempty"`
UpstreamOrder interface{} `json:"upstream_order,omitempty"`
UpstreamOrder interface{} `json:"delivery,omitempty"`
}
type DeliveryLinkAuth struct {
@@ -348,7 +351,7 @@ func (s *DeliveryService) submit(orderNo, gameAccount, bindUUID string, apiClien
"game_uid": gameAccount,
"role_name": stringFromMap(boundAccount, "game_account_role_name"),
"game_channel": gameChannelText(boundAccount),
"upstream_order": upstreamOrder,
"delivery": upstreamOrder,
})
nextStatus := model.OrderStatusDelivering
message := "已提交发货,等待发货结果回传"