feat: 实现分类管理功能,包括数据模型、仓库层、服务层和数据库初始化脚本

This commit is contained in:
2026-01-28 09:55:29 +08:00
parent 1b6feae015
commit 4d024eba8e
6 changed files with 447 additions and 30 deletions

View File

@@ -304,6 +304,7 @@ type Category struct {
UserID uint `gorm:"not null;index" json:"user_id"`
Name string `gorm:"size:50;not null" json:"name"`
Icon string `gorm:"size:50" json:"icon"`
Color string `gorm:"size:20" json:"color"` // HEX color code (e.g., #FF6B35)
Type CategoryType `gorm:"size:20;not null" json:"type"` // income or expense
ParentID *uint `gorm:"index" json:"parent_id,omitempty"`
SortOrder int `gorm:"default:0" json:"sort_order"`