调整任务查询,回调,奖励类型查询
This commit is contained in:
@ -11,6 +11,7 @@ import (
|
||||
"server/api/reward/v1"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
"server/utility/gamelife"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -22,17 +23,17 @@ func (c *ControllerV1) Callback(ctx context.Context, req *v1.CallbackReq) (res *
|
||||
auth := fromCtx.Header.Get("Custom-Data-Auth")
|
||||
glog.Infof(ctx, fmt.Sprintf("appid:%s,timestamp:%s,nonce:%s,auth:%s", appid, timestamp, nonce, auth))
|
||||
|
||||
data := fmt.Sprintf("%s%s%s%s%d%d%d%s%s%s#%s", req.Uid, req.OrderId, req.PrizeChannelId, req.PrizeId, req.PrizeType, req.PrizeSubType, req.Num, appid, timestamp, nonce, auth)
|
||||
data := fmt.Sprintf("%s%s%s%s%d%d%d%s%s%s#%s", req.Uid, req.OrderId, req.PrizeChannelId, req.PrizeId, req.PrizeType, req.PrizeSubType, req.Num, appid, timestamp, nonce, gamelife.GetGamelifeClient(ctx).GetSecret())
|
||||
stateOri := md5.Sum([]byte(data))
|
||||
state := hex.EncodeToString(stateOri[:])
|
||||
myAuth := strings.ToUpper(state)
|
||||
glog.Infof(ctx, fmt.Sprintf("%s,%s,%s,%s,%d,%d,%d,%s,%s,%s,#%s", req.Uid, req.OrderId, req.PrizeChannelId, req.PrizeId, req.PrizeType, req.PrizeSubType, req.Num, appid, timestamp, nonce, auth))
|
||||
|
||||
glog.Infof(ctx, fmt.Sprintf("myAuth:%s,auth:%s", myAuth, auth))
|
||||
if myAuth != auth {
|
||||
glog.Infof(ctx, fmt.Sprintf("myAuth:%s,auth:%s", myAuth, auth))
|
||||
return &v1.CallbackRes{Errcode: 252151000, OrderId: req.OrderId, Datas: []v1.CallbackData{{PrizeCode: req.OrderId}}}, err
|
||||
}
|
||||
glog.Infof(ctx, fmt.Sprintf("%s,%s,%s,%s,%d,%d,%d,%s,%s,%s,#%s", req.Uid, req.OrderId, req.PrizeChannelId, req.PrizeId, req.PrizeType, req.PrizeSubType, req.Num, appid, timestamp, nonce, auth))
|
||||
|
||||
out, err := service.Reward().CallBack(ctx, &model.RewardCallbackIn{
|
||||
Uid: req.Uid,
|
||||
|
||||
@ -19,6 +19,7 @@ func (c *ControllerV1) GetTask(ctx context.Context, req *v1.GetTaskReq) (res *v1
|
||||
UserId: userId,
|
||||
GameId: req.GameId,
|
||||
TaskName: req.TaskName,
|
||||
TaskType: req.TaskType,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
|
||||
func (c *ControllerV1) GetTaskList(ctx context.Context, req *v1.GetTaskListReq) (res *v1.GetTaskListRes, err error) {
|
||||
|
||||
userId := g.RequestFromCtx(ctx).Get("id").Int64()
|
||||
userId := g.RequestFromCtx(ctx).GetCtxVar("id").Int64()
|
||||
list, err := service.Task().GetTaskList(ctx, &model.GetTaskListV2In{
|
||||
Gid: req.Gid,
|
||||
NetBarAccount: req.NetBarAccount,
|
||||
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
func (c *ControllerV1) SyncTask(ctx context.Context, req *v1.SyncTaskReq) (res *v1.SyncTaskRes, err error) {
|
||||
go func() {
|
||||
_, err = service.Task().SyncTaskFromGamelife(ctx)
|
||||
_, err = service.Task().SyncTaskFromGamelife(context.Background())
|
||||
}()
|
||||
return &v1.SyncTaskRes{
|
||||
Message: "同步调用成功,等待数据同步,5分钟后刷新",
|
||||
|
||||
Reference in New Issue
Block a user