add new models, change migration files, prepare to add all new tables from models
This commit is contained in:
45
internal/foundry/temp_models/json/update.go
Normal file
45
internal/foundry/temp_models/json/update.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package json
|
||||
|
||||
import "gitea.local.lab/Lbenedar/foundry_helper_service/internal/foundry/temp_models/db"
|
||||
|
||||
type CoreUpdate struct {
|
||||
HasUpdate bool `json:"hasUpdate"`
|
||||
CanUpdate bool `json:"canUpdate"`
|
||||
CouldReachWebsite bool `json:"couldReachWebsite"`
|
||||
SlowResponse bool `json:"slowResponse"`
|
||||
Version string `json:"version"`
|
||||
Channel string `json:"channel"`
|
||||
WillDisableModules bool `json:"willDisableModules"`
|
||||
}
|
||||
|
||||
func (c *CoreUpdate) ToDB(dest *db.CoreUpdate) bool {
|
||||
if dest == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
dest.HasUpdate = c.HasUpdate
|
||||
dest.CanUpdate = c.CanUpdate
|
||||
dest.CouldReachWebsite = c.CouldReachWebsite
|
||||
dest.SlowResponse = c.SlowResponse
|
||||
dest.Version = c.Version
|
||||
dest.Channel = c.Channel
|
||||
dest.WillDisableModules = c.WillDisableModules
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
type SystemUpdate struct {
|
||||
HasUpdate bool `json:"hasUpdate"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
func (s *SystemUpdate) ToDB(dest *db.SystemUpdate) bool {
|
||||
if dest == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
dest.HasUpdate = s.HasUpdate
|
||||
dest.Version = s.Version
|
||||
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user