@@ -0,0 +1,162 @@
|
||||
// config/api-reservations.js
|
||||
/**
|
||||
* [重构] 接口预留位置配置
|
||||
* 定义所有接口的预留位置,方便后续扩展
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// 更新服务接口
|
||||
update: {
|
||||
apiId: 'update-service',
|
||||
category: 'system',
|
||||
description: '应用更新服务',
|
||||
priority: 10,
|
||||
enabled: true,
|
||||
config: {
|
||||
url: 'https://update.ymhut.cn/update-info.json',
|
||||
method: 'GET',
|
||||
timeout: 10000,
|
||||
retries: 2,
|
||||
healthCheckUrl: 'https://update.ymhut.cn/update-info.json',
|
||||
healthCheckInterval: 3600000 // 1小时检查一次
|
||||
}
|
||||
},
|
||||
|
||||
// 远程配置接口
|
||||
remoteConfig: {
|
||||
apiId: 'remote-config',
|
||||
category: 'system',
|
||||
description: '远程配置服务',
|
||||
priority: 10,
|
||||
enabled: true,
|
||||
config: {
|
||||
urls: {
|
||||
media_types: 'https://update.ymhut.cn/media-types.json',
|
||||
update_info: 'https://update.ymhut.cn/update-info.json',
|
||||
tool_status: 'https://update.ymhut.cn/tool-status.json'
|
||||
},
|
||||
timeout: 10000,
|
||||
retries: 2
|
||||
}
|
||||
},
|
||||
|
||||
// 天气服务接口
|
||||
weather: {
|
||||
apiId: 'weather-service',
|
||||
category: 'tool',
|
||||
description: '天气查询服务',
|
||||
priority: 5,
|
||||
enabled: true,
|
||||
config: {
|
||||
url: 'https://uapis.cn/api/v1/misc/weather',
|
||||
method: 'GET',
|
||||
timeout: 8000,
|
||||
retries: 2,
|
||||
healthCheckInterval: 1800000 // 30分钟检查一次
|
||||
}
|
||||
},
|
||||
|
||||
// IP查询服务接口
|
||||
ipQuery: {
|
||||
apiId: 'ip-query-service',
|
||||
category: 'tool',
|
||||
description: 'IP查询服务',
|
||||
priority: 5,
|
||||
enabled: true,
|
||||
config: {
|
||||
urls: [
|
||||
'https://api.ipify.org?format=json',
|
||||
'https://ipinfo.io/json'
|
||||
],
|
||||
timeout: 5000,
|
||||
retries: 1
|
||||
}
|
||||
},
|
||||
|
||||
// 智能搜索服务接口
|
||||
smartSearch: {
|
||||
apiId: 'smart-search-service',
|
||||
category: 'tool',
|
||||
description: '智能搜索服务',
|
||||
priority: 8,
|
||||
enabled: true,
|
||||
config: {
|
||||
url: 'https://uapis.cn/api/v1/search/aggregate',
|
||||
method: 'POST',
|
||||
timeout: 15000,
|
||||
retries: 2,
|
||||
healthCheckInterval: 600000 // 10分钟检查一次
|
||||
}
|
||||
},
|
||||
|
||||
// 工具健康检查接口(预留)
|
||||
toolHealthCheck: {
|
||||
apiId: 'tool-health-check',
|
||||
category: 'system',
|
||||
description: '工具健康检查服务',
|
||||
priority: 9,
|
||||
enabled: true,
|
||||
config: {
|
||||
// 此接口用于检查各个工具的健康状态
|
||||
// 具体配置由各个工具自行定义
|
||||
}
|
||||
},
|
||||
|
||||
// 语言包下载接口
|
||||
languagePack: {
|
||||
apiId: 'language-pack',
|
||||
category: 'system',
|
||||
description: '语言包下载服务',
|
||||
priority: 7,
|
||||
enabled: true,
|
||||
config: {
|
||||
url: 'https://update.ymhut.cn/lang',
|
||||
method: 'GET',
|
||||
timeout: 30000,
|
||||
retries: 3
|
||||
}
|
||||
},
|
||||
|
||||
// 图标缓存接口
|
||||
iconCache: {
|
||||
apiId: 'icon-cache',
|
||||
category: 'system',
|
||||
description: '图标缓存服务',
|
||||
priority: 3,
|
||||
enabled: true,
|
||||
config: {
|
||||
// 图标URL由各个工具提供
|
||||
}
|
||||
},
|
||||
|
||||
// 字体下载接口
|
||||
fontDownload: {
|
||||
apiId: 'font-download',
|
||||
category: 'system',
|
||||
description: '字体下载服务',
|
||||
priority: 4,
|
||||
enabled: true,
|
||||
config: {
|
||||
url: 'https://update.ymhut.cn/fonts',
|
||||
method: 'GET',
|
||||
timeout: 60000,
|
||||
retries: 3
|
||||
}
|
||||
},
|
||||
|
||||
// IP封禁列表接口
|
||||
ipBanList: {
|
||||
apiId: 'ip-ban-list',
|
||||
category: 'security',
|
||||
description: 'IP封禁列表服务',
|
||||
priority: 6,
|
||||
enabled: true,
|
||||
config: {
|
||||
url: 'https://update.ymhut.cn/ip-ban-list.json',
|
||||
method: 'GET',
|
||||
timeout: 5000,
|
||||
retries: 1,
|
||||
healthCheckInterval: 3600000 // 1小时检查一次
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user