🐛 Fixed some issues

This commit is contained in:
2025-07-02 12:10:46 +08:00
parent 25e1a98932
commit 81eb2c94ac
14 changed files with 210 additions and 149 deletions

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{

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,
}
}