finish world initialization, set up init on startup and on shutdown, move all models to main directory
This commit is contained in:
29
internal/foundry/models/json/index.go
Normal file
29
internal/foundry/models/json/index.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package json
|
||||
|
||||
import "gitea.local.lab/Lbenedar/foundry_helper_service/internal/foundry/models/db"
|
||||
|
||||
type Index struct {
|
||||
Id string `json:"_id"`
|
||||
Folder string `json:"folder"`
|
||||
Img string `json:"img"`
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
func (i *Index) ToDB(dest **db.Index) bool {
|
||||
if dest == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
index := &db.Index{
|
||||
ID: i.Id,
|
||||
Folder: i.Folder,
|
||||
Img: i.Img,
|
||||
Name: i.Name,
|
||||
Type: i.Type,
|
||||
}
|
||||
|
||||
*dest = index
|
||||
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user