fix: api descript

This commit is contained in:
wwweww
2026-02-28 05:33:16 +08:00
parent 5930fb0dde
commit d2f33b4b96
243 changed files with 37065 additions and 780 deletions
+123 -106
View File
@@ -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)
}