feat: 添加争议微服务,支持订单争议流程

This commit is contained in:
zetaloop
2026-04-24 12:31:41 +08:00
parent 6edf15996c
commit 95f2f10f9f
66 changed files with 13301 additions and 57 deletions
+65 -53
View File
@@ -1,65 +1,77 @@
syntax = "v1"
import "common.api"
type (
PathId {
Id int64 `path:"id"`
}
Dispute {
Id int64 `json:"id"`
OrderId int64 `json:"orderId"`
Reason string `json:"reason"`
Status string `json:"status"`
Evidence []string `json:"evidence"`
Result string `json:"result,optional"`
CreatedAt string `json:"createdAt"`
}
DisputeListResp {
Items []Dispute `json:"items"`
Meta PageMeta `json:"meta"`
}
CreateDisputeReq {
PathId
Reason string `json:"reason"`
Evidence []string `json:"evidence"`
}
DisputeResponseReq {
PathId
Reason string `json:"reason"`
Evidence []string `json:"evidence"`
}
AppealReq {
PathId
Reason string `json:"reason"`
}
DisputePathId {
Id int64 `path:"id"`
}
Dispute {
Id int64 `json:"id"`
OrderId int64 `json:"orderId"`
InitiatorId int64 `json:"initiatorId"`
InitiatorName string `json:"initiatorName"`
RespondentId int64 `json:"respondentId"`
Reason string `json:"reason"`
Evidence []string `json:"evidence"`
Status string `json:"status"`
Result string `json:"result,optional"`
RespondentReason string `json:"respondentReason,optional"`
RespondentEvidence []string `json:"respondentEvidence"`
AppealReason string `json:"appealReason,optional"`
AppealedAt string `json:"appealedAt,optional"`
ResolvedBy int64 `json:"resolvedBy,optional"`
ResolvedAt string `json:"resolvedAt,optional"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
DisputeListReq {
PageReq
Status string `form:"status,optional"`
}
DisputeListResp {
Items []Dispute `json:"items"`
Meta PageMeta `json:"meta"`
}
CreateDisputeReq {
DisputePathId
Reason string `json:"reason"`
Evidence []string `json:"evidence"`
}
DisputeResponseReq {
DisputePathId
Reason string `json:"reason"`
Evidence []string `json:"evidence"`
}
AppealReq {
DisputePathId
Reason string `json:"reason"`
}
)
@server(
prefix: api/v1
group: dispute
@server (
prefix: api/v1
group: dispute
)
service dispute-api {
@doc "获取争议列表"
@handler ListDisputes
get /disputes (PageReq) returns (DisputeListResp)
@doc "获取争议列表"
@handler ListDisputes
get /disputes (DisputeListReq) returns (DisputeListResp)
@doc "获取订单争议"
@handler GetOrderDispute
get /orders/:id/dispute (PathId) returns (Dispute)
@doc "获取订单争议"
@handler GetOrderDispute
get /orders/:id/dispute (DisputePathId) returns (Dispute)
@doc "发起争议"
@handler CreateDispute
post /orders/:id/dispute (CreateDisputeReq) returns (EmptyResp)
@doc "发起争议"
@handler CreateDispute
post /orders/:id/dispute (CreateDisputeReq) returns (EmptyResp)
@doc "回应争议"
@handler RespondDispute
post /disputes/:id/response (DisputeResponseReq) returns (EmptyResp)
@doc "回应争议"
@handler RespondDispute
post /disputes/:id/response (DisputeResponseReq) returns (EmptyResp)
@doc "申诉"
@handler AppealDispute
post /disputes/:id/appeal (AppealReq) returns (EmptyResp)
}
@doc "申诉"
@handler AppealDispute
post /disputes/:id/appeal (AppealReq) returns (EmptyResp)
}