fix
zhangqian
2024-03-29 5124a64edfbcf43c8d4e9d6c396c2ebc3b31c795
conf/config.go
@@ -23,14 +23,14 @@
type (
   webConf struct {
      Host      string // 本机ip地址
      Port      string // 端口号
      APPort    string // 本机作为的Grpc服务端的端口号
      AlHost    string // 算法服务ip地址
      AlPort    string // 算法服务端口号
      NodeId    string // 主账户用户名
      OssType   string // 对象存储类型
      JWTSecret string
      Host    string // 本机ip地址
      Port    string // 端口号
      APPort  string // 本机作为的Grpc服务端的端口号
      AlHost  string // 算法服务ip地址
      AlPort  string // 算法服务端口号
      NodeId  string // 主账户用户名
      OssType string // 对象存储类型
      JWTKey  string
   }
   nsqConf struct {
@@ -41,6 +41,10 @@
   localConf struct {
      StorePath string // 本地文件存储路径
   }
   serviceConf struct {
      Aps string // 本地文件存储路径
   }
)
var (
@@ -49,9 +53,9 @@
   DbConf    = &mysqlx.Conf{}
   NsqConf   = &nsqConf{}
   LocalConf = &localConf{}
   NodeId    string
   GrpcPort  string
   Viper     *viper.Viper
   Service   = &serviceConf{}
)
func Init() error {
@@ -107,8 +111,8 @@
   _ = v.UnmarshalKey("web", WebConf)
   _ = v.UnmarshalKey("log", LogConf)
   _ = v.UnmarshalKey("db", DbConf)
   _ = v.UnmarshalKey("nsq", NsqConf)
   _ = v.UnmarshalKey("local", LocalConf)
   _ = v.UnmarshalKey("service", Service)
   showConfig()
}
@@ -120,5 +124,6 @@
   log.Printf("   NsqConf:                %+v", NsqConf)
   log.Printf("   GrpcPort:               %+v", GrpcPort)
   log.Printf("   LocalConf:               %+v", LocalConf)
   log.Printf("   ServiceConf:               %+v", Service)
   log.Println("......................................................")
}