调整奖励接口
This commit is contained in:
@ -14,22 +14,30 @@ func (c *ControllerV1) Create(ctx context.Context, req *v1.CreateReq) (res *v1.C
|
||||
operatorId := fromCtx.GetCtxVar("id").Int64()
|
||||
operatorRole := fromCtx.GetCtxVar("role").String()
|
||||
out, err := service.Reward().Create(ctx, &model.RewardCreateIn{
|
||||
Name: req.Name,
|
||||
Description: req.Description,
|
||||
Value: req.Value,
|
||||
Status: req.Status,
|
||||
OperatorId: operatorId,
|
||||
OperatorRole: operatorRole,
|
||||
StoreId: req.StoreId,
|
||||
RewardTypeId: req.RewardTypeId,
|
||||
Source: req.Source,
|
||||
ExpireType: req.ExpireType,
|
||||
ExpireDays: req.ExpireDays,
|
||||
ValidFrom: req.ValidFrom,
|
||||
ValidTo: req.ValidTo,
|
||||
StoreId: req.StoreId,
|
||||
Name: req.Name,
|
||||
RewardTypeId: req.RewardTypeId,
|
||||
GameId: req.GameId,
|
||||
Img: req.RewardImg,
|
||||
QQGoodsId: req.QQGoodsId,
|
||||
QQGoodsIdStr: req.QQGoodsIdStr,
|
||||
Status: req.Status,
|
||||
OperatorId: operatorId,
|
||||
OperatorRole: operatorRole,
|
||||
ExpireType: req.ExpireType,
|
||||
ExpireDays: req.ExpireDays,
|
||||
ValidFrom: req.ValidFrom,
|
||||
ValidTo: req.ValidTo,
|
||||
DailyTotalLimit: int64(req.DailyTotalLimit),
|
||||
TotalLimit: int64(req.TotalLimit),
|
||||
UserDailyLimit: int64(req.UserDailyLimit),
|
||||
UserTotalLimit: int64(req.UserTotalLimit),
|
||||
GrantQuantity: int64(req.GrantQuantify),
|
||||
Source: req.Source,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.CreateRes{Id: out.Id}, nil
|
||||
return &v1.CreateRes{Success: out.Success}, nil
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ func (c *ControllerV1) Delete(ctx context.Context, req *v1.DeleteReq) (res *v1.D
|
||||
fromCtx := g.RequestFromCtx(ctx)
|
||||
operatorId := fromCtx.GetCtxVar("id").Int64()
|
||||
operatorRole := fromCtx.GetCtxVar("role").String()
|
||||
out, err := service.Reward().Delete(ctx, &model.RewardDeleteIn{Id: req.Id, OperatorId: operatorId, OperatorRole: operatorRole})
|
||||
out, err := service.Reward().Delete(ctx, &model.RewardDeleteIn{Id: req.Id, OperatorId: operatorId, OperatorRole: operatorRole, Source: req.Source})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@ -14,18 +14,26 @@ func (c *ControllerV1) Update(ctx context.Context, req *v1.UpdateReq) (res *v1.U
|
||||
operatorId := fromCtx.GetCtxVar("id").Int64()
|
||||
operatorRole := fromCtx.GetCtxVar("role").String()
|
||||
out, err := service.Reward().Update(ctx, &model.RewardUpdateIn{
|
||||
Id: req.Id,
|
||||
Name: req.Name,
|
||||
Description: req.Description,
|
||||
Value: req.Value,
|
||||
OperatorId: operatorId,
|
||||
OperatorRole: operatorRole,
|
||||
StoreId: req.StoreId,
|
||||
Status: req.Status,
|
||||
ExpireType: req.ExpireType,
|
||||
ExpireDays: req.ExpireDays,
|
||||
ValidFrom: req.ValidFrom,
|
||||
ValidTo: req.ValidTo,
|
||||
Id: req.Id,
|
||||
Name: req.Name,
|
||||
RewardTypeId: int64(req.RewardType),
|
||||
GameId: req.GameId,
|
||||
Img: req.Img,
|
||||
QQGoodsId: req.QQGoodsId,
|
||||
QQGoodsIdStr: req.QQGoodsIdStr,
|
||||
OperatorId: operatorId,
|
||||
OperatorRole: operatorRole,
|
||||
Status: req.Status,
|
||||
ExpireType: req.ExpireType,
|
||||
ExpireDays: req.ExpireDays,
|
||||
ValidFrom: req.ValidFrom,
|
||||
ValidTo: req.ValidTo,
|
||||
DailyTotalLimit: int64(req.DailyTotalLimit),
|
||||
TotalLimit: int64(req.TotalLimit),
|
||||
UserDailyLimit: int64(req.UserDailyLimit),
|
||||
UserTotalLimit: int64(req.UserTotalLimit),
|
||||
GrantQuantity: int64(req.GrantQuantify),
|
||||
Source: req.Source,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user