Merge branch 'main-merge-base-a'
# Conflicts: # deploy/dev/docker-compose.yml # deploy/dev/envoy.yaml # desc/api/dispute.api # desc/api/review.api # desc/api/search.api
This commit is contained in:
+27
-13
@@ -3,34 +3,48 @@ syntax = "v1"
|
||||
import "common.api"
|
||||
|
||||
type (
|
||||
PathId {
|
||||
DisputePathId {
|
||||
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"`
|
||||
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 {
|
||||
PathId
|
||||
DisputePathId
|
||||
Reason string `json:"reason"`
|
||||
Evidence []string `json:"evidence"`
|
||||
}
|
||||
DisputeResponseReq {
|
||||
PathId
|
||||
DisputePathId
|
||||
Reason string `json:"reason"`
|
||||
Evidence []string `json:"evidence"`
|
||||
}
|
||||
AppealReq {
|
||||
PathId
|
||||
DisputePathId
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
)
|
||||
@@ -42,11 +56,11 @@ type (
|
||||
service dispute-api {
|
||||
@doc "获取争议列表"
|
||||
@handler ListDisputes
|
||||
get /disputes (PageReq) returns (DisputeListResp)
|
||||
get /disputes (DisputeListReq) returns (DisputeListResp)
|
||||
|
||||
@doc "获取订单争议"
|
||||
@handler GetOrderDispute
|
||||
get /orders/:id/dispute (PathId) returns (Dispute)
|
||||
get /orders/:id/dispute (DisputePathId) returns (Dispute)
|
||||
|
||||
@doc "发起争议"
|
||||
@handler CreateDispute
|
||||
|
||||
+13
-2
@@ -3,6 +3,9 @@ syntax = "v1"
|
||||
import "common.api"
|
||||
|
||||
type (
|
||||
ReviewPathId {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
Review {
|
||||
Id int64 `json:"id"`
|
||||
OrderId int64 `json:"orderId"`
|
||||
@@ -18,9 +21,17 @@ type (
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
SubmitReviewReq {
|
||||
ReviewPathId
|
||||
Rating int `json:"rating"`
|
||||
Content string `json:"content,optional"`
|
||||
}
|
||||
GetOrderReviewsReq {
|
||||
ReviewPathId
|
||||
}
|
||||
ListUserReviewsReq {
|
||||
ReviewPathId
|
||||
PageReq
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
@@ -34,7 +45,7 @@ service review-api {
|
||||
|
||||
@doc "获取订单评价"
|
||||
@handler GetOrderReviews
|
||||
get /orders/:id/reviews (EmptyResp) returns ([]Review)
|
||||
get /orders/:id/reviews (GetOrderReviewsReq) returns (ReviewListResp)
|
||||
}
|
||||
|
||||
@server (
|
||||
@@ -48,5 +59,5 @@ service review-api {
|
||||
|
||||
@doc "获取用户收到的评价"
|
||||
@handler ListUserReviews
|
||||
get /users/:id/reviews (PageReq) returns (ReviewListResp)
|
||||
get /users/:id/reviews (ListUserReviewsReq) returns (ReviewListResp)
|
||||
}
|
||||
|
||||
+15
-4
@@ -8,7 +8,7 @@ type (
|
||||
}
|
||||
SearchReq {
|
||||
PageReq
|
||||
Q string `form:"q"`
|
||||
Q string `form:"q,optional"`
|
||||
MinPrice float64 `form:"min,optional"`
|
||||
MaxPrice float64 `form:"max,optional"`
|
||||
OnlyOnline bool `form:"onlyOnline,optional"`
|
||||
@@ -18,14 +18,25 @@ type (
|
||||
Items []interface{} `json:"items"` // Mixed items
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
Favorite {
|
||||
Id string `json:"id"`
|
||||
UserId string `json:"userId"`
|
||||
TargetType string `json:"targetType"`
|
||||
TargetId string `json:"targetId"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
}
|
||||
FavoriteListResp {
|
||||
Items []Favorite `json:"items"`
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
FavoriteReq {
|
||||
TargetType string `json:"targetType"` // player, shop
|
||||
TargetId int64 `json:"targetId"`
|
||||
TargetId string `json:"targetId"`
|
||||
}
|
||||
FavoriteCheckReq {
|
||||
PathIDReq
|
||||
TargetType string `form:"targetType"`
|
||||
TargetId int64 `form:"targetId"`
|
||||
TargetId string `form:"targetId"`
|
||||
}
|
||||
FavoriteCheckResp {
|
||||
Favorited bool `json:"favorited"`
|
||||
@@ -53,7 +64,7 @@ service search-api {
|
||||
service search-api {
|
||||
@doc "获取收藏列表"
|
||||
@handler ListFavorites
|
||||
get /favorites (PageReq) returns (SearchResp)
|
||||
get /favorites (PageReq) returns (FavoriteListResp)
|
||||
|
||||
@doc "添加收藏"
|
||||
@handler AddFavorite
|
||||
|
||||
Reference in New Issue
Block a user