3 Commits

Author SHA1 Message Date
5d6f157ae1 🎨 Update initial code block definition
Some checks failed
Build and Release Voidraft / prepare (push) Failing after 2s
Build and Release Voidraft / build (push) Has been cancelled
Build and Release Voidraft / release (push) Has been cancelled
2025-11-16 17:49:19 +08:00
afda3d5301 Merge remote-tracking branch 'github/dependabot/npm_and_yarn/frontend/js-yaml-4.1.1' 2025-11-16 15:44:58 +08:00
dependabot[bot]
92a6c6bfdb ⬆️ Bump js-yaml from 4.1.0 to 4.1.1 in /frontend
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.0 to 4.1.1.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.1.0...4.1.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.1.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-15 18:38:56 +00:00
3 changed files with 5 additions and 16 deletions

View File

@@ -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": {

View File

@@ -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")
}

View File

@@ -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)