调整游戏新增编辑接口
This commit is contained in:
@ -80,7 +80,6 @@ func (s *sGame) CreateGame(ctx context.Context, in *model.AddGameIn) (out *model
|
||||
}
|
||||
|
||||
func (s *sGame) UpdateGame(ctx context.Context, in *model.UpdateGameIn) (out *model.UpdateGameOut, err error) {
|
||||
|
||||
// 判断游戏是否存在
|
||||
exist, err := dao.Games.Ctx(ctx).Where(do.Games{Id: in.Id}).Exist()
|
||||
if err != nil {
|
||||
@ -118,7 +117,7 @@ func (s *sGame) UpdateGame(ctx context.Context, in *model.UpdateGameIn) (out *mo
|
||||
return nil, ecode.Params.Sub("游戏编码已存在")
|
||||
}
|
||||
|
||||
_, err = dao.Games.Ctx(ctx).Where(do.Games{Id: in.Id}).Update(do.Games{
|
||||
_, err = dao.Games.Ctx(ctx).Where(do.Games{Id: in.Id}).OmitEmptyData().Update(do.Games{
|
||||
GameId: in.GameId,
|
||||
GameName: in.GameName,
|
||||
GameCode: in.GameCode,
|
||||
|
||||
Reference in New Issue
Block a user