包含Go API项目的所有源代码、配置文件、Docker配置、文档和前端资源 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
26 lines
604 B
Go
26 lines
604 B
Go
package operation_setting
|
|
|
|
import "one-api/setting/config"
|
|
|
|
type GeneralSetting struct {
|
|
DocsLink string `json:"docs_link"`
|
|
PingIntervalEnabled bool `json:"ping_interval_enabled"`
|
|
PingIntervalSeconds int `json:"ping_interval_seconds"`
|
|
}
|
|
|
|
// 默认配置
|
|
var generalSetting = GeneralSetting{
|
|
DocsLink: "https://docs.newapi.pro",
|
|
PingIntervalEnabled: false,
|
|
PingIntervalSeconds: 60,
|
|
}
|
|
|
|
func init() {
|
|
// 注册到全局配置管理器
|
|
config.GlobalConfig.Register("general_setting", &generalSetting)
|
|
}
|
|
|
|
func GetGeneralSetting() *GeneralSetting {
|
|
return &generalSetting
|
|
}
|