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
@@ -0,0 +1,37 @@
package logic
import (
"context"
"juwan-backend/app/player/rpc/internal/svc"
"juwan-backend/app/player/rpc/pb"
"github.com/shopspring/decimal"
"github.com/zeromicro/go-zero/core/logx"
)
type UpdatePlayersLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewUpdatePlayersLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdatePlayersLogic {
return &UpdatePlayersLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *UpdatePlayersLogic) UpdatePlayers(in *pb.UpdatePlayersReq) (*pb.UpdatePlayersResp, error) {
update := l.svcCtx.PlayerModelRW.Players.UpdateOneID(in.Id).
SetNillableStatus(in.Status).
SetNillableUserID(in.UserId).
SetNillableShopID(in.ShopId)
if in.Rating != nil {
rating := decimal.NewFromFloat(*in.Rating)
update.SetRating(rating)
}
return &pb.UpdatePlayersResp{}, nil
}