ai-css/common/common.go
2026-03-04 15:39:09 +00:00

38 lines
721 B
Go

package common
import (
"fmt"
"os"
"path"
)
var (
PageSize uint = 10
VisitorPageSize uint = 8
Version string = "0.3.9"
VisitorExpire float64 = 600
Upload string = "static/upload/"
Dir string = "config/"
MysqlConf string = Dir + "mysql.json"
IsCompireTemplate bool = false //是否编译静态模板到二进制
)
const (
ENV_DEV = "dev"
ENV_TEST = "test"
ENV_PROD = "prod"
)
var (
environment = os.Getenv("AICSS_ENV")
)
func getConfigPath() string {
switch environment {
case ENV_DEV, ENV_TEST, ENV_PROD:
return path.Join(Dir, fmt.Sprintf("config_%s.yaml", environment))
default:
return path.Join(Dir, "config.yaml")
}
}