add new models, change migration files, prepare to add all new tables from models

This commit is contained in:
lbenedar
2026-04-15 17:01:30 +03:00
parent 5bb592ea8a
commit 69d3d38ab7
95 changed files with 5371 additions and 12 deletions

View File

@@ -0,0 +1,59 @@
package json
import "gitea.local.lab/Lbenedar/foundry_helper_service/internal/foundry/temp_models/db"
type Language struct {
Lang string `json:"lang"`
Name string `json:"name"`
Path string `json:"path"`
// SystemLanguagesFlags SystemLanguagesFlags `json:"flags"`
}
func (l *Language) ToDB(dest *db.Language) bool {
if dest == nil {
return false
}
dest.Lang = l.Lang
dest.Name = l.Name
dest.Path = l.Path
return true
}
type SetupLanguage struct {
ID string `json:"id"`
Label string `json:"label"`
Modules []*SetupLanguageModule `json:"modules"`
}
func (s *SetupLanguage) ToDB(dest *db.SetupLanguage) bool {
if dest == nil {
return false
}
dest.ID = s.ID
dest.Label = s.Label
CopySliceToDB(&dest.Modules, s.Modules)
return true
}
type SetupLanguageModule struct {
ID string `json:"id"`
Label string `json:"label"`
Path string `json:"path"`
}
func (s *SetupLanguageModule) ToDB(dest *db.SetupLanguageModule) bool {
if dest == nil {
return false
}
dest.ID = s.ID
dest.Label = s.Label
dest.Path = s.Path
return true
}