修改tencent回调
This commit is contained in:
@ -4,12 +4,14 @@ import (
|
||||
"context"
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/glog"
|
||||
"server/api/reward/v1"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
"server/utility/ecode"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -48,13 +50,19 @@ func (c *ControllerV1) Callback(ctx context.Context, req *v1.CallbackReq) (res *
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &v1.CallbackRes{
|
||||
AppId: appid,
|
||||
Datas: out.Datas,
|
||||
Errcode: out.Errcode,
|
||||
Errmsg: out.Errmsg,
|
||||
OrderId: out.OrderId,
|
||||
}, nil
|
||||
//return &v1.CallbackRes{
|
||||
// AppId: appid,
|
||||
// Datas: out.Datas,
|
||||
// Errcode: out.Errcode,
|
||||
// Errmsg: out.Errmsg,
|
||||
// OrderId: out.OrderId,
|
||||
//}, nil
|
||||
|
||||
marshal, err := json.Marshal(out)
|
||||
if err != nil {
|
||||
return nil, ecode.Fail.Sub("序列化 json 数据出现异常")
|
||||
}
|
||||
g.RequestFromCtx(ctx).Response.Write(marshal)
|
||||
return nil, nil
|
||||
//return &v1.CallbackRes{Errcode: 0, OrderId: req.OrderId, Datas: []v1.CallbackData{{PrizeCode: req.OrderId}}}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user