1
0

feat: 合并Gin_Vue

This commit is contained in:
TsMask
2023-10-16 20:04:08 +08:00
parent 55fe1d534d
commit 05c7e9b9e8
213 changed files with 20338 additions and 311 deletions

View File

@@ -1,12 +1,10 @@
package config
import (
"flag"
"fmt"
"os"
"strings"
"ems.agt/lib/core/conf"
"ems.agt/lib/global"
"ems.agt/lib/log"
@@ -288,7 +286,7 @@ func GetLogLevel() log.LogLevel {
var (
DefaultUriPrefix string = "/api/rest"
UriPrefix string = "/api/rest"
UriPrefix string = "/omc/rest"
//TestDataUDM []map[string]interface{}
TDatas map[string]NeTestData
)
@@ -312,33 +310,33 @@ func GetDefaultUserAgent() string {
return "OMC-restagent/" + global.Version
}
const defaultConfigFile = "./etc/restconf.yaml"
// const defaultConfigFile = "./etc/restconf.yaml"
func init() {
cfile := flag.String("c", defaultConfigFile, "config file")
pv := flag.Bool("version", false, "print version")
ph := flag.Bool("help", false, "print help")
// func init() {
// cfile := flag.String("c", defaultConfigFile, "config file")
// pv := flag.Bool("version", false, "print version")
// ph := flag.Bool("help", false, "print help")
global.BuildTime = "Wed May 31 18:24:04 CST 2023"
global.GoVer = "go version go1.15.7 linux/arm64"
flag.Parse()
if *pv {
fmt.Printf("OMC restagent version: %s\n%s\n%s\n\n", global.Version, global.BuildTime, global.GoVer)
os.Exit(0)
}
if *ph {
flag.Usage()
os.Exit(0)
}
// //global.BuildTime = "Wed May 31 18:24:04 CST 2023"
// //global.GoVer = "go version go1.15.7 linux/arm64"
// flag.Parse()
// if *pv {
// fmt.Printf("OMC restagent version: %s\n%s\n%s\n\n", global.Version, global.BuildTime, global.GoVer)
// os.Exit(0)
// }
// if *ph {
// flag.Usage()
// os.Exit(0)
// }
// 使用viper读取配置
conf.InitConfig(*cfile)
// // 使用viper读取配置
// conf.InitConfig(*cfile)
ReadConfig(*cfile)
if GetYamlConfig().OMC.UriPrefix != "" {
UriPrefix = GetYamlConfig().OMC.UriPrefix
}
if GetYamlConfig().TestConfig.Enabled {
ReadTestConfigYaml(GetYamlConfig().TestConfig.File)
}
}
// ReadConfig(*cfile)
// if GetYamlConfig().OMC.UriPrefix != "" {
// UriPrefix = GetYamlConfig().OMC.UriPrefix
// }
// if GetYamlConfig().TestConfig.Enabled {
// ReadTestConfigYaml(GetYamlConfig().TestConfig.File)
// }
// }