🐛 Fixed some issues
This commit is contained in:
@@ -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{
|
||||
|
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user