mirror of
https://github.com/skyle1995/NetworkAuth.git
synced 2026-05-25 02:24:05 +08:00
Remove the card password related
New application-related
This commit is contained in:
@@ -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=单IP,2=全部电脑(默认))
|
||||
MultiOpenScope int `gorm:"default:2;not null;comment:多开范围,0=单电脑,1=单IP,2=全部电脑" 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"`
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
@@ -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"`
|
||||
}
|
||||
@@ -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"`
|
||||
}
|
||||
Reference in New Issue
Block a user