first commit
This commit is contained in:
100
app/main/api/internal/config/config.go
Normal file
100
app/main/api/internal/config/config.go
Normal file
@@ -0,0 +1,100 @@
|
||||
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
|
||||
Alipay AlipayConfig
|
||||
Wxpay WxpayConfig
|
||||
Ali AliConfig
|
||||
Tianyuanapi TianyuanapiConfig
|
||||
SystemConfig SystemConfig
|
||||
WechatH5 WechatH5Config
|
||||
WechatMini WechatMiniConfig
|
||||
Query QueryConfig
|
||||
AdminConfig AdminConfig
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
type Encrypt struct {
|
||||
SecretKey string
|
||||
}
|
||||
|
||||
type AlipayConfig struct {
|
||||
AppID string
|
||||
PrivateKey string
|
||||
AlipayPublicKey string
|
||||
AppCertPath string // 应用公钥证书路径
|
||||
AlipayCertPath string // 支付宝公钥证书路径
|
||||
AlipayRootCertPath string // 根证书路径
|
||||
IsProduction bool
|
||||
NotifyUrl string
|
||||
ReturnURL string
|
||||
}
|
||||
type WxpayConfig struct {
|
||||
AppID string
|
||||
MchID string
|
||||
MchCertificateSerialNumber string
|
||||
MchApiv3Key string
|
||||
MchPrivateKeyPath string
|
||||
MchPublicKeyID string
|
||||
MchPublicKeyPath string
|
||||
NotifyUrl string
|
||||
RefundNotifyUrl string
|
||||
}
|
||||
type AliConfig struct {
|
||||
Code string
|
||||
}
|
||||
type SystemConfig struct {
|
||||
ThreeVerify bool
|
||||
}
|
||||
type WechatH5Config struct {
|
||||
AppID string
|
||||
AppSecret string
|
||||
}
|
||||
type WechatMiniConfig struct {
|
||||
AppID string
|
||||
AppSecret string
|
||||
TycAppID string
|
||||
TycAppSecret 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
|
||||
}
|
||||
Reference in New Issue
Block a user