This commit is contained in:
2025-12-09 18:55:28 +08:00
parent 8d00d67540
commit c23ab8338b
209 changed files with 5445 additions and 3963 deletions

View File

@@ -1,20 +1,21 @@
package admin_agent
import (
"context"
"database/sql"
"time"
"ycc-server/app/main/model"
"ycc-server/common/tool"
"ycc-server/common/xerr"
"context"
"database/sql"
"time"
"ycc-server/app/main/model"
"ycc-server/common/tool"
"ycc-server/common/xerr"
"github.com/pkg/errors"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/pkg/errors"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"ycc-server/app/main/api/internal/svc"
"ycc-server/app/main/api/internal/types"
"ycc-server/app/main/api/internal/svc"
"ycc-server/app/main/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/core/logx"
"github.com/google/uuid"
)
type AdminGenerateDiamondInviteCodeLogic struct {
@@ -70,14 +71,15 @@ func (l *AdminGenerateDiamondInviteCodeLogic) AdminGenerateDiamondInviteCode(req
}
// 创建邀请码记录(平台发放的钻石邀请码)
inviteCode := &model.AgentInviteCode{
Code: code,
AgentId: sql.NullInt64{Valid: false}, // NULL表示平台发放
TargetLevel: 3, // 钻石代理
Status: 0, // 未使用
ExpireTime: expireTime,
Remark: sql.NullString{String: req.Remark, Valid: req.Remark != ""},
}
inviteCode := &model.AgentInviteCode{
Id: uuid.NewString(),
Code: code,
AgentId: sql.NullString{Valid: false}, // NULL表示平台发放
TargetLevel: 3, // 钻石代理
Status: 0, // 未使用
ExpireTime: expireTime,
Remark: sql.NullString{String: req.Remark, Valid: req.Remark != ""},
}
_, err := l.svcCtx.AgentInviteCodeModel.Insert(transCtx, session, inviteCode)
if err != nil {