This commit is contained in:
2025-04-08 12:49:19 +08:00
parent 39af208ea3
commit 14b5d10992
20 changed files with 1437 additions and 67 deletions

View File

@@ -3,11 +3,13 @@ package agent
import (
"context"
"database/sql"
"github.com/pkg/errors"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"time"
"tydata-server/app/user/model"
"tydata-server/common/xerr"
"tydata-server/pkg/lzkit/crypto"
"github.com/pkg/errors"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"tydata-server/app/user/cmd/api/internal/svc"
"tydata-server/app/user/cmd/api/internal/types"
@@ -34,7 +36,12 @@ func (l *ActivateAgentMembershipLogic) ActivateAgentMembership(req *types.AgentA
//if err != nil {
// return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "获取用户ID失败: %v", err)
//}
userModel, err := l.svcCtx.UserModel.FindOneByMobile(l.ctx, req.Mobile)
secretKey := l.svcCtx.Config.Encrypt.SecretKey
encryptedMobile, err := crypto.EncryptMobile(req.Mobile, secretKey)
if err != nil {
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "加密手机号失败: %v", err)
}
userModel, err := l.svcCtx.UserModel.FindOneByMobile(l.ctx, encryptedMobile)
if err != nil {
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "查询代理信息失败: %v", err)
}