new version qnc

This commit is contained in:
2025-04-11 13:10:17 +08:00
parent 91db6239d9
commit b0cbe2e81d
162 changed files with 1361 additions and 1556 deletions

View File

@@ -6,13 +6,13 @@ import (
"encoding/json"
"fmt"
"os"
"qnc-server/app/user/cmd/api/internal/svc"
"qnc-server/app/user/cmd/api/internal/types"
"qnc-server/app/user/model"
"qnc-server/pkg/lzkit/crypto"
"qnc-server/pkg/lzkit/lzUtils"
"regexp"
"strings"
"tydata-server/app/user/cmd/api/internal/svc"
"tydata-server/app/user/cmd/api/internal/types"
"tydata-server/app/user/model"
"tydata-server/pkg/lzkit/crypto"
"tydata-server/pkg/lzkit/lzUtils"
"github.com/hibiken/asynq"
"github.com/zeromicro/go-zero/core/logx"
@@ -55,21 +55,21 @@ func (l *PaySuccessNotifyUserHandler) ProcessTask(ctx context.Context, t *asynq.
redisKey := fmt.Sprintf("%d:%s", order.UserId, order.OrderNo)
cache, cacheErr := l.svcCtx.Redis.GetCtx(ctx, redisKey)
if cacheErr != nil {
return fmt.Errorf("生成订单, 获取缓存内容失败: %+v", cacheErr)
return fmt.Errorf("获取缓存内容失败: %+v", cacheErr)
}
var data types.QueryCacheLoad
err = json.Unmarshal([]byte(cache), &data)
if err != nil {
return fmt.Errorf("生成订单, 解析缓存内容失败: %+v", err)
return fmt.Errorf("解析缓存内容失败: %+v", err)
}
secretKey := l.svcCtx.Config.Encrypt.SecretKey
key, decodeErr := hex.DecodeString(secretKey)
if decodeErr != nil {
return fmt.Errorf("生成订单, 获取AES密钥失败: %+v", decodeErr)
return fmt.Errorf("获取AES密钥失败: %+v", decodeErr)
}
decryptData, aesdecryptErr := crypto.AesDecrypt(data.Params, key)
if aesdecryptErr != nil {
return fmt.Errorf("生成订单, 解密参数失败: %+v", aesdecryptErr)
return fmt.Errorf("解密参数失败: %+v", aesdecryptErr)
}
// 敏感数据脱敏处理
@@ -93,7 +93,7 @@ func (l *PaySuccessNotifyUserHandler) ProcessTask(ctx context.Context, t *asynq.
}
result, insertQueryErr := l.svcCtx.QueryModel.Insert(ctx, nil, query)
if insertQueryErr != nil {
return fmt.Errorf("生成订单, 保存查询失败: %+v", insertQueryErr)
return fmt.Errorf("保存查询失败: %+v", insertQueryErr)
}
// 获取插入后的ID