| | |
| | | var serverIp,serverPort,dbTablePersons string |
| | | type conf struct { |
| | | PhotoUrl string `yaml:"photoUrl"` |
| | | Videopersons string `yaml:"videoPersons"` |
| | | Personaction string `yaml:"personAction"` |
| | | Serverip string `yaml:"serverIp"` |
| | | Serverport string `yaml:"serverPort"` |
| | | Dbtablepersons string `yaml:"dbTablePersons"` |
| | | VideoPersons string `yaml:"videoPersons"` |
| | | PersonAction string `yaml:"personAction"` |
| | | ServerIp string `yaml:"serverIp"` |
| | | ServerPort string `yaml:"serverPort"` |
| | | DbTablePersons string `yaml:"dbTablePersons"` |
| | | } |
| | | func Init() { |
| | | data, err := ioutil.ReadFile("./config/conf.yml") |
| | |
| | | c := conf{} |
| | | //把yaml形式的字符串解析成struct类型 |
| | | yaml.Unmarshal(data, &c) |
| | | serverIp = c.Serverip |
| | | serverPort = c.Serverport |
| | | dbTablePersons = c.Dbtablepersons |
| | | logger.Debug("配置文件的值为:",c) |
| | | serverIp = c.ServerIp |
| | | serverPort = c.ServerPort |
| | | dbTablePersons = c.DbTablePersons |
| | | localConfig, err1 := cache.GetServerInfo() |
| | | if err1 != nil { |
| | | logger.Error("查询本机信息失败!") |