feat(user): 该更支付模式,查询模式

This commit is contained in:
2024-11-23 16:13:23 +08:00
parent 1604950f31
commit 014940d86d
21 changed files with 486 additions and 443 deletions

View File

@@ -15,9 +15,21 @@ import (
"github.com/zeromicro/go-zero/rest"
)
var configFile = flag.String("f", "etc/user.yaml", "the config file")
func main() {
// 读取环境变量 ENV默认为 "prod"
env := os.Getenv("ENV")
if env == "" {
env = "production"
}
// 根据 ENV 加载不同的配置文件
var defaultConfigFile string
if env == "development" {
defaultConfigFile = "etc/user.dev.yaml" // 开发环境配置
} else {
defaultConfigFile = "etc/user.yaml" // 生产环境配置
}
configFile := flag.String("f", defaultConfigFile, "the config file")
flag.Parse()
var c config.Config