add: some user api and all api desc
This commit is contained in:
@@ -0,0 +1,130 @@
|
||||
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"`
|
||||
}
|
||||
)
|
||||
|
||||
@server(
|
||||
prefix: api/v1
|
||||
group: shop
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "获取店铺列表"
|
||||
@handler ListShops
|
||||
get /shops (PageReq) returns (ShopListResp)
|
||||
|
||||
@doc "获取店铺详情"
|
||||
@handler GetShop
|
||||
get /shops/:id (EmptyResp) returns (ShopProfile)
|
||||
|
||||
@doc "获取店长的店铺"
|
||||
@handler GetUserShop
|
||||
get /users/:id/shop (EmptyResp) returns (ShopProfile)
|
||||
}
|
||||
|
||||
@server(
|
||||
prefix: api/v1
|
||||
group: shop
|
||||
jwt: Auth
|
||||
)
|
||||
service juwan-api {
|
||||
@doc "创建店铺"
|
||||
@handler CreateShop
|
||||
post /shops (CreateShopReq) returns (ShopProfile)
|
||||
|
||||
@doc "获取当前用户的店铺"
|
||||
@handler GetMyShop
|
||||
get /shops/mine (EmptyResp) returns (ShopProfile)
|
||||
|
||||
@doc "更新店铺信息"
|
||||
@handler UpdateShop
|
||||
put /shops/:id (UpdateShopReq) returns (ShopProfile)
|
||||
|
||||
@doc "更新店铺模板"
|
||||
@handler UpdateShopTemplate
|
||||
put /shops/:id/template (UpdateTemplateReq) 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 InvitePlayer
|
||||
post /shops/:id/invitations (InvitationReq) returns (EmptyResp)
|
||||
|
||||
@doc "接受邀请"
|
||||
@handler AcceptInvitation
|
||||
post /shops/invitations/:id/accept (EmptyResp) returns (EmptyResp)
|
||||
|
||||
@doc "拒绝邀请"
|
||||
@handler RejectInvitation
|
||||
delete /shops/invitations/:id (EmptyResp) returns (EmptyResp)
|
||||
|
||||
@doc "移除打手"
|
||||
@handler RemovePlayer
|
||||
delete /shops/:id/players/:playerId (EmptyResp) returns (EmptyResp)
|
||||
|
||||
@doc "获取收入统计"
|
||||
@handler GetShopIncomeStats
|
||||
get /shops/:id/income-stats (EmptyResp) returns (IncomeStatsResp)
|
||||
}
|
||||
Reference in New Issue
Block a user