add new models, change migration files, prepare to add all new tables from models
This commit is contained in:
24
internal/foundry/temp_models/json/settings.go
Normal file
24
internal/foundry/temp_models/json/settings.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package json
|
||||
|
||||
import "gitea.local.lab/Lbenedar/foundry_helper_service/internal/foundry/temp_models/db"
|
||||
|
||||
type Setting struct {
|
||||
Key string `json:"key"`
|
||||
User any `json:"user"`
|
||||
Value string `json:"value"`
|
||||
ID string `json:"_id"`
|
||||
Stats Stats `json:"_stats"`
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user