🎨 Update initial code block definition
This commit is contained in:
2
frontend/package-lock.json
generated
2
frontend/package-lock.json
generated
@@ -74,7 +74,7 @@
|
||||
"@lezer/generator": "^1.8.0",
|
||||
"@types/node": "^24.9.2",
|
||||
"@vitejs/plugin-vue": "^6.0.1",
|
||||
"@wailsio/runtime": "*",
|
||||
"@wailsio/runtime": "latest",
|
||||
"cross-env": "^10.1.0",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-plugin-vue": "^10.5.1",
|
||||
|
||||
@@ -30,5 +30,5 @@ func NewDocument(title, content string) *Document {
|
||||
|
||||
// NewDefaultDocument 创建默认文档
|
||||
func NewDefaultDocument() *Document {
|
||||
return NewDocument("default", "∞∞∞text-a\n")
|
||||
return NewDocument("default", "\n∞∞∞text-a\n")
|
||||
}
|
||||
|
||||
@@ -175,18 +175,7 @@ func (ds *DocumentService) CreateDocument(title string) (*models.Document, error
|
||||
if ds.databaseService == nil || ds.databaseService.db == nil {
|
||||
return nil, errors.New("database service not available")
|
||||
}
|
||||
|
||||
// Create document with default content
|
||||
now := time.Now().Format("2006-01-02 15:04:05")
|
||||
doc := &models.Document{
|
||||
Title: title,
|
||||
Content: "∞∞∞text-a\n",
|
||||
CreatedAt: now,
|
||||
UpdatedAt: now,
|
||||
IsDeleted: false,
|
||||
IsLocked: false,
|
||||
}
|
||||
|
||||
doc := models.NewDocument(title, "\n∞∞∞text-a\n")
|
||||
// 执行插入操作
|
||||
result, err := ds.databaseService.db.Exec(sqlInsertDocument,
|
||||
doc.Title, doc.Content, doc.CreatedAt, doc.UpdatedAt)
|
||||
|
||||
Reference in New Issue
Block a user