Remove the card password related

New application-related
This commit is contained in:
2025-10-24 01:48:54 +08:00
parent 11bff937bd
commit f03d2d0b12
22 changed files with 657 additions and 3623 deletions

View File

@@ -38,6 +38,18 @@ type App struct {
DownloadType int `gorm:"default:0;not null;comment:更新方式0=不启用更新1=自动更新2=手动下载" json:"download_type"`
// DownloadURL下载地址
DownloadURL string `gorm:"size:500;comment:下载地址" json:"download_url"`
// Announcement程序公告内容base64编码存储
Announcement string `gorm:"type:text;comment:程序公告内容base64编码存储" json:"announcement"`
// LoginType登陆方式0=顶号登录默认1=非顶号登录)
LoginType int `gorm:"default:0;not null;comment:登陆方式0=顶号登录1=非顶号登录" json:"login_type"`
// MultiOpenScope多开范围0=单电脑1=单IP2=全部电脑(默认))
MultiOpenScope int `gorm:"default:2;not null;comment:多开范围0=单电脑1=单IP2=全部电脑" json:"multi_open_scope"`
// CleanInterval清理间隔单位小时默认1小时
CleanInterval int `gorm:"default:1;not null;comment:清理间隔,单位小时" json:"clean_interval"`
// CheckInterval校验间隔单位分钟默认10分钟
CheckInterval int `gorm:"default:10;not null;comment:校验间隔,单位分钟" json:"check_interval"`
// MultiOpenCount多开数量默认1
MultiOpenCount int `gorm:"default:1;not null;comment:多开数量" json:"multi_open_count"`
// CreatedAt/UpdatedAt时间字段返回为 created_at/updated_at便于前端展示
CreatedAt time.Time `gorm:"comment:创建时间" json:"created_at"`
UpdatedAt time.Time `gorm:"comment:更新时间" json:"updated_at"`

View File

@@ -1,27 +0,0 @@
package models
import (
"time"
)
// Card 卡密模型
// 用于存储和管理系统中的卡密信息,包括卡密号码、状态、使用情况等
type Card struct {
// ID主键自增
ID uint `gorm:"primaryKey;comment:卡密ID自增主键" json:"id"`
// CardNumber卡密号码唯一且非空
CardNumber string `gorm:"size:200;not null;comment:卡密号码(十六进制字符串)" json:"card_number"`
// CardTypeID所属卡密类型ID外键
CardTypeID uint `gorm:"not null;index;comment:所属卡密类型ID外键" json:"card_type_id"`
// Status状态0=未使用1=已使用2=禁用)
Status int `gorm:"default:0;not null;comment:状态0=未使用1=已使用2=禁用" json:"status"`
// Batch批次标识用于区分导入或生成批次
Batch string `gorm:"size:100;comment:批次标识" json:"batch"`
// Remark备注信息
Remark string `gorm:"size:255;comment:备注信息" json:"remark"`
// UsedAt使用时间未使用为NULL调整到创建时间前面以便前端展示顺序一致
UsedAt *time.Time `gorm:"comment:使用时间" json:"used_at"`
// CreatedAt/UpdatedAt时间字段
CreatedAt time.Time `gorm:"comment:创建时间" json:"created_at"`
UpdatedAt time.Time `gorm:"comment:更新时间" json:"updated_at"`
}

View File

@@ -1,24 +0,0 @@
package models
import "time"
// CardType 卡密类型表模型
// 用于管理不同类型的卡密ChatGPT、Claude、Suno、Grok等
// ID 为自增主键
// Name 为卡密类型名称,唯一索引
// Status 为状态1:启用 0:禁用默认为1
// CreatedAt/UpdatedAt 由 GORM 自动维护
type CardType struct {
// ID主键自增同时通过 json 标签保证前端接收为 id
ID uint `gorm:"primaryKey;comment:卡密类型ID自增主键" json:"id"`
// Name名称唯一json 名称与前端一致
Name string `gorm:"uniqueIndex;size:100;not null;comment:卡密类型名称,唯一索引" json:"name"`
// Status状态1=启用0=禁用json 名称与前端一致
Status int `gorm:"default:1;not null;comment:状态1=启用0=禁用" json:"status"`
// LoginTypes登录方式逗号分隔json 使用 login_types
LoginTypes string `gorm:"type:varchar(500);default:'';comment:登录方式,多个用逗号分隔" json:"login_types"`
// CreatedAt/UpdatedAt时间字段返回为 created_at/updated_at便于前端展示
CreatedAt time.Time `gorm:"comment:创建时间" json:"created_at"`
UpdatedAt time.Time `gorm:"comment:更新时间" json:"updated_at"`
}

View File

@@ -1,24 +0,0 @@
package models
import "time"
// LoginType 登录类型表模型
// 用于管理不同的登录方式如直登、Google、Microsoft、Apple等
// ID 为自增主键
// Name 为登录类型名称,唯一索引
// Status 为状态1:启用 0:禁用默认为1
// CreatedAt/UpdatedAt 由 GORM 自动维护
type LoginType struct {
// ID主键自增同时通过 json 标签保证前端接收为 id
ID uint `gorm:"primaryKey;comment:登录类型ID自增主键" json:"id"`
// Name名称唯一json 名称与前端一致
Name string `gorm:"uniqueIndex;size:100;not null;comment:登录类型名称,唯一索引" json:"name"`
// Status状态1=启用0=禁用json 名称与前端一致
Status int `gorm:"default:1;not null;comment:状态1=启用0=禁用" json:"status"`
// VerifyTypes验证方式逗号分隔json 使用 verify_types用于记录多种验证方式输入内容用多个用逗号分隔
VerifyTypes string `gorm:"type:varchar(500);default:'';comment:验证方式,输入内容用多个用逗号分隔" json:"verify_types"`
// CreatedAt/UpdatedAt时间字段返回为 created_at/updated_at便于前端展示
CreatedAt time.Time `gorm:"comment:创建时间" json:"created_at"`
UpdatedAt time.Time `gorm:"comment:更新时间" json:"updated_at"`
}