fix: api descript
This commit is contained in:
+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)
|
||||
}
|
||||
Reference in New Issue
Block a user