调整 rsa 密钥解析函数

This commit is contained in:
2025-06-16 10:19:38 +08:00
parent 4c491f5c2e
commit 2903be6223
19 changed files with 235 additions and 96 deletions

View 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)
}