新增配置文件处理
This commit is contained in:
parent
69e7cd2440
commit
f1dcd147fc
@ -6,6 +6,7 @@ import (
|
|||||||
"hospital-admin-api/api/controller"
|
"hospital-admin-api/api/controller"
|
||||||
"hospital-admin-api/api/exception"
|
"hospital-admin-api/api/exception"
|
||||||
"hospital-admin-api/api/middlewares"
|
"hospital-admin-api/api/middlewares"
|
||||||
|
"hospital-admin-api/config"
|
||||||
"hospital-admin-api/consts"
|
"hospital-admin-api/consts"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
@ -14,6 +15,11 @@ import (
|
|||||||
func Init() *gin.Engine {
|
func Init() *gin.Engine {
|
||||||
r := gin.New()
|
r := gin.New()
|
||||||
|
|
||||||
|
// 环境设置
|
||||||
|
if config.C.Env == "prod" {
|
||||||
|
gin.SetMode(gin.ReleaseMode)
|
||||||
|
}
|
||||||
|
|
||||||
r.Use(middlewares.Logrus())
|
r.Use(middlewares.Logrus())
|
||||||
r.Use(gin.Recovery())
|
r.Use(gin.Recovery())
|
||||||
|
|
||||||
|
|||||||
54
config.yaml.template
Normal file
54
config.yaml.template
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
port: # 启动端口
|
||||||
|
|
||||||
|
env: dev # 环境配置
|
||||||
|
|
||||||
|
snowflake: 1 # 雪花算法机器id
|
||||||
|
|
||||||
|
# [数据库配置]
|
||||||
|
mysql:
|
||||||
|
host: ''
|
||||||
|
username: root
|
||||||
|
password: ''
|
||||||
|
port: #端口
|
||||||
|
db-name: # 数据库名称
|
||||||
|
max-idle-cons: 5
|
||||||
|
max-open-cons: 20
|
||||||
|
debug: true
|
||||||
|
|
||||||
|
log:
|
||||||
|
file-path: ""#配置文件地址
|
||||||
|
# file-path: "/var/log/dev-hospital-admin-api/"
|
||||||
|
file-name: ""#配置文件名称
|
||||||
|
|
||||||
|
# [redis]
|
||||||
|
redis:
|
||||||
|
host: ''
|
||||||
|
port: 6379
|
||||||
|
password:
|
||||||
|
pool-size: 100
|
||||||
|
|
||||||
|
# [jwt]
|
||||||
|
jwt:
|
||||||
|
sign-key: # 私钥
|
||||||
|
ttl : 48 # 过期时间 小时
|
||||||
|
algo : HS256 # 加密方式
|
||||||
|
|
||||||
|
oss:
|
||||||
|
oss-access-key:
|
||||||
|
oss-access-key-secret:
|
||||||
|
oss-bucket:
|
||||||
|
oss-endpoint:
|
||||||
|
oss-custom-domain-name:
|
||||||
|
oss-env:
|
||||||
|
|
||||||
|
ca-online:
|
||||||
|
ca-online-app-id:
|
||||||
|
ca-online-app-secret:
|
||||||
|
ca-online-api-url:
|
||||||
|
|
||||||
|
# [腾讯im]
|
||||||
|
im:
|
||||||
|
im-app-id:
|
||||||
|
im-secret:
|
||||||
|
im-base-url: https://console.tim.qq.com/
|
||||||
|
im-token:
|
||||||
Loading…
x
Reference in New Issue
Block a user