feat: 植物识别百科ai助手迁移

This commit is contained in:
Blizzard
2026-05-24 01:41:22 +08:00
parent ae6d03d351
commit 076ed1509b
29 changed files with 1121 additions and 372 deletions
+4 -1
View File
@@ -18,7 +18,10 @@ type BaseModel struct {
// BeforeCreate 创建前自动生成雪花ID
func (m *BaseModel) BeforeCreate(db *gorm.DB) (err error) {
db.Statement.SetColumn("id", uniqueid.GenerateID())
if m.ID == "" {
m.ID = uniqueid.GenerateID()
}
db.Statement.SetColumn("id", m.ID)
return
}