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

152 lines
4.2 KiB
Go
Raw Normal View History

2025-12-27 18:12:05 +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
Alipay AlipayConfig
Wxpay WxpayConfig
Applepay ApplepayConfig
2025-12-31 16:54:17 +08:00
EasyPay EasyPayConfig
2026-01-16 03:33:02 +08:00
YunYinSignPay YunYinSignPayConfig
2025-12-27 18:12:05 +08:00
Tianyuanapi TianyuanapiConfig
SystemConfig SystemConfig
WechatH5 WechatH5Config
Authorization AuthorizationConfig // 授权书配置
WechatMini WechatMiniConfig
Query QueryConfig
AdminConfig AdminConfig
TaxConfig TaxConfig
Promotion PromotionConfig // 推广链接配置
}
// JwtAuth 用于 JWT 鉴权配置
type JwtAuth struct {
AccessSecret string // JWT 密钥,用于签发 Token
AccessExpire int64 // Token 过期时间,单位为秒
RefreshAfter int64
}
type VerifyCode struct {
2025-12-31 16:54:17 +08:00
AccessKeyID string
AccessKeySecret string
EndpointURL string
SignName string
TemplateCode string
ValidTime int
ComplaintTemplate string // 投诉通知短信模板
2025-12-27 18:12:05 +08:00
}
type Encrypt struct {
SecretKey string
}
type AlipayConfig struct {
2025-12-31 16:54:17 +08:00
Enabled bool // 是否启用支付宝支付
2025-12-27 18:12:05 +08:00
AppID string
PrivateKey string
AlipayPublicKey string
AppCertPath string // 应用公钥证书路径
AlipayCertPath string // 支付宝公钥证书路径
AlipayRootCertPath string // 根证书路径
IsProduction bool
NotifyUrl string
ReturnURL string
}
type WxpayConfig struct {
2025-12-31 16:54:17 +08:00
Enabled bool // 是否启用微信支付
2025-12-27 18:12:05 +08:00
AppID string
MchID string
MchCertificateSerialNumber string
MchApiv3Key string
MchPrivateKeyPath string
MchPublicKeyID string
MchPublicKeyPath string
MchPlatformRAS string
NotifyUrl string
RefundNotifyUrl string
}
type ApplepayConfig struct {
2025-12-31 16:54:17 +08:00
Enabled bool // 是否启用Apple支付
2025-12-27 18:12:05 +08:00
ProductionVerifyURL string
SandboxVerifyURL string // 沙盒环境的验证 URL
Sandbox bool
BundleID string
IssuerID string
KeyID string
LoadPrivateKeyPath string
}
type SystemConfig struct {
ThreeVerify bool
}
type WechatH5Config struct {
2025-12-31 16:54:17 +08:00
Enabled bool // 是否启用微信公众号登录
2025-12-27 18:12:05 +08:00
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
}
// PromotionConfig 推广链接配置
type PromotionConfig struct {
PromotionDomain string // 推广域名(用于生成短链)
OfficialDomain string // 正式站点域名(短链重定向的目标域名)
}
2025-12-31 16:54:17 +08:00
// EasyPayConfig 易支付配置
type EasyPayConfig struct {
2026-01-09 14:04:33 +08:00
Enabled bool // 是否启用易支付
ApiURL string // 接口地址
PID string // 商户ID
PKEY string // 商户密钥
CIDs []string // 支付渠道ID数组可配置一个或多个
RotateMode string // 轮询模式day天数轮询或 count次数轮询默认day
RotateDays int // 渠道轮询天数默认3天仅在RotateMode=day时生效
NotifyUrl string // 异步通知地址
ReturnUrl string // 页面跳转地址
2025-12-31 16:54:17 +08:00
}
2026-01-16 03:33:02 +08:00
// YunYinSignPayConfig 云印签支付配置
type YunYinSignPayConfig struct {
Enabled bool // 是否启用云印签支付
ApiURL string // 接口地址
AppID string // 应用ID
AppSecret string // 应用密钥
Mobile string // 我方手机号
Name string // 我方姓名
CorpName string // 我方公司名称
TemplateCode string // 模板代码
TemplateName string // 模板名称
}