fix: api descript
This commit is contained in:
+14
-5
@@ -2,8 +2,12 @@ syntax = "v1"
|
||||
import "common.api"
|
||||
|
||||
type (
|
||||
SessionIdReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
|
||||
ChatSession {
|
||||
Id string `json:"id"`
|
||||
Id int64 `json:"id"`
|
||||
Type string `json:"type"` // order, consultation
|
||||
OrderId string `json:"orderId,optional"`
|
||||
Participants []SimpleUser `json:"participants"`
|
||||
@@ -17,7 +21,7 @@ type (
|
||||
}
|
||||
|
||||
ChatMessage {
|
||||
Id string `json:"id"`
|
||||
Id int64 `json:"id"`
|
||||
SessionId string `json:"sessionId"`
|
||||
SenderId string `json:"senderId"`
|
||||
Type string `json:"type"` // text, image, system
|
||||
@@ -31,15 +35,20 @@ type (
|
||||
}
|
||||
|
||||
SendMessageReq {
|
||||
SessionIdReq
|
||||
Type string `json:"type"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
ListMessageReq {
|
||||
SessionIdReq
|
||||
PageReq
|
||||
}
|
||||
)
|
||||
|
||||
@server(
|
||||
prefix: api/v1/chat
|
||||
group: chat
|
||||
jwt: Auth
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "获取会话列表"
|
||||
@@ -48,11 +57,11 @@ service juwan-api {
|
||||
|
||||
@doc "获取会话详情"
|
||||
@handler GetSession
|
||||
get /sessions/:id (EmptyResp) returns (ChatSession)
|
||||
get /sessions/:id (SessionIdReq) returns (ChatSession)
|
||||
|
||||
@doc "获取消息历史"
|
||||
@handler ListMessages
|
||||
get /sessions/:id/messages (PageReq) returns (ChatMessageListResp)
|
||||
get /sessions/:id/messages (ListMessageReq) returns (ChatMessageListResp)
|
||||
|
||||
@doc "发送消息"
|
||||
@handler SendMessage
|
||||
|
||||
+18
-12
@@ -2,8 +2,11 @@ syntax = "v1"
|
||||
import "common.api"
|
||||
|
||||
type (
|
||||
PathId {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
Post {
|
||||
Id string `json:"id"`
|
||||
Id int64 `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
Images []string `json:"images"`
|
||||
@@ -35,7 +38,7 @@ type (
|
||||
}
|
||||
|
||||
Comment {
|
||||
Id string `json:"id"`
|
||||
Id int64 `json:"id"`
|
||||
Content string `json:"content"`
|
||||
Author UserProfile `json:"author"`
|
||||
LikeCount int64 `json:"likeCount"`
|
||||
@@ -51,6 +54,10 @@ type (
|
||||
CreateCommentReq {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
ListCommentsReq {
|
||||
PathId
|
||||
PageReq
|
||||
}
|
||||
)
|
||||
|
||||
@server(
|
||||
@@ -64,21 +71,20 @@ service juwan-api {
|
||||
|
||||
@doc "获取帖子详情"
|
||||
@handler GetPost
|
||||
get /posts/:id (EmptyResp) returns (Post)
|
||||
get /posts/:id (PathId) returns (Post)
|
||||
|
||||
@doc "获取帖子评论"
|
||||
@handler ListComments
|
||||
get /posts/:id/comments (PageReq) returns (CommentListResp)
|
||||
get /posts/:id/comments (ListCommentsReq ) returns (CommentListResp)
|
||||
|
||||
@doc "获取用户帖子"
|
||||
@handler ListUserPosts
|
||||
get /users/:id/posts (PageReq) returns (PostListResp)
|
||||
get /users/:id/posts (ListCommentsReq ) returns (PostListResp)
|
||||
}
|
||||
|
||||
@server(
|
||||
prefix: api/v1
|
||||
group: community
|
||||
jwt: Auth
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "发布帖子"
|
||||
@@ -87,19 +93,19 @@ service juwan-api {
|
||||
|
||||
@doc "点赞帖子"
|
||||
@handler LikePost
|
||||
post /posts/:id/like (EmptyResp) returns (EmptyResp)
|
||||
post /posts/:id/like (PathId) returns (EmptyResp)
|
||||
|
||||
@doc "取消点赞帖子"
|
||||
@handler UnlikePost
|
||||
delete /posts/:id/like (EmptyResp) returns (EmptyResp)
|
||||
delete /posts/:id/like (PathId) returns (EmptyResp)
|
||||
|
||||
@doc "置顶帖子"
|
||||
@handler PinPost
|
||||
post /posts/:id/pin (EmptyResp) returns (EmptyResp)
|
||||
post /posts/:id/pin (PathId) returns (EmptyResp)
|
||||
|
||||
@doc "取消置顶"
|
||||
@handler UnpinPost
|
||||
delete /posts/:id/pin (EmptyResp) returns (EmptyResp)
|
||||
delete /posts/:id/pin (PathId) returns (EmptyResp)
|
||||
|
||||
@doc "发表评论"
|
||||
@handler CreateComment
|
||||
@@ -107,9 +113,9 @@ service juwan-api {
|
||||
|
||||
@doc "点赞评论"
|
||||
@handler LikeComment
|
||||
post /comments/:id/like (EmptyResp) returns (EmptyResp)
|
||||
post /comments/:id/like (PathId) returns (EmptyResp)
|
||||
|
||||
@doc "取消点赞评论"
|
||||
@handler UnlikeComment
|
||||
delete /comments/:id/like (EmptyResp) returns (EmptyResp)
|
||||
delete /comments/:id/like (PathId) returns (EmptyResp)
|
||||
}
|
||||
+17
-12
@@ -2,32 +2,38 @@ syntax = "v1"
|
||||
import "common.api"
|
||||
|
||||
type (
|
||||
PathId {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
Dispute {
|
||||
Id string `json:"id"`
|
||||
OrderId string `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"`
|
||||
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"`
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
|
||||
CreateDisputeReq {
|
||||
Reason string `json:"reason"`
|
||||
PathId
|
||||
Reason string `json:"reason"`
|
||||
Evidence []string `json:"evidence"`
|
||||
}
|
||||
|
||||
DisputeResponseReq {
|
||||
Reason string `json:"reason"`
|
||||
PathId
|
||||
Reason string `json:"reason"`
|
||||
Evidence []string `json:"evidence"`
|
||||
}
|
||||
|
||||
AppealReq {
|
||||
PathId
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
)
|
||||
@@ -35,7 +41,6 @@ type (
|
||||
@server(
|
||||
prefix: api/v1
|
||||
group: dispute
|
||||
jwt: Auth
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "获取争议列表"
|
||||
@@ -44,7 +49,7 @@ service juwan-api {
|
||||
|
||||
@doc "获取订单争议"
|
||||
@handler GetOrderDispute
|
||||
get /orders/:id/dispute (EmptyResp) returns (Dispute)
|
||||
get /orders/:id/dispute (PathId) returns (Dispute)
|
||||
|
||||
@doc "发起争议"
|
||||
@handler CreateDispute
|
||||
|
||||
+26
-22
@@ -1,30 +1,34 @@
|
||||
syntax = "v1"
|
||||
|
||||
import "common.api"
|
||||
|
||||
type (
|
||||
Game {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Icon string `json:"icon"`
|
||||
Category string `json:"category"`
|
||||
}
|
||||
|
||||
GameListResp {
|
||||
Items []Game `json:"items"`
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
Game {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Icon string `json:"icon"`
|
||||
Category string `json:"category"`
|
||||
}
|
||||
GameListResp {
|
||||
Items []Game `json:"items"`
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
GetGameReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
)
|
||||
|
||||
@server(
|
||||
prefix: api/v1/games
|
||||
group: game
|
||||
@server (
|
||||
prefix: api/v1/games
|
||||
group: game
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "获取游戏列表"
|
||||
@handler ListGames
|
||||
get / (PageReq) returns (GameListResp)
|
||||
service game-api {
|
||||
@doc "获取游戏列表"
|
||||
@handler ListGames
|
||||
get / (PageReq) returns (GameListResp)
|
||||
|
||||
@doc "获取游戏详情"
|
||||
@handler GetGame
|
||||
get /:id (GetGameReq) returns (Game)
|
||||
}
|
||||
|
||||
@doc "获取游戏详情"
|
||||
@handler GetGame
|
||||
get /:id (EmptyResp) returns (Game)
|
||||
}
|
||||
@@ -2,8 +2,11 @@ syntax = "v1"
|
||||
import "common.api"
|
||||
|
||||
type (
|
||||
PathId {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
Notification {
|
||||
Id string `json:"id"`
|
||||
Id int64 `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
@@ -21,7 +24,6 @@ type (
|
||||
@server(
|
||||
prefix: api/v1
|
||||
group: notification
|
||||
jwt: Auth
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "获取通知列表"
|
||||
@@ -30,7 +32,7 @@ service juwan-api {
|
||||
|
||||
@doc "标记已读"
|
||||
@handler ReadNotification
|
||||
put /notifications/:id/read (EmptyResp) returns (EmptyResp)
|
||||
put /notifications/:id/read (PathId) returns (EmptyResp)
|
||||
|
||||
@doc "全部已读"
|
||||
@handler ReadAllNotifications
|
||||
|
||||
@@ -25,7 +25,6 @@ type (
|
||||
@server (
|
||||
prefix: /api/v1
|
||||
group: file
|
||||
jwt: Logger
|
||||
middleware: FileSizeLimit // 建议添加中间件限制文件大小
|
||||
)
|
||||
service file-api {
|
||||
|
||||
+16
-14
@@ -3,13 +3,16 @@ import "common.api"
|
||||
import "player.api" // 为了使用 PlayerService 定义
|
||||
|
||||
type (
|
||||
PathId {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
Order {
|
||||
Id string `json:"id"`
|
||||
ConsumerId string `json:"consumerId"`
|
||||
Id int64 `json:"id"`
|
||||
ConsumerId int64 `json:"consumerId"`
|
||||
ConsumerName string `json:"consumerName"`
|
||||
PlayerId string `json:"playerId"`
|
||||
PlayerName string `json:"playerName"`
|
||||
ShopId string `json:"shopId,optional"`
|
||||
ShopId int64 `json:"shopId,optional"`
|
||||
ShopName string `json:"shopName,optional"`
|
||||
Service PlayerService `json:"service"`
|
||||
Status string `json:"status"`
|
||||
@@ -32,9 +35,9 @@ type (
|
||||
}
|
||||
|
||||
CreateOrderReq {
|
||||
PlayerId string `json:"playerId"`
|
||||
ShopId string `json:"shopId,optional"`
|
||||
ServiceId string `json:"serviceId"`
|
||||
PlayerId int64 `json:"playerId"`
|
||||
ShopId int64 `json:"shopId,optional"`
|
||||
ServiceId int64 `json:"serviceId"`
|
||||
Quantity int `json:"quantity"`
|
||||
Note string `json:"note,optional"`
|
||||
}
|
||||
@@ -48,7 +51,6 @@ type (
|
||||
@server(
|
||||
prefix: api/v1/orders
|
||||
group: order
|
||||
jwt: Auth
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "获取订单列表"
|
||||
@@ -57,7 +59,7 @@ service juwan-api {
|
||||
|
||||
@doc "获取订单详情"
|
||||
@handler GetOrder
|
||||
get /:id (EmptyResp) returns (Order)
|
||||
get /:id (PathId) returns (Order)
|
||||
|
||||
@doc "创建订单"
|
||||
@handler CreateOrder
|
||||
@@ -69,25 +71,25 @@ service juwan-api {
|
||||
|
||||
@doc "支付订单"
|
||||
@handler PayOrder
|
||||
post /:id/pay (EmptyResp) returns (EmptyResp)
|
||||
post /:id/pay (PathId) returns (EmptyResp)
|
||||
|
||||
@doc "接单"
|
||||
@handler AcceptOrder
|
||||
post /:id/accept (EmptyResp) returns (EmptyResp)
|
||||
post /:id/accept (PathId) returns (EmptyResp)
|
||||
|
||||
@doc "申请结算"
|
||||
@handler RequestCloseOrder
|
||||
post /:id/request-close (EmptyResp) returns (EmptyResp)
|
||||
post /:id/request-close (PathId) returns (EmptyResp)
|
||||
|
||||
@doc "确认结算"
|
||||
@handler ConfirmCloseOrder
|
||||
post /:id/confirm-close (EmptyResp) returns (EmptyResp)
|
||||
post /:id/confirm-close (PathId) returns (EmptyResp)
|
||||
|
||||
@doc "取消订单"
|
||||
@handler CancelOrder
|
||||
post /:id/cancel (EmptyResp) returns (EmptyResp)
|
||||
post /:id/cancel (PathId) returns (EmptyResp)
|
||||
|
||||
@doc "再来一单"
|
||||
@handler Reorder
|
||||
post /:id/reorder (EmptyResp) returns (CreateOrderResp)
|
||||
post /:id/reorder (PathId) returns (CreateOrderResp)
|
||||
}
|
||||
+116
-91
@@ -1,110 +1,135 @@
|
||||
syntax = "v1"
|
||||
|
||||
import "common.api"
|
||||
|
||||
type (
|
||||
PlayerService {
|
||||
Id string `json:"id"`
|
||||
PlayerId string `json:"playerId"`
|
||||
GameId string `json:"gameId"`
|
||||
GameName string `json:"gameName"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Price float64 `json:"price"`
|
||||
Unit string `json:"unit"`
|
||||
RankRange string `json:"rankRange,optional"`
|
||||
Availability []string `json:"availability"`
|
||||
}
|
||||
|
||||
PlayerServiceListResp {
|
||||
Items []PlayerService `json:"items"`
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
|
||||
CreateServiceReq {
|
||||
GameId string `json:"gameId"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description,optional"`
|
||||
Price float64 `json:"price"`
|
||||
Unit string `json:"unit"`
|
||||
RankRange string `json:"rankRange,optional"`
|
||||
Availability []string `json:"availability,optional"`
|
||||
}
|
||||
|
||||
PlayerProfile {
|
||||
Id string `json:"id"`
|
||||
User UserProfile `json:"user"`
|
||||
Rating float64 `json:"rating"`
|
||||
TotalOrders int64 `json:"totalOrders"`
|
||||
CompletionRate float64 `json:"completionRate"`
|
||||
Status string `json:"status"`
|
||||
Games []string `json:"games"`
|
||||
Services []PlayerService `json:"services"`
|
||||
ShopId string `json:"shopId,optional"`
|
||||
ShopName string `json:"shopName,optional"`
|
||||
Tags []string `json:"tags"`
|
||||
}
|
||||
|
||||
PlayerListReq {
|
||||
PageReq
|
||||
GameId string `form:"gameId,optional"`
|
||||
Gender int `form:"gender,optional"`
|
||||
}
|
||||
|
||||
PlayerListResp {
|
||||
Items []PlayerProfile `json:"items"`
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
|
||||
UpdatePlayerStatusReq {
|
||||
Status string `json:"status"`
|
||||
}
|
||||
PlayerService {
|
||||
Id int64 `json:"id"`
|
||||
PlayerId int64 `json:"playerId"`
|
||||
GameId int64 `json:"gameId"`
|
||||
GameName string `json:"gameName"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Price float64 `json:"price"`
|
||||
Unit string `json:"unit"`
|
||||
RankRange string `json:"rankRange,optional"`
|
||||
Availability []string `json:"availability"`
|
||||
}
|
||||
PlayerServiceListResp {
|
||||
Items []PlayerService `json:"items"`
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
CreateServiceReq {
|
||||
Id int64 `path:"id"`
|
||||
GameId int64 `json:"gameId, optional"`
|
||||
Title string `json:"title,optional"`
|
||||
Description string `json:"description,optional"`
|
||||
Price float64 `json:"price"`
|
||||
Unit string `json:"unit"`
|
||||
RankRange string `json:"rankRange,optional"`
|
||||
Availability []string `json:"availability,optional"`
|
||||
}
|
||||
UpdateServiceReq {
|
||||
Id int64 `path:"id"`
|
||||
GameId *int64 `json:"gameId, optional"`
|
||||
Title *string `json:"title,optional"`
|
||||
Description *string `json:"description,optional"`
|
||||
Price *float64 `json:"price,optional"`
|
||||
Unit *string `json:"unit,optional"`
|
||||
RankRange *string `json:"rankRange,optional"`
|
||||
Availability []string `json:"availability"`
|
||||
}
|
||||
PlayerProfile {
|
||||
Id int64 `json:"id"`
|
||||
User UserProfile `json:"user"`
|
||||
Rating float64 `json:"rating"`
|
||||
TotalOrders int64 `json:"totalOrders"`
|
||||
CompletionRate float64 `json:"completionRate"`
|
||||
Status string `json:"status"`
|
||||
Games []string `json:"games"`
|
||||
Services []PlayerService `json:"services"`
|
||||
ShopId string `json:"shopId,optional"`
|
||||
ShopName string `json:"shopName,optional"`
|
||||
Tags []string `json:"tags"`
|
||||
}
|
||||
PlayerListReq {
|
||||
PageReq
|
||||
GameId int64 `form:"gameId,optional"`
|
||||
Gender int `form:"gender,optional"`
|
||||
}
|
||||
PlayerListResp {
|
||||
Items []PlayerProfile `json:"items"`
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
UpdatePlayerStatusReq {
|
||||
Status string `json:"status"`
|
||||
}
|
||||
)
|
||||
|
||||
@server(
|
||||
prefix: api/v1
|
||||
group: player
|
||||
type (
|
||||
GetServiceReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
GetPlayerReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
ListPlayerServicesReq {
|
||||
PageReq
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: player
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "获取打手列表"
|
||||
@handler ListPlayers
|
||||
get /players (PlayerListReq) returns (PlayerListResp)
|
||||
@doc "获取打手列表"
|
||||
@handler ListPlayers
|
||||
get /players (PlayerListReq) returns (PlayerListResp)
|
||||
|
||||
@doc "获取打手详情"
|
||||
@handler GetPlayer
|
||||
get /players/:id (EmptyResp) returns (PlayerProfile)
|
||||
@doc "获取打手详情"
|
||||
@handler GetPlayer
|
||||
get /players/:id (GetPlayerReq) returns (PlayerProfile)
|
||||
|
||||
@doc "获取所有服务列表"
|
||||
@handler ListServices
|
||||
get /services (PageReq) returns (PlayerServiceListResp)
|
||||
@doc "获取所有服务列表"
|
||||
@handler ListServices
|
||||
get /services (PageReq) returns (PlayerServiceListResp)
|
||||
|
||||
@doc "获取服务详情"
|
||||
@handler GetService
|
||||
get /services/:id (EmptyResp) returns (PlayerService)
|
||||
@doc "获取服务详情"
|
||||
@handler GetService
|
||||
get /services/:id (GetServiceReq) returns (PlayerService)
|
||||
|
||||
@doc "获取指定打手的服务列表"
|
||||
@handler ListPlayerServices
|
||||
get /players/:id/services (PageReq) returns (PlayerServiceListResp)
|
||||
@doc "获取指定打手的服务列表"
|
||||
@handler ListPlayerServices
|
||||
get /players/:id/services (ListPlayerServicesReq) returns (PlayerServiceListResp)
|
||||
}
|
||||
|
||||
@server(
|
||||
prefix: api/v1
|
||||
group: player
|
||||
jwt: Auth
|
||||
type (
|
||||
DeleteServiceReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: player
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "更新接单状态"
|
||||
@handler UpdatePlayerStatus
|
||||
put /players/me/status (UpdatePlayerStatusReq) returns (EmptyResp)
|
||||
@doc "更新接单状态"
|
||||
@handler UpdatePlayerStatus
|
||||
put /players/me/status (UpdatePlayerStatusReq) returns (EmptyResp)
|
||||
|
||||
@doc "创建服务"
|
||||
@handler CreateService
|
||||
post /services (CreateServiceReq) returns (PlayerService)
|
||||
@doc "创建服务"
|
||||
@handler CreateService
|
||||
post /services (CreateServiceReq) returns (PlayerService)
|
||||
|
||||
@doc "更新服务"
|
||||
@handler UpdateService
|
||||
put /services/:id (CreateServiceReq) returns (PlayerService)
|
||||
@doc "更新服务"
|
||||
@handler UpdateService
|
||||
put /services/:id (UpdateServiceReq) returns (PlayerService)
|
||||
|
||||
@doc "删除服务"
|
||||
@handler DeleteService
|
||||
delete /services/:id (DeleteServiceReq) returns (EmptyResp)
|
||||
}
|
||||
|
||||
@doc "删除服务"
|
||||
@handler DeleteService
|
||||
delete /services/:id (EmptyResp) returns (EmptyResp)
|
||||
}
|
||||
+3
-4
@@ -3,9 +3,9 @@ import "common.api"
|
||||
|
||||
type (
|
||||
Review {
|
||||
Id string `json:"id"`
|
||||
OrderId string `json:"orderId"`
|
||||
FromUserId string `json:"fromUserId"`
|
||||
Id int64 `json:"id"`
|
||||
OrderId int64 `json:"orderId"`
|
||||
FromUserId int64 `json:"fromUserId"`
|
||||
FromUserName string `json:"fromUserName"`
|
||||
Rating int `json:"rating"`
|
||||
Content string `json:"content"`
|
||||
@@ -27,7 +27,6 @@ type (
|
||||
@server(
|
||||
prefix: api/v1
|
||||
group: review
|
||||
jwt: Auth
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "提交评价"
|
||||
|
||||
+7
-4
@@ -2,6 +2,9 @@ syntax = "v1"
|
||||
import "common.api"
|
||||
|
||||
type (
|
||||
PathIDReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
SearchReq {
|
||||
PageReq
|
||||
Q string `form:"q"`
|
||||
@@ -18,12 +21,13 @@ type (
|
||||
|
||||
FavoriteReq {
|
||||
TargetType string `json:"targetType"` // player, shop
|
||||
TargetId string `json:"targetId"`
|
||||
TargetId int64 `json:"targetId"`
|
||||
}
|
||||
|
||||
FavoriteCheckReq {
|
||||
PathIDReq
|
||||
TargetType string `form:"targetType"`
|
||||
TargetId string `form:"targetId"`
|
||||
TargetId int64 `form:"targetId"`
|
||||
}
|
||||
|
||||
FavoriteCheckResp {
|
||||
@@ -48,7 +52,6 @@ service juwan-api {
|
||||
@server(
|
||||
prefix: api/v1
|
||||
group: favorites
|
||||
jwt: Auth
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "获取收藏列表"
|
||||
@@ -61,7 +64,7 @@ service juwan-api {
|
||||
|
||||
@doc "取消收藏"
|
||||
@handler RemoveFavorite
|
||||
delete /favorites/:id (EmptyResp) returns (EmptyResp)
|
||||
delete /favorites/:id (PathIDReq) returns (EmptyResp)
|
||||
|
||||
@doc "检查收藏状态"
|
||||
@handler CheckFavorite
|
||||
|
||||
+123
-106
@@ -1,130 +1,147 @@
|
||||
syntax = "v1"
|
||||
|
||||
import "common.api"
|
||||
|
||||
type (
|
||||
ShopProfile {
|
||||
Id string `json:"id"`
|
||||
Owner UserProfile `json:"owner"`
|
||||
Name string `json:"name"`
|
||||
Banner string `json:"banner,optional"`
|
||||
Description string `json:"description"`
|
||||
Rating float64 `json:"rating"`
|
||||
TotalOrders int64 `json:"totalOrders"`
|
||||
PlayerCount int64 `json:"playerCount"`
|
||||
CommissionType string `json:"commissionType"`
|
||||
CommissionValue float64 `json:"commissionValue"`
|
||||
Announcements []string `json:"announcements"`
|
||||
TemplateConfig interface{} `json:"templateConfig"`
|
||||
}
|
||||
|
||||
ShopListResp {
|
||||
Items []ShopProfile `json:"items"`
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
|
||||
CreateShopReq {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
CommissionType string `json:"commissionType"`
|
||||
CommissionValue float64 `json:"commissionValue"`
|
||||
}
|
||||
|
||||
UpdateShopReq {
|
||||
Name string `json:"name,optional"`
|
||||
Description string `json:"description,optional"`
|
||||
CommissionType string `json:"commissionType,optional"`
|
||||
CommissionValue float64 `json:"commissionValue,optional"`
|
||||
AllowMultiShop bool `json:"allowMultiShop,optional"`
|
||||
AllowIndependentOrders bool `json:"allowIndependentOrders,optional"`
|
||||
DispatchMode string `json:"dispatchMode,optional"`
|
||||
}
|
||||
|
||||
UpdateTemplateReq {
|
||||
Sections interface{} `json:"sections"`
|
||||
}
|
||||
|
||||
AnnouncementReq {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
IncomeStatsResp {
|
||||
MonthlyIncome float64 `json:"monthlyIncome"`
|
||||
PendingSettlement float64 `json:"pendingSettlement"`
|
||||
TotalWithdrawn float64 `json:"totalWithdrawn"`
|
||||
TotalOrders int64 `json:"totalOrders"`
|
||||
CompletedOrders int64 `json:"completedOrders"`
|
||||
}
|
||||
|
||||
InvitationReq {
|
||||
PlayerId string `json:"playerId"`
|
||||
}
|
||||
ShopProfile {
|
||||
Id string `json:"id"`
|
||||
Owner UserProfile `json:"owner"`
|
||||
Name string `json:"name"`
|
||||
Banner string `json:"banner,optional"`
|
||||
Description string `json:"description"`
|
||||
Rating float64 `json:"rating"`
|
||||
TotalOrders int64 `json:"totalOrders"`
|
||||
PlayerCount int64 `json:"playerCount"`
|
||||
CommissionType string `json:"commissionType"`
|
||||
CommissionValue float64 `json:"commissionValue"`
|
||||
Announcements []string `json:"announcements"`
|
||||
TemplateConfig interface{} `json:"templateConfig"`
|
||||
}
|
||||
ShopListResp {
|
||||
Items []ShopProfile `json:"items"`
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
CreateShopReq {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
CommissionType string `json:"commissionType"`
|
||||
CommissionValue float64 `json:"commissionValue"`
|
||||
}
|
||||
UpdateShopReq {
|
||||
Id int64 `path:"id"`
|
||||
Name string `json:"name,optional"`
|
||||
Description string `json:"description,optional"`
|
||||
CommissionType string `json:"commissionType,optional"`
|
||||
CommissionValue float64 `json:"commissionValue,optional"`
|
||||
AllowMultiShop bool `json:"allowMultiShop,optional"`
|
||||
AllowIndependentOrders bool `json:"allowIndependentOrders,optional"`
|
||||
DispatchMode string `json:"dispatchMode,optional"`
|
||||
}
|
||||
UpdateTemplateReq {
|
||||
Id int64 `path:"id"`
|
||||
Sections interface{} `json:"sections"`
|
||||
}
|
||||
AnnouncementReq {
|
||||
Id int64 `path:"id"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
IncomeStatsResp {
|
||||
MonthlyIncome float64 `json:"monthlyIncome"`
|
||||
PendingSettlement float64 `json:"pendingSettlement"`
|
||||
TotalWithdrawn float64 `json:"totalWithdrawn"`
|
||||
TotalOrders int64 `json:"totalOrders"`
|
||||
CompletedOrders int64 `json:"completedOrders"`
|
||||
}
|
||||
InvitationReq {
|
||||
Id int64 `path:"id"`
|
||||
PlayerId int64 `json:"playerId"`
|
||||
}
|
||||
)
|
||||
|
||||
@server(
|
||||
prefix: api/v1
|
||||
group: shop
|
||||
type (
|
||||
ShopIdReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
UserIdReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: shop
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "获取店铺列表"
|
||||
@handler ListShops
|
||||
get /shops (PageReq) returns (ShopListResp)
|
||||
@doc "获取店铺列表"
|
||||
@handler ListShops
|
||||
get /shops (PageReq) returns (ShopListResp)
|
||||
|
||||
@doc "获取店铺详情"
|
||||
@handler GetShop
|
||||
get /shops/:id (EmptyResp) returns (ShopProfile)
|
||||
@doc "获取店铺详情"
|
||||
@handler GetShop
|
||||
get /shops/:id (ShopIdReq) returns (ShopProfile)
|
||||
|
||||
@doc "获取店长的店铺"
|
||||
@handler GetUserShop
|
||||
get /users/:id/shop (EmptyResp) returns (ShopProfile)
|
||||
@doc "获取店长的店铺"
|
||||
@handler GetUserShop
|
||||
get /users/:id/shop (UserIdReq) returns (ShopProfile)
|
||||
}
|
||||
|
||||
@server(
|
||||
prefix: api/v1
|
||||
group: shop
|
||||
jwt: Auth
|
||||
type (
|
||||
DeleteAnnouncementReq {
|
||||
Id int64 `path:"id"`
|
||||
index int64 `path:"index"`
|
||||
}
|
||||
AcceptInvitationReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: shop
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "创建店铺"
|
||||
@handler CreateShop
|
||||
post /shops (CreateShopReq) returns (ShopProfile)
|
||||
@doc "创建店铺"
|
||||
@handler CreateShop
|
||||
post /shops (CreateShopReq) returns (ShopProfile)
|
||||
|
||||
@doc "获取当前用户的店铺"
|
||||
@handler GetMyShop
|
||||
get /shops/mine (EmptyResp) returns (ShopProfile)
|
||||
@doc "获取当前用户的店铺"
|
||||
@handler GetMyShop
|
||||
get /shops/mine (EmptyResp) returns (ShopProfile)
|
||||
|
||||
@doc "更新店铺信息"
|
||||
@handler UpdateShop
|
||||
put /shops/:id (UpdateShopReq) returns (ShopProfile)
|
||||
@doc "更新店铺信息"
|
||||
@handler UpdateShop
|
||||
put /shops/:id (ShopIdReq) returns (ShopProfile)
|
||||
|
||||
@doc "更新店铺模板"
|
||||
@handler UpdateShopTemplate
|
||||
put /shops/:id/template (UpdateTemplateReq) returns (EmptyResp)
|
||||
@doc "更新店铺模板"
|
||||
@handler UpdateShopTemplate
|
||||
put /shops/:id/template (UpdateTemplateReq) returns (EmptyResp)
|
||||
|
||||
@doc "新增店铺公告"
|
||||
@handler AddAnnouncement
|
||||
post /shops/:id/announcements (AnnouncementReq) returns (EmptyResp)
|
||||
@doc "新增店铺公告"
|
||||
@handler AddAnnouncement
|
||||
post /shops/:id/announcements (AnnouncementReq) returns (EmptyResp)
|
||||
|
||||
@doc "删除店铺公告"
|
||||
@handler DeleteAnnouncement
|
||||
delete /shops/:id/announcements/:index (EmptyResp) returns (EmptyResp)
|
||||
@doc "删除店铺公告"
|
||||
@handler DeleteAnnouncement
|
||||
delete /shops/:id/announcements/:index (DeleteAnnouncementReq) returns (EmptyResp)
|
||||
|
||||
@doc "邀请打手"
|
||||
@handler InvitePlayer
|
||||
post /shops/:id/invitations (InvitationReq) returns (EmptyResp)
|
||||
@doc "邀请打手"
|
||||
@handler InvitePlayer
|
||||
post /shops/:id/invitations (InvitationReq) returns (EmptyResp)
|
||||
|
||||
@doc "接受邀请"
|
||||
@handler AcceptInvitation
|
||||
post /shops/invitations/:id/accept (EmptyResp) returns (EmptyResp)
|
||||
@doc "接受邀请"
|
||||
@handler AcceptInvitation
|
||||
post /shops/invitations/:id/accept (AcceptInvitationReq) returns (EmptyResp)
|
||||
|
||||
@doc "拒绝邀请"
|
||||
@handler RejectInvitation
|
||||
delete /shops/invitations/:id (EmptyResp) returns (EmptyResp)
|
||||
@doc "拒绝邀请"
|
||||
@handler RejectInvitation
|
||||
delete /shops/invitations/:id (AcceptInvitationReq) returns (EmptyResp)
|
||||
|
||||
@doc "移除打手"
|
||||
@handler RemovePlayer
|
||||
delete /shops/:id/players/:playerId (EmptyResp) returns (EmptyResp)
|
||||
@doc "移除打手"
|
||||
@handler RemovePlayer
|
||||
delete /shops/:id/players/:playerId (InvitationReq) returns (EmptyResp)
|
||||
|
||||
@doc "获取收入统计"
|
||||
@handler GetShopIncomeStats
|
||||
get /shops/:id/income-stats (AcceptInvitationReq) returns (IncomeStatsResp)
|
||||
}
|
||||
|
||||
@doc "获取收入统计"
|
||||
@handler GetShopIncomeStats
|
||||
get /shops/:id/income-stats (EmptyResp) returns (IncomeStatsResp)
|
||||
}
|
||||
@@ -18,7 +18,6 @@ info (
|
||||
@server (
|
||||
group: verification_user
|
||||
prefix: /api/v1/users
|
||||
jwt: Auth // 必须登录
|
||||
)
|
||||
service verification-api {
|
||||
@doc "提交或修改角色认证申请 (支持幂等更新)"
|
||||
@@ -37,7 +36,6 @@ service verification-api {
|
||||
@server (
|
||||
group: verification_admin
|
||||
prefix: /api/v1/admin
|
||||
jwt: Auth // 需要登录,且 Logic 层需校验 IsAdmin
|
||||
)
|
||||
service verification-api {
|
||||
@doc "管理员获取认证申请列表 (分页)"
|
||||
|
||||
+1
-2
@@ -8,7 +8,7 @@ type (
|
||||
}
|
||||
|
||||
Transaction {
|
||||
Id string `json:"id"`
|
||||
Id int64 `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Amount float64 `json:"amount"`
|
||||
Description string `json:"description"`
|
||||
@@ -30,7 +30,6 @@ type (
|
||||
@server(
|
||||
prefix: api/v1/wallet
|
||||
group: wallet
|
||||
jwt: Auth
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "获取余额"
|
||||
|
||||
Reference in New Issue
Block a user