代码推送
This commit is contained in:
@@ -9,26 +9,27 @@ import (
|
||||
|
||||
// Config 全局配置根结构
|
||||
type Config struct {
|
||||
Server ServerConfig `yaml:"server"`
|
||||
Database DatabaseConfig `yaml:"database"`
|
||||
JWT JWTConfig `yaml:"jwt"`
|
||||
Upload UploadConfig `yaml:"upload"`
|
||||
Storage StorageConfig `yaml:"storage"`
|
||||
SMS SMSConfig `yaml:"sms"`
|
||||
Wechat WechatConfig `yaml:"wechat"`
|
||||
AI AIConfig `yaml:"ai"`
|
||||
CORS CORSConfig `yaml:"cors"`
|
||||
RateLimit RateLimitConfig `yaml:"rate_limit"`
|
||||
Env EnvConfig `yaml:"env"`
|
||||
Server ServerConfig `yaml:"server"`
|
||||
Database DatabaseConfig `yaml:"database"`
|
||||
JWT JWTConfig `yaml:"jwt"`
|
||||
Upload UploadConfig `yaml:"upload"`
|
||||
Storage StorageConfig `yaml:"storage"`
|
||||
SMS SMSConfig `yaml:"sms"`
|
||||
Wechat WechatConfig `yaml:"wechat"`
|
||||
WechatWebhook WechatWebhookConfig `yaml:"wechat_webhook"`
|
||||
AI AIConfig `yaml:"ai"`
|
||||
CORS CORSConfig `yaml:"cors"`
|
||||
RateLimit RateLimitConfig `yaml:"rate_limit"`
|
||||
Env EnvConfig `yaml:"env"`
|
||||
}
|
||||
|
||||
// ServerConfig 服务配置
|
||||
type ServerConfig struct {
|
||||
Port int `yaml:"port"`
|
||||
ReadTimeout int `yaml:"read_timeout"` // 读超时(秒)
|
||||
WriteTimeout int `yaml:"write_timeout"` // 写超时(秒)
|
||||
IdleTimeout int `yaml:"idle_timeout"` // 空闲超时(秒)
|
||||
ShutdownTimeout int `yaml:"shutdown_timeout"` // 优雅关机等待(秒)
|
||||
Port int `yaml:"port"`
|
||||
ReadTimeout int `yaml:"read_timeout"` // 读超时(秒)
|
||||
WriteTimeout int `yaml:"write_timeout"` // 写超时(秒)
|
||||
IdleTimeout int `yaml:"idle_timeout"` // 空闲超时(秒)
|
||||
ShutdownTimeout int `yaml:"shutdown_timeout"` // 优雅关机等待(秒)
|
||||
}
|
||||
|
||||
// DatabaseConfig 数据库配置
|
||||
@@ -152,6 +153,12 @@ type WechatConfig struct {
|
||||
NotifyURL string `yaml:"notify_url"`
|
||||
}
|
||||
|
||||
// WechatWebhookConfig 企业微信群机器人Webhook配置
|
||||
type WechatWebhookConfig struct {
|
||||
Enabled bool `yaml:"enabled"`
|
||||
URL string `yaml:"url"`
|
||||
}
|
||||
|
||||
// AIConfig AI 配置
|
||||
type AIConfig struct {
|
||||
APIKey string `yaml:"api_key"`
|
||||
|
||||
Reference in New Issue
Block a user