- BaseModel 移除 gorm column:uid 和 json:uid 标签,统一为 id - 更新 8 个 repository 文件中 28 处 raw SQL 列引用 (uid→id) - 更新 3 个前端 JS 文件中 14 处 API 响应字段引用 (uid→id) - 添加数据库迁移 SQL 脚本 (docs/migrations/001_uid_to_id.sql)
16 lines
317 B
Go
16 lines
317 B
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// BaseModel 所有模型的公共字段
|
|
type BaseModel struct {
|
|
ID uint `gorm:"primarykey" json:"id"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
|
}
|