autoUpdateConfigDomain.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package domain
  2. type AutoUpdateConfigOption struct {
  3. Id string `bson:"_id" json:"id"` // "options"
  4. Packages AutoUpdatePackagesOption `bson:"packages" json:"packages"` // 升级包总表 key = fileName
  5. AGateVersions []string `bson:"aGateVersions" json:"aGateVersions"` // aGate 版本表
  6. }
  7. type AutoUpdatePackagesOption struct {
  8. System []string `bson:"system" json:"system"` // 系统包
  9. AGate []string `bson:"aGate" json:"aGate"` // aGate包
  10. SubDevice []string `bson:"subDevice" json:"subDevice"` // 子设备包
  11. Others []string `bson:"others" json:"others"` // 其他包
  12. }
  13. type AutoUpdatePackages struct {
  14. Id string `bson:"_id" json:"id"` // "软件包名"
  15. Title string `bson:"title" json:"title"` // 升级包标题
  16. InvVersion []string `bson:"invVersion" json:"invVersion"` // INV 版本
  17. }
  18. type AutoUpdateAPowerVersion struct {
  19. Id string `bson:"_id" json:"id"` // aPower硬件版本号
  20. Name string `bson:"name" json:"name"` // aPower名称
  21. Remark string `bson:"remark" json:"remark"` // 备注
  22. }
  23. type AutoUpdateConfig struct {
  24. Id string `bson:"_id" json:"id"` // "aGate硬件类型"
  25. Config AutoUpdateAGateConfig `bson:"config" json:"config"`
  26. }
  27. type AutoUpdateAGateConfig struct {
  28. DefaultType AutoUpdateDefaultTypeConfig `bson:"defaultType" json:"defaultType"` // 默认升级类配置
  29. SpecialType []AutoUpdateSpecialTypeConfig `bson:"specialType" json:"specialType"` // 特殊类型升级配置 (备件换件升级、New Home(休眠)等)
  30. }
  31. type VersionType interface {
  32. uint | string
  33. }
  34. type AutoUpdateSoftwareVersionInfo[T VersionType] struct {
  35. Version T `bson:"version" json:"version"`
  36. Remark string `bson:"remark" json:"remark"`
  37. }
  38. type AutoUpdateDefaultTypeConfig struct {
  39. EmsVersions []AutoUpdateSoftwareVersionInfo[string] `bson:"emsVersions" json:"emsVersions"` // 符合条件的 EMS 软件版本表
  40. APowerVersions []string `bson:"aPowerVersions" json:"aPowerVersions"` // 符合条件的 aPower 硬件版本表
  41. UpdateOrder []string `bson:"updateOrder" json:"updateOrder"` // 升级步骤
  42. }
  43. type AutoUpdateSpecialTypeConfig struct {
  44. Id string `bson:"id" json:"id"` // 数据唯一ID
  45. Title string `bson:"title" json:"title"` // 特殊配置标题(说明)
  46. EmsVersions []AutoUpdateSoftwareVersionInfo[string] `bson:"emsVersions" json:"emsVersions"` // 符合条件的 EMS 软件版本表
  47. APowerVersions []string `bson:"aPowerVersions" json:"aPowerVersions"` // 符合条件的 aPower 硬件版本表
  48. SpecialUpdateOrder []string `bson:"specialUpdateOrder" json:"specialUpdateOrder"` // 特殊升级步骤 (如果使能 UseDefaultUpdate 则为前置升级步骤, 否则覆盖 updateOrder)
  49. UseDefaultUpdate bool `bson:"useDefaultUpdate" json:"useDefaultUpdate"` // 追加标准升级步骤
  50. }