feat: 完成端口修改功能

This commit is contained in:
ssongliu
2023-02-02 15:01:37 +08:00
committed by ssongliu
parent aa4cec47d9
commit 1946eb2313
20 changed files with 129 additions and 77 deletions

View File

@@ -10,13 +10,13 @@ import (
func GlobalLoading() gin.HandlerFunc {
return func(c *gin.Context) {
settingRepo := repo.NewISettingRepo()
upgradeSetting, err := settingRepo.Get(settingRepo.WithByKey("SystemVersion"))
status, err := settingRepo.Get(settingRepo.WithByKey("SystemStatus"))
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
if upgradeSetting.Value == constant.StatusWaiting {
helper.ErrorWithDetail(c, constant.CodeGlobalLoading, "Upgrading", err)
if status.Value != "Free" {
helper.ErrorWithDetail(c, constant.CodeGlobalLoading, status.Value, err)
return
}
c.Next()