chore: 打包程序restagent变更omc
This commit is contained in:
@@ -27,9 +27,9 @@ func InitConfig() {
|
||||
func initFlag() {
|
||||
// --env prod
|
||||
pflag.String("env", "prod", "Specify Run Environment Configuration local or prod")
|
||||
// --c /etc/restconf.yaml
|
||||
// -c /etc/restconf.yaml
|
||||
pConfig := pflag.StringP("config", "c", "./etc/restconf.yaml", "Specify Configuration File")
|
||||
// --c /etc/omc.yaml
|
||||
// -c /etc/omc.yaml
|
||||
pConfig := pflag.StringP("config", "c", "./etc/omc.yaml", "Specify Configuration File")
|
||||
// --version
|
||||
// -V
|
||||
pVersion := pflag.BoolP("version", "V", false, "Output program version")
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"nms_cxy/lib/dborm"
|
||||
"nms_cxy/lib/oauth"
|
||||
libConfig "nms_cxy/restagent/config"
|
||||
libConfig "nms_cxy/omc/config"
|
||||
"nms_cxy/src/framework/logger"
|
||||
"nms_cxy/src/framework/redis"
|
||||
)
|
||||
|
||||
@@ -5,14 +5,14 @@ import (
|
||||
|
||||
libConf "nms_cxy/lib/core/conf"
|
||||
libGlobal "nms_cxy/lib/global"
|
||||
libConfig "nms_cxy/restagent/config"
|
||||
libConfig "nms_cxy/omc/config"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
// BuildInfo 程序-V查看编译版本号信息
|
||||
func BuildInfo() string {
|
||||
return fmt.Sprintf("OMC restagent version: %s\n%s\n%s\n\n", libGlobal.Version, libGlobal.BuildTime, libGlobal.GoVer)
|
||||
return fmt.Sprintf("OMC version: %s\n%s\n%s\n\n", libGlobal.Version, libGlobal.BuildTime, libGlobal.GoVer)
|
||||
}
|
||||
|
||||
// ConfigRead 指定配置文件读取
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 外层 lib 和 features 粘合层
|
||||
|
||||
- config.go 配置合并: restagent.yaml 文件内容,主要是数据库配置
|
||||
- config.go 配置合并: omc.yaml 文件内容,主要是数据库配置
|
||||
- account.go 登录会话生成 token
|
||||
- session.go 中间件方式设置请求头 token 值
|
||||
|
||||
@@ -3,7 +3,7 @@ package session
|
||||
import (
|
||||
"time"
|
||||
|
||||
libConfig "nms_cxy/restagent/config"
|
||||
libConfig "nms_cxy/omc/config"
|
||||
"nms_cxy/src/framework/redis"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"nms_cxy/lib/dborm"
|
||||
"nms_cxy/lib/global"
|
||||
"nms_cxy/lib/log"
|
||||
"nms_cxy/restagent/config"
|
||||
"nms_cxy/omc/config"
|
||||
"nms_cxy/src/framework/cron"
|
||||
)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"nms_cxy/lib/dborm"
|
||||
"nms_cxy/lib/global"
|
||||
"nms_cxy/lib/log"
|
||||
"nms_cxy/restagent/config"
|
||||
"nms_cxy/omc/config"
|
||||
"nms_cxy/src/framework/cron"
|
||||
|
||||
"github.com/go-resty/resty/v2"
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
"nms_cxy/lib/dborm"
|
||||
"nms_cxy/lib/log"
|
||||
"nms_cxy/restagent/config"
|
||||
"nms_cxy/omc/config"
|
||||
"nms_cxy/src/framework/cron"
|
||||
|
||||
"github.com/go-resty/resty/v2"
|
||||
|
||||
@@ -241,7 +241,7 @@ func (s *SystemController) RebootApp(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
_, err := cmd.ExecWithCheck("nohup", "sh", "-c", "sleep 2s && service restagent restart", "&")
|
||||
_, err := cmd.ExecWithCheck("nohup", "sh", "-c", "sleep 2s && service omc restart", "&")
|
||||
if err != nil {
|
||||
c.JSON(200, map[string]any{
|
||||
"requestId": body.RequestId,
|
||||
|
||||
Reference in New Issue
Block a user