fix: shop_players 关系表主键与模型对齐
This commit is contained in:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user