fix: 为移除打手端点使用独立的 path 参数请求类型
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
// 移除打手
|
||||
func RemovePlayerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.InvitationReq
|
||||
var req types.RemovePlayerReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
|
||||
@@ -31,7 +31,7 @@ func NewRemovePlayerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Remo
|
||||
}
|
||||
}
|
||||
|
||||
func (l *RemovePlayerLogic) RemovePlayer(req *types.InvitationReq) (resp *types.EmptyResp, err error) {
|
||||
func (l *RemovePlayerLogic) RemovePlayer(req *types.RemovePlayerReq) (resp *types.EmptyResp, err error) {
|
||||
userID, err := contextj.UserIDFrom(l.ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -51,6 +51,11 @@ type PageReq struct {
|
||||
Limit int64 `form:"limit,default=20"`
|
||||
}
|
||||
|
||||
type RemovePlayerReq struct {
|
||||
Id int64 `path:"id"`
|
||||
PlayerId int64 `path:"playerId"`
|
||||
}
|
||||
|
||||
type ShopIdReq struct {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
|
||||
+5
-1
@@ -90,6 +90,10 @@ type (
|
||||
Id int64 `path:"id"`
|
||||
index int64 `path:"index"`
|
||||
}
|
||||
RemovePlayerReq {
|
||||
Id int64 `path:"id"`
|
||||
PlayerId int64 `path:"playerId"`
|
||||
}
|
||||
AcceptInvitationReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
@@ -158,7 +162,7 @@ service shop-api {
|
||||
|
||||
@doc "移除打手"
|
||||
@handler RemovePlayer
|
||||
delete /shops/:id/players/:playerId (InvitationReq) returns (EmptyResp)
|
||||
delete /shops/:id/players/:playerId (RemovePlayerReq) returns (EmptyResp)
|
||||
|
||||
@doc "获取收入统计"
|
||||
@handler GetShopIncomeStats
|
||||
|
||||
Reference in New Issue
Block a user