Compare commits
3 Commits
5d4ba757aa
...
v1.5.4
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d6f157ae1 | |||
| afda3d5301 | |||
|
|
92a6c6bfdb |
6
frontend/package-lock.json
generated
6
frontend/package-lock.json
generated
@@ -6564,9 +6564,9 @@
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/js-yaml": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/js-yaml/-/js-yaml-4.1.0.tgz",
|
||||
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
|
||||
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
||||
@@ -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