调整 rsa 密钥解析函数
This commit is contained in:
29
internal/controller/reward/reward_v1_reward_callback.go
Normal file
29
internal/controller/reward/reward_v1_reward_callback.go
Normal file
@ -0,0 +1,29 @@
|
||||
package reward
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/glog"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
|
||||
"server/api/reward/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) RewardCallback(ctx context.Context, req *v1.RewardCallbackReq) (res *v1.RewardCallbackRes, err error) {
|
||||
appId := g.RequestFromCtx(ctx).GetHeader("Custom-Data-Appid")
|
||||
timestamp := g.RequestFromCtx(ctx).GetHeader("Custom-Data-Timestamp")
|
||||
nonce := g.RequestFromCtx(ctx).GetHeader("Custom-Data-Nonce")
|
||||
auth := g.RequestFromCtx(ctx).GetHeader("Custom-Data-Auth")
|
||||
|
||||
glog.Infof(ctx, "appId: %s, timestamp: %s, nonce: %s, auth: %s", appId, timestamp, nonce, auth)
|
||||
secret := ""
|
||||
data := fmt.Sprintf("%s%s%s%s%d%d%d%s%s%s#%s", req.UId, req.OrderId, req.PrizeId, req.PrizeChannelId, req.PrizeType, req.PrizeSubType, req.Num, appId, timestamp, nonce, secret)
|
||||
if data != auth {
|
||||
|
||||
}
|
||||
|
||||
return nil, gerror.NewCode(gcode.CodeNotImplemented)
|
||||
}
|
||||
Reference in New Issue
Block a user