tianyuan-api-server/apps/gateway/internal/config/config.go
2024-10-02 00:57:17 +08:00

47 lines
1.0 KiB
Go

package config
import (
"github.com/zeromicro/go-zero/core/stores/cache"
"github.com/zeromicro/go-zero/rest"
"github.com/zeromicro/go-zero/zrpc"
)
type Config struct {
rest.RestConf
DataSource string // 数据库连接的 DSN 字符串
AuthJWT AuthConfig // JWT 鉴权相关配置
CacheRedis cache.CacheConf // 缓存配置,使用 go-zero 自带的缓存配置结构体
UserRpc zrpc.RpcClientConf
SentinelRpc zrpc.RpcClientConf
VerifyCode VerifyCode
Qiniu QiniuConfig
Baidu BaiduConfig
}
// AuthConfig 用于 JWT 鉴权配置
type AuthConfig struct {
AccessSecret string // JWT 密钥,用于签发 Token
AccessExpire int64 // Token 过期时间,单位为秒
}
type VerifyCode struct {
AccessKeyID string
AccessKeySecret string
EndpointURL string
SignName string
TemplateCode string
ValidTime int
}
type QiniuConfig struct {
AccessKey string
SecretKey string
Bucket string
Domain string
}
type BaiduConfig struct {
ApiKey string
SecretKey string
}