finish setup data insertion, add world insertion
This commit is contained in:
@@ -17,24 +17,28 @@ type Macro struct {
|
||||
// Flags any `json:"flags,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Macro) ToDB(dest *db.Macro) bool {
|
||||
func (m *Macro) ToDB(dest **db.Macro) bool {
|
||||
if dest == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
dest.Command = m.Command
|
||||
dest.Name = m.Name
|
||||
dest.Type = m.Type
|
||||
dest.Img = m.Img
|
||||
dest.ID = m.ID
|
||||
dest.Author = m.Author
|
||||
dest.Scope = m.Scope
|
||||
dest.Folder = m.Folder
|
||||
dest.Sort = m.Sort
|
||||
macro := &db.Macro{
|
||||
Command: m.Command,
|
||||
Name: m.Name,
|
||||
Type: m.Type,
|
||||
Img: m.Img,
|
||||
ID: m.ID,
|
||||
Author: m.Author,
|
||||
Scope: m.Scope,
|
||||
Folder: m.Folder,
|
||||
Sort: m.Sort,
|
||||
}
|
||||
|
||||
m.Stats.ToDB(&dest.Stats)
|
||||
m.Stats.ToDB(¯o.Stats)
|
||||
|
||||
OwnershipToDB(&dest.Ownership, m.Ownership)
|
||||
OwnershipToDB(¯o.Ownership, m.Ownership)
|
||||
|
||||
*dest = macro
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user