fix: shop_players 关系表主键与模型对齐

This commit is contained in:
zetaloop
2026-04-04 06:25:49 +08:00
parent 3a81aec527
commit 7dc088eadf
18 changed files with 91 additions and 310 deletions
@@ -3,7 +3,6 @@ package logic
import (
"context"
"errors"
"juwan-backend/app/snowflake/rpc/snowflake"
"juwan-backend/app/shop/rpc/internal/svc"
"juwan-backend/app/shop/rpc/pb"
@@ -27,14 +26,7 @@ func NewAddShopPlayersLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ad
// -----------------------shopPlayers-----------------------
func (l *AddShopPlayersLogic) AddShopPlayers(in *pb.AddShopPlayersReq) (*pb.AddShopPlayersResp, error) {
idResp, err := l.svcCtx.Snowflake.NextId(l.ctx, &snowflake.NextIdReq{})
if err != nil {
logx.Errorf("addPlayerServices err:%v", err)
return nil, errors.New("create player service id failed")
}
_, err = l.svcCtx.ShopModelRW.ShopPlayers.Create().
SetID(idResp.Id).
_, err := l.svcCtx.ShopModelRW.ShopPlayers.Create().
SetShopID(in.ShopId).
SetPlayerID(in.PlayerId).
SetIsPrimary(in.IsPrimary).