finish setup data insertion, add world insertion
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user