refactor: 标准化项目结构 frontend/ + backend/ + SQLite + run.sh

- 目录重构: app/ -> frontend/,与 backend/ 并列
- 数据库: 默认 SQLite(零配置),修复 DSN() bug
- run.sh: 一键启动前后端,支持 start/stop/restart/status
- Makefile: install/dev/build/lint/clean 快捷命令
- vite.config.ts: 配置 dev server 端口 5173 + API 代理到 8080
- config.yaml: SQLite 默认配置,开箱即用
- docs/: 完整开发文档(项目结构/API/数据库/规范/部署)
- 修复: GORM foreign key 关联声明
- 修复: go get gorm.io/driver/sqlite 依赖
This commit is contained in:
attacker committed 2026-06-13 23:34:23 +08:00
1 parent 7d6674bddd
commit 97c4207ff8
132 files changed
+1572 -34

No files matched your search

+4 -4
View File
@@ -44,9 +44,9 @@ type ApprovalProcess struct {
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
// 关联
Template *ApprovalTemplate `json:"template,omitempty"`
ApplicantUser *User `json:"applicant_user,omitempty"`
Steps []ApprovalStep `json:"steps,omitempty"`
Template *ApprovalTemplate `gorm:"foreignKey:TemplateID" json:"template,omitempty"`
ApplicantUser *User `gorm:"foreignKey:Applicant" json:"applicant_user,omitempty"`
Steps []ApprovalStep `gorm:"foreignKey:ProcessID" json:"steps,omitempty"`
}
// TableName 表名
@@ -67,7 +67,7 @@ type ApprovalStep struct {
UpdatedAt time.Time `json:"updated_at"`
// 关联
ApproverUser *User `json:"approver_user,omitempty"`
ApproverUser *User `gorm:"foreignKey:Approver" json:"approver_user,omitempty"`
}
// TableName 表名