finish setup data insertion, add world insertion

This commit is contained in:
lbenedar
2026-04-22 18:18:43 +03:00
parent 21abe68858
commit f46ff8333e
66 changed files with 2257 additions and 676 deletions

View File

@@ -19,23 +19,25 @@ type JournalPage struct {
// Category any `json:"category"`
}
func (j *JournalPage) ToDB(dest *db.JournalPage) bool {
func (j *JournalPage) ToDB(dest **db.JournalPage) bool {
if dest == nil {
return false
}
dest.Name = j.Name
dest.Type = j.Type
dest.ID = j.ID
dest.Src = j.Src
dest.Sort = j.Sort
journalPage := &db.JournalPage{
Name: j.Name,
Type: j.Type,
ID: j.ID,
Src: j.Src,
Sort: j.Sort,
}
j.Text.ToDB(&dest.Text)
j.Title.ToDB(&dest.Title)
j.Video.ToDB(&dest.Video)
j.Stats.ToDB(&dest.Stats)
j.Text.ToDB(&journalPage.Text)
j.Title.ToDB(&journalPage.Title)
j.Video.ToDB(&journalPage.Video)
j.Stats.ToDB(&journalPage.Stats)
OwnershipToDB(&dest.Ownership, j.Ownership)
OwnershipToDB(&journalPage.Ownership, j.Ownership)
return true
}