autoUpdateConfigRoutes.go 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Auto Update Config API List
  3. * /autoUpdateConfig/option - GET 获取配置选项
  4. * /autoUpdateConfig/packageInfo - GET 获取包信息 - 通过升级包名
  5. * /autoUpdateConfig/packageInfo/create/:type - POST 创建自动升级包信息
  6. * /autoUpdateConfig/packageInfo/update/:id - POST 更新自动升级包信息
  7. * /autoUpdateConfig/packageInfo/delete/:type/:id - DELETE 删除自动升级包信息
  8. * /autoUpdateConfig/aPowerVersion - GET 获取aPower版本信息 - 通过硬件版本号
  9. * /autoUpdateConfig/aPowerVersion/:version - POST 新增&更新aPower版本信息 - 通过硬件版本号
  10. * /autoUpdateConfig/aPowerVersion/:version - DELETE 删除aPower版本信息 - 通过硬件版本号
  11. * /autoUpdateConfig/config - GET 获取配置 - 通过aGate硬件版本
  12. * /autoUpdateConfig/config/:aGate - POST 新增&更新配置 - 通过aGate硬件版本
  13. * /autoUpdateConfig/config/:aGate - DELETE 删除配置 - 通过aGate硬件版本
  14. * /autoUpdateConfig/config/special/:aGate - POST 新增特殊配置 - 通过aGate硬件版本
  15. * /autoUpdateConfig/config/special/:aGate/:id - DELETE 删除特殊配置 - 通过aGate硬件版本
  16. * /autoUpdateConfig/configFile - GET 获取配置文件列表
  17. * /autoUpdateConfig/configFile/create - POST 创建配置文件
  18. * /autoUpdateConfig/configFile/download/:fileName - GET 下载配置文件列表
  19. */
  20. package routes
  21. import (
  22. "fwh-toolbox-server/controllers"
  23. "github.com/gofiber/fiber/v2"
  24. )
  25. func AutoUpdateConfigSetup(api fiber.Router) {
  26. // 获取自动升级配置选项
  27. api.Get("/autoUpdateConfig/option", controllers.GetAutoUpdateConfigOption)
  28. // 获取自动升级包信息 - 通过升级包名
  29. api.Get("/autoUpdateConfig/packageInfo", controllers.GetAutoUpdatePackageInfo)
  30. // 创建自动升级包信息
  31. api.Post("/autoUpdateConfig/packageInfo/create/:type", controllers.CreateAutoUpdatePackageInfo)
  32. // 更新自动升级包信息
  33. api.Post("/autoUpdateConfig/packageInfo/update/:id", controllers.UpdateAutoUpdatePackageInfo)
  34. // 删除自动升级包信息
  35. api.Delete("/autoUpdateConfig/packageInfo/delete/:type/:id", controllers.DeleteAutoUpdatePackageInfo)
  36. // 获取aPower版本信息 - 通过硬件版本号
  37. api.Get("/autoUpdateConfig/aPowerVersion", controllers.GetAutoUpdateAPowerVersion)
  38. // 新增&更新aPower版本信息 - 通过硬件版本号
  39. api.Post("/autoUpdateConfig/aPowerVersion/:version", controllers.UpdateAutoUpdateAPowerVersion)
  40. // 删除aPower版本信息 - 通过硬件版本号
  41. api.Delete("/autoUpdateConfig/aPowerVersion/:version", controllers.DeleteAutoUpdateAPowerVersion)
  42. // 获取自动升级配置 - 通过aGate硬件版本
  43. api.Get("/autoUpdateConfig/config", controllers.GetAutoUpdateConfig)
  44. // 新增&更新配置 - 通过aGate硬件版本
  45. api.Post("/autoUpdateConfig/config/:aGate", controllers.UpdateAutoUpdateConfig)
  46. // 删除配置 - 通过aGate硬件版本
  47. api.Delete("/autoUpdateConfig/config/:aGate", controllers.DeleteAutoUpdateConfig)
  48. // 新增特殊配置 - 通过aGate硬件版本
  49. api.Post("/autoUpdateConfig/config/special/:aGate", controllers.CreateAutoUpdateSpecialConfig)
  50. // 删除特殊配置 - 通过aGate硬件版本
  51. api.Delete("/autoUpdateConfig/config/special/:aGate/:id", controllers.DeleteAutoUpdateSpecialConfig)
  52. // 获取配置文件列表
  53. api.Get("/autoUpdateConfig/configFile", controllers.GetAutoUpdateConfigFileInfo)
  54. // 创建配置文件
  55. api.Post("/autoUpdateConfig/configFile/create", controllers.CreateAutoUpdateConfigFile)
  56. // 下载配置文件列表
  57. api.Get("/autoUpdateConfig/configFile/download/:fileName", controllers.DownloadAutoUpdateConfigFile)
  58. }