Commit 8718709a by zhengqiuyun86

httpClient封装

parent 6676796c
package conf package conf
import ( import (
"git.168cad.top/zhengqiuyun/rym-util/exception"
"git.168cad.top/zhengqiuyun/rym-util/util" "git.168cad.top/zhengqiuyun/rym-util/util"
) )
...@@ -22,21 +21,10 @@ type Config struct { ...@@ -22,21 +21,10 @@ type Config struct {
} }
func BaseConfig(conf Config) { func BaseConfig(conf Config) {
if util.IsEmpty(&conf.ServerName) {
exception.ThrowsErrS("SYSTEM_ERR", "ServerName error")
} else {
ServerName = conf.ServerName ServerName = conf.ServerName
}
if util.IsEmpty(&conf.Env) {
panic("Env error")
} else {
Env = conf.Env Env = conf.Env
}
if conf.HttpPort < 1024 {
panic("HttpPort error")
} else {
HttpPort = conf.HttpPort HttpPort = conf.HttpPort
}
if util.IsEmpty(&conf.LogLevel) { if util.IsEmpty(&conf.LogLevel) {
LogLevel = "DEBUG" LogLevel = "DEBUG"
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment