feat(layout): 更新应用布局和UI组件样式
- 重构App.vue中的侧边栏布局,更新Logo设计为带有标识和副标题的新样式 - 调整顶部导航栏,增加标题区域显示当前路由标题和日期 - 修改菜单项配置,更新导航标签为更直观的中文描述 - 在Home.vue中替换原有的仪表板为新的Hero卡片和项目进展展示 - 更新Memory.vue中的学习界面,添加学习计划设置和多阶段学习模式 - 集成新的API端点路径,将baseURL从/api调整为/api/v1 - 调整整体视觉风格,包括颜色主题、字体家族和响应式布局 - 更新数据库模型以支持词库功能,添加相关的数据迁移和种子数据 - 调整认证系统的用户ID类型从整型到字符串的变更 - 更改前端构建工具从npm到pnpm,并更新相应的Dockerfile配置
This commit is contained in:
32
memora-api/internal/model/word_book.go
Normal file
32
memora-api/internal/model/word_book.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const (
|
||||
DefaultWordBookID = "00000000000000000000000000000001"
|
||||
DefaultWordBookCode = "default"
|
||||
)
|
||||
|
||||
type WordBook struct {
|
||||
ID string `json:"id" gorm:"primaryKey;size:32"`
|
||||
Code string `json:"code" gorm:"size:64;uniqueIndex;not null"`
|
||||
Name string `json:"name" gorm:"size:120;not null"`
|
||||
SourceBookID string `json:"source_book_id" gorm:"size:64;uniqueIndex"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
func (WordBook) TableName() string {
|
||||
return "word_books"
|
||||
}
|
||||
|
||||
func (b *WordBook) BeforeCreate(tx *gorm.DB) error {
|
||||
if b.ID == "" {
|
||||
b.ID = NewID()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user