refactor(repo): consolidate openflare-server to root and move subprojects to internal/apps

- Merge all files inside openflare-server to the repository root directory.
- Relocate agent, relay, and flared subprojects from internal/ to internal/apps/.
- Combine docker-compose files and update build context paths to root.
- Update GitHub workflows and Dockerfiles to refer to new directories and package names.
- Rewrite Go package imports across all files.
- Resolve database renew test race condition and clean up docs.
This commit is contained in:
ryan
2026-06-19 14:23:29 +08:00
parent 19d476ed7f
commit 63cd906cfc
1064 changed files with 366 additions and 1397 deletions
@@ -0,0 +1,23 @@
import {BaseService} from '@/lib/services/core';
import type {PublicConfigResponse} from './types';
/**
* 配置服务
* 处理系统公共配置相关的 API 请求
*/
export class ConfigService extends BaseService {
protected static readonly basePath = '/api/v1/config';
/**
* 获取公共配置
* @returns 公共配置信息
*
* @example
* ```typescript
* const config = await ConfigService.getPublicConfig();
* ```
*/
static async getPublicConfig(): Promise<PublicConfigResponse> {
return this.get<PublicConfigResponse>('/public');
}
}
+24
View File
@@ -0,0 +1,24 @@
/**
* 配置服务模块
*
* @description
* 提供系统公共配置相关的功能,包括:
* - 获取公共配置(争议时间窗口等)
* - 获取用户平台等级配置(公开接口)
*
* @example
* ```typescript
* import { ConfigService } from '@/lib/services';
*
* // 获取公共配置
* const config = await ConfigService.getPublicConfig();
* console.log('争议时间窗口:', config.dispute_time_window_hours, '小时');
*
* // 获取用户平台等级配置
* const payConfigs = await ConfigService.getUserPayConfigs();
* console.log('平台等级列表:', payConfigs);
* ```
*/
export { ConfigService } from './config.service';
export type * from './types';
+2
View File
@@ -0,0 +1,2 @@
/** 公共配置响应:key 为系统配置键,value 为配置表中保存的字符串值 */
export type PublicConfigResponse = Record<string, string | undefined>;