🐛 Fixed some issues

This commit is contained in:
landaiqing committed 2025-07-02 12:10:46 +08:00
1 parent 25e1a98932
commit 81eb2c94ac
14 files changed
+210 -149

No files matched your search

+1 -1
View File
@@ -106,7 +106,7 @@ type ConfigMetadata struct {
// NewDefaultAppConfig 创建默认应用配置
func NewDefaultAppConfig() *AppConfig {
currentDir, _ := os.UserConfigDir()
currentDir, _ := os.UserHomeDir()
dataDir := filepath.Join(currentDir, ".voidraft", "data")
return &AppConfig{
+3 -1
View File
@@ -4,13 +4,14 @@ import (
"time"
)
// Document 表示一个文档(使用自增主键)
// Document represents a document in the system
type Document struct {
ID int64 `json:"id" db:"id"`
Title string `json:"title" db:"title"`
Content string `json:"content" db:"content"`
CreatedAt time.Time `json:"createdAt" db:"created_at"`
UpdatedAt time.Time `json:"updatedAt" db:"updated_at"`
IsDeleted bool `json:"is_deleted"`
}
// NewDocument 创建新文档(不需要传ID,由数据库自增)
@@ -21,6 +22,7 @@ func NewDocument(title, content string) *Document {
Content: content,
CreatedAt: now,
UpdatedAt: now,
IsDeleted: false,
}
}