Files
in-server/app/main/api/internal/config/config.go

82 lines
1.8 KiB
Go
Raw Normal View History

2026-03-18 00:01:48 +08:00
package config
import (
"github.com/zeromicro/go-zero/core/stores/cache"
"github.com/zeromicro/go-zero/rest"
)
type Config struct {
rest.RestConf
DataSource string
CacheRedis cache.CacheConf
JwtAuth JwtAuth // JWT 鉴权相关配置
VerifyCode VerifyCode
Encrypt Encrypt
Tianyuanapi TianyuanapiConfig
SystemConfig SystemConfig
WechatH5 WechatH5Config
Authorization AuthorizationConfig // 授权书配置
WechatMini WechatMiniConfig
Query QueryConfig
AdminConfig AdminConfig
TaxConfig TaxConfig
// PC 报告前端访问基础地址,例如 https://your-domain/in-webview
ReportPcBaseUrl string
// 报告 PDF 本地缓存目录
ReportPdfDir string
}
// JwtAuth 用于 JWT 鉴权配置
type JwtAuth struct {
AccessSecret string // JWT 密钥,用于签发 Token
AccessExpire int64 // Token 过期时间,单位为秒
RefreshAfter int64
}
type VerifyCode struct {
AccessKeyID string
AccessKeySecret string
EndpointURL string
SignName string
TemplateCode string
ValidTime int
ComplaintTemplate string // 投诉通知短信模板
}
type Encrypt struct {
SecretKey string
}
type SystemConfig struct {
ThreeVerify bool
}
type WechatH5Config struct {
Enabled bool // 是否启用微信公众号登录
AppID string
AppSecret string
}
type WechatMiniConfig struct {
AppID string
AppSecret string
}
type QueryConfig struct {
ShareLinkExpire int64
}
type AdminConfig struct {
AccessSecret string
AccessExpire int64
RefreshAfter int64
}
type TaxConfig struct {
TaxRate float64
TaxExemptionAmount float64
}
type TianyuanapiConfig struct {
AccessID string
Key string
BaseURL string
Timeout int64
}
type AuthorizationConfig struct {
FileBaseURL string // 授权书文件访问基础URL
}