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

@@ -10,15 +10,20 @@ type Setting struct {
Stats Stats `json:"_stats"`
}
func (s *Setting) ToDB(dest *db.Setting) bool {
func (s *Setting) ToDB(dest **db.Setting) bool {
if dest == nil {
return false
}
dest.Key = s.Key
dest.Value = s.Value
dest.ID = s.ID
s.Stats.ToDB(&dest.Stats)
setting := &db.Setting{
Key: s.Key,
Value: s.Value,
ID: s.ID,
}
s.Stats.ToDB(&setting.Stats)
*dest = setting
return true
}