feat(model): 新增基础数据模型与路由配置
- 新增 BaseModel 结构体,包含统一主键和时间字段 - 定义 JanusProvider、JanusModel、Channel、APIKey 四个业务模型结构 - 引入 Status 枚举表示启用/禁用状态 - 完成对应数据库建表 SQL 迁移脚本 - 新增 router 包及 API 健康检查路由注册实现 - 优化 main.go,使用 router 包统一路由注册管理 - 补充模型中字段的 GORM 和 JSON 标签规范
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package core
|
||||
|
||||
import "time"
|
||||
|
||||
type BaseModel struct {
|
||||
// ID 数据的ID,雪花ID
|
||||
ID int64 `gorm:"primaryKey;" json:"id"`
|
||||
// CreatedAt 创建者ID
|
||||
CreatedAt int64 `gorm:"not null" json:"created_at"`
|
||||
// CreatedTime 创建时间
|
||||
CreatedTime time.Time `gorm:"autoCreateTime;not null" json:"created_time"`
|
||||
// UpdatedAt 修改者ID
|
||||
UpdatedAt int64 `gorm:"not null" json:"updated_at"`
|
||||
// UpdatedTime 修改时间
|
||||
UpdatedTime time.Time `gorm:"autoUpdateTime;not null" json:"updated_time"`
|
||||
// DelFlag 删除标志(1=已删除,0=未删除)
|
||||
DelFlag int8 `gorm:"default:0;not null" json:"del_flag"`
|
||||
}
|
||||
Reference in New Issue
Block a user