46 lines
1.5 KiB
TypeScript
46 lines
1.5 KiB
TypeScript
import { get, put } from './request'
|
|
|
|
/** Issue#3 方案B:系统参数配置(system_config KV;admin)。 */
|
|
export interface SystemConfigRow {
|
|
id: number
|
|
cfg_key: string
|
|
cfg_value: string
|
|
remark: string
|
|
updated_by: string
|
|
updated_at: string
|
|
}
|
|
|
|
export interface SystemConfigSaveReq {
|
|
cfg_key: string
|
|
cfg_value: string
|
|
remark?: string
|
|
}
|
|
|
|
/** 已知键说明(表结构无白名单,新键=新能力;此处仅运营提示)。 */
|
|
export const KNOWN_CFG_KEYS: { key: string; label: string; hint: string }[] = [
|
|
{
|
|
key: 'cmpp.default_ext_code',
|
|
label: '系统默认接入码前缀',
|
|
hint: 'CMPP/SMPP 账号未配置扩展码(ext_code)时回退此值校验 SrcID 前缀;改后受理侧 ≤30s 生效',
|
|
},
|
|
{
|
|
key: 'uplink.blacklist.keywords',
|
|
label: '上行自动拉黑词表',
|
|
hint: '逗号分隔等值匹配(如 R,TD,退订,拒收);空=内置默认词表;改后 ≤60s 生效',
|
|
},
|
|
]
|
|
|
|
export const systemApi = {
|
|
// ---- Issue#6·P2:/ops/system/overview(admin/ops;gateway 视角五子系统三态) ----
|
|
overview: () => get<SystemOverview>('/ops/system/overview'),
|
|
list: () => get<{ list: SystemConfigRow[] }>('/system/config'),
|
|
update: (body: SystemConfigSaveReq) => put<SystemConfigRow>('/system/config', body),
|
|
}
|
|
|
|
/** 系统健康总览(P2:/ops/system/overview)。 */
|
|
export interface SystemOverview {
|
|
uptime_s: number
|
|
subsystems: { name: string; status: 'up' | 'degraded' | 'down' | 'unknown'; detail: string; latency_ms: number }[]
|
|
}
|
|
|