first commit

This commit is contained in:
2026-09-11 01:47:20 +08:00
commit 303207d3cc
74 changed files with 8348 additions and 0 deletions
+156
View File
@@ -0,0 +1,156 @@
package service
// 本文件集中定义管理后台各业务域的状态/类型枚举常量,消除魔法数字。
// 取值与业务服务(zt-closet-backend)internal/service/constants.go 及各表字段注释保持一致。
// ===== 管理员 AdminUser =====
const (
AdminRoleSuper int8 = 1 // 超级管理员
AdminRoleNormal int8 = 2 // 普通管理员
AdminStatusEnabled int8 = 1 // 启用
AdminStatusDisabled int8 = 2 // 禁用
)
// ===== 用户 User =====
const (
UserStatusNormal int8 = 1 // 正常
UserStatusTempBan int8 = 2 // 临时禁用
UserStatusPermBan int8 = 3 // 永久禁用
UserStatusDeactivated int8 = 4 // 已注销
VIPTypeNone int8 = 1 // 非会员
VIPTypeMonthly int8 = 2 // 月度会员
VIPTypeYearly int8 = 3 // 年度会员
VIPTypeTrial int8 = 4 // 体验会员
)
// ===== 配额 Quota =====
const (
QuotaTypeCos int8 = 1 // COS 上传
QuotaTypeAI int8 = 2 // AI 推荐
QuotaTypeOutfitShare int8 = 3 // 社区分享
QuotaTypeClosetShare int8 = 4 // 衣柜分享
// 额度凭证来源(quota_grants.source)
QuotaGrantSourceMember int8 = 1 // 会员包(跟随 VIP 有效期)
QuotaGrantSourceAddon int8 = 2 // 加量包(独立有效期)
QuotaGrantSourceAdReward int8 = 3 // 广告激励(当天有效)
QuotaChangeTargetAdjust int8 = 1 // 配额调整
QuotaChangeTargetUse int8 = 2 // 使用
QuotaChangeTypeManual int8 = 5 // 人工调整
)
// 免费额度内置兜底值(与业务服务 DefaultQuota* 对齐;仅当 Quota 配置段未配置时使用)。
const (
DefaultQuotaCos int64 = 20 // 免费上传额度(永久)
DefaultQuotaAI int64 = 3 // 免费 AI 推荐额度(每日)
DefaultQuotaOutfitShare int64 = 10 // 免费社区分享额度(每日)
DefaultQuotaClosetShare int64 = 5 // 免费衣柜分享额度(每日)
)
// ===== VIP 流水 =====
const (
VIPChangeTypeManual int8 = 5 // 人工调整
VIPSourceManual int8 = 4 // 人工调整
)
// ===== 商品 Goods =====
const (
GoodsTypeMember int8 = 1 // 会员包
GoodsTypeUpload int8 = 2 // 上传包
GoodsTypeAIRecommend int8 = 3 // AI 推荐包
GoodsTypeClosetShare int8 = 4 // 衣柜分享包
GoodsTypeOutfitShare int8 = 5 // 搭配分享包
GoodsStatusOnShelf int8 = 1 // 上架
GoodsStatusOffShelf int8 = 2 // 下架
// 虚拟支付道具发布状态
GoodsProductUnpublished int8 = 0 // 未发布
GoodsProductPublishing int8 = 1 // 发布中(上传/发布任务处理中)
GoodsProductPublished int8 = 2 // 已发布
GoodsProductPublishFail int8 = 3 // 发布失败
)
// ===== 订单 Order =====
const (
OrderStatusPending int8 = 1 // 待支付
OrderStatusPaid int8 = 2 // 已支付
OrderStatusCancelled int8 = 3 // 已取消
OrderStatusExpired int8 = 4 // 已过期
OrderStatusRefunded int8 = 5 // 已退款
PayChannelWechat int8 = 1 // 微信支付(普通 JSAPI)
PayChannelVirtual int8 = 2 // 微信虚拟支付(XPay)
// 虚拟支付平台(由前端按 systemInfo.platform 上报)
XPayPlatformAndroid = "android"
XPayPlatformIOS = "ios"
XPayPlatformHarmony = "harmony"
XPayPlatformWindows = "windows"
)
// ===== 退款 Refund =====
const (
RefundStatusPending int8 = 0 // 待处理
RefundStatusProcessing int8 = 1 // 退款中
RefundStatusSuccess int8 = 2 // 退款成功
RefundStatusFailed int8 = 3 // 退款失败
)
// ===== 穿搭 Outfit =====
const (
OutfitSourceUser int8 = 1 // 用户创建
OutfitSourceAI int8 = 2 // AI 推荐
OutfitPrivate int8 = 1 // 不公开
OutfitPublic int8 = 2 // 公开
OutfitAuditPending int8 = 1 // 待审核
OutfitAuditPass int8 = 2 // 审核通过
OutfitAuditReject int8 = 3 // 审核不通过
OutfitStatusNormal int8 = 1 // 正常
OutfitStatusBanned int8 = 2 // 封禁
OutfitStatusUnsaved int8 = 3 // 待用户保存
)
// ===== 衣柜分享 ClosetShare =====
const (
ShareTypePartial int8 = 1 // 部分衣物分享
ShareTypeSnapshot int8 = 2 // 全量快照分享
ShareStatusNormal int8 = 1 // 正常
ShareStatusCancelled int8 = 2 // 用户取消
ShareStatusExpired int8 = 3 // 已过期
ShareStatusBanned int8 = 4 // 管理员封禁
)
// ===== 衣物 Clothes 图片处理状态 =====
const (
ImageProcessMatting int8 = 1 // 抠图中
ImageProcessClassifying int8 = 2 // 分类中
ImageProcessQueuing int8 = 3 // 排队中
ImageProcessSuccess int8 = 4 // 成功
ImageProcessFailed int8 = 5 // 失败
)
// ===== 通知 Notification =====
const (
NotificationTypeSystem int8 = 3 // 系统通知
NotificationUnread int8 = 1 // 未读
NotificationRead int8 = 2 // 已读
NotificationSenderSystem int64 = 0 // 系统发送者 ID
)
// ===== 审核日志 AuditLog =====
const (
AuditResultPass int8 = 1 // 通过
AuditResultReject int8 = 2 // 驳回
)