| 
									
										
										
										
											2024-11-03 15:28:10 +08:00
										 |  |  | package config | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import ( | 
					
						
							|  |  |  | 	"github.com/zeromicro/go-zero/core/stores/cache" | 
					
						
							|  |  |  | 	"github.com/zeromicro/go-zero/rest" | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type Config struct { | 
					
						
							|  |  |  | 	rest.RestConf | 
					
						
							| 
									
										
										
										
											2025-05-09 17:54:28 +08:00
										 |  |  | 	DataSource     string | 
					
						
							|  |  |  | 	CacheRedis     cache.CacheConf | 
					
						
							|  |  |  | 	JwtAuth        JwtAuth // JWT 鉴权相关配置 | 
					
						
							|  |  |  | 	VerifyCode     VerifyCode | 
					
						
							|  |  |  | 	Encrypt        Encrypt | 
					
						
							|  |  |  | 	Alipay         AlipayConfig | 
					
						
							|  |  |  | 	Wxpay          WxpayConfig | 
					
						
							|  |  |  | 	Applepay       ApplepayConfig | 
					
						
							|  |  |  | 	Ali            AliConfig | 
					
						
							|  |  |  | 	WestConfig     WestConfig | 
					
						
							|  |  |  | 	YushanConfig   YushanConfig | 
					
						
							|  |  |  | 	TianjuConfig   TianjuConfig | 
					
						
							|  |  |  | 	AdminConfig    AdminConfig | 
					
						
							|  |  |  | 	AdminPromotion AdminPromotion | 
					
						
							| 
									
										
										
										
											2025-05-27 18:35:01 +08:00
										 |  |  | 	CleanTask      CleanTask | 
					
						
							| 
									
										
										
										
											2025-08-13 19:15:06 +08:00
										 |  |  | 	Tianyuanapi    TianyuanapiConfig | 
					
						
							| 
									
										
										
										
											2025-08-16 13:06:51 +08:00
										 |  |  | 	VerifyConfig   VerifyConfig | 
					
						
							| 
									
										
										
										
											2025-08-31 14:18:31 +08:00
										 |  |  | 	Security       SecurityConfig // 安全配置 | 
					
						
							|  |  |  | 	Logging        LoggingConfig  // 日志配置 | 
					
						
							| 
									
										
										
										
											2024-11-03 15:28:10 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // 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 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2024-11-21 12:14:34 +08:00
										 |  |  | type Encrypt struct { | 
					
						
							|  |  |  | 	SecretKey string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type AlipayConfig struct { | 
					
						
							| 
									
										
										
										
											2025-05-27 18:35:01 +08:00
										 |  |  | 	Enabled         bool | 
					
						
							| 
									
										
										
										
											2024-11-21 12:14:34 +08:00
										 |  |  | 	AppID           string | 
					
						
							|  |  |  | 	PrivateKey      string | 
					
						
							|  |  |  | 	AlipayPublicKey string | 
					
						
							|  |  |  | 	IsProduction    bool | 
					
						
							|  |  |  | 	NotifyUrl       string | 
					
						
							| 
									
										
										
										
											2024-12-28 02:21:47 +08:00
										 |  |  | 	ReturnURL       string | 
					
						
							| 
									
										
										
										
											2024-11-21 12:14:34 +08:00
										 |  |  | } | 
					
						
							|  |  |  | type WxpayConfig struct { | 
					
						
							| 
									
										
										
										
											2025-05-27 18:35:01 +08:00
										 |  |  | 	Enabled                    bool | 
					
						
							| 
									
										
										
										
											2024-11-21 12:14:34 +08:00
										 |  |  | 	AppID                      string | 
					
						
							| 
									
										
										
										
											2025-01-18 22:34:27 +08:00
										 |  |  | 	AppSecret                  string | 
					
						
							| 
									
										
										
										
											2024-11-21 12:14:34 +08:00
										 |  |  | 	MchID                      string | 
					
						
							|  |  |  | 	MchCertificateSerialNumber string | 
					
						
							|  |  |  | 	MchApiv3Key                string | 
					
						
							|  |  |  | 	MchPrivateKeyPath          string | 
					
						
							|  |  |  | 	NotifyUrl                  string | 
					
						
							|  |  |  | 	RefundNotifyUrl            string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type AliConfig struct { | 
					
						
							|  |  |  | 	Code string | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2024-11-27 01:58:05 +08:00
										 |  |  | type ApplepayConfig struct { | 
					
						
							| 
									
										
										
										
											2025-05-27 18:35:01 +08:00
										 |  |  | 	Enabled             bool | 
					
						
							| 
									
										
										
										
											2024-11-27 01:58:05 +08:00
										 |  |  | 	ProductionVerifyURL string | 
					
						
							|  |  |  | 	SandboxVerifyURL    string // 沙盒环境的验证 URL | 
					
						
							|  |  |  | 	Sandbox             bool | 
					
						
							|  |  |  | 	BundleID            string | 
					
						
							|  |  |  | 	IssuerID            string | 
					
						
							|  |  |  | 	KeyID               string | 
					
						
							|  |  |  | 	LoadPrivateKeyPath  string | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2024-11-21 12:14:34 +08:00
										 |  |  | type WestConfig struct { | 
					
						
							|  |  |  | 	Url            string | 
					
						
							|  |  |  | 	Key            string | 
					
						
							|  |  |  | 	SecretId       string | 
					
						
							|  |  |  | 	SecretSecondId string | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2024-12-28 02:21:47 +08:00
										 |  |  | type YushanConfig struct { | 
					
						
							|  |  |  | 	ApiKey string | 
					
						
							|  |  |  | 	AcctID string | 
					
						
							|  |  |  | 	Url    string | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-03-20 20:32:57 +08:00
										 |  |  | type TianjuConfig struct { | 
					
						
							|  |  |  | 	ApiKey  string | 
					
						
							|  |  |  | 	BaseURL string | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-05-09 17:54:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | type AdminConfig struct { | 
					
						
							|  |  |  | 	AccessSecret string | 
					
						
							|  |  |  | 	AccessExpire int64 | 
					
						
							|  |  |  | 	RefreshAfter int64 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type AdminPromotion struct { | 
					
						
							|  |  |  | 	URLDomain string | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-05-27 18:35:01 +08:00
										 |  |  | type CleanTask struct { | 
					
						
							|  |  |  | 	Enabled bool | 
					
						
							|  |  |  | 	Time    string | 
					
						
							|  |  |  | 	Days    int | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-08-13 19:15:06 +08:00
										 |  |  | type TianyuanapiConfig struct { | 
					
						
							|  |  |  | 	AccessID string | 
					
						
							|  |  |  | 	Key      string | 
					
						
							|  |  |  | 	BaseURL  string | 
					
						
							|  |  |  | 	Timeout  int64 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-08-16 13:06:51 +08:00
										 |  |  | type VerifyConfig struct { | 
					
						
							|  |  |  | 	TwoFactor bool | 
					
						
							|  |  |  | } |