This commit is contained in:
新亮
2021-05-15 13:01:30 +08:00
parent ec3c9f0ccf
commit a6947b59ac
60 changed files with 1278 additions and 283 deletions

View File

@@ -1,7 +1,6 @@
package configs
import (
"fmt"
"time"
"github.com/xinliangnote/go-gin-api/pkg/env"
@@ -90,19 +89,3 @@ func init() {
func Get() Config {
return *config
}
func ProjectName() string {
return "go-gin-api"
}
func ProjectPort() string {
return ":9999"
}
func ProjectLogFile() string {
return fmt.Sprintf("./logs/%s-access.log", ProjectName())
}
func ProjectInstallFile() string {
return "INSTALL.lock"
}

36
configs/constants.go Normal file
View File

@@ -0,0 +1,36 @@
package configs
const (
// 项目版本
ProjectVersion = "v1.2.6"
// 项目名称
ProjectName = "go-gin-api"
// 项目端口
ProjectPort = ":9999"
// 项目日志存放文件
ProjectLogFile = "./logs/" + ProjectName + "-access.log"
// 项目安装完成标识
ProjectInstallMark = "INSTALL.lock"
// 登录验证 TokenHeader 中传递的参数
LoginToken = "Token"
// 签名验证 TokenHeader 中传递的参数
SignToken = "Authorization"
// 签名验证 DateHeader 中传递的参数
SignTokenDate = "Authorization-Date"
// Redis Key 前缀 - 防止重复提交
RedisKeyPrefixRequestID = ProjectName + ":request-id:"
// Redis Key 前缀 - 登录用户信息
RedisKeyPrefixLoginUser = ProjectName + ":login-user:"
// Redis Key 前缀 - 签名验证信息
RedisKeyPrefixSignature = ProjectName + ":signature:"
)