modify-bug
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m58s

This commit is contained in:
sexygoat
2026-03-28 18:31:43 +08:00
parent d6c23c8bd1
commit dbe6070207
22 changed files with 922 additions and 260 deletions

View File

@@ -17,8 +17,7 @@ export enum NetworkStatus {
// 实名状态
export enum RealNameStatus {
NOT_VERIFIED = 0, // 未实名
VERIFYING = 1, // 实名
VERIFIED = 2 // 已实名
VERIFIED = 1 // 实名
}
// 保护期状态
@@ -55,7 +54,7 @@ export interface AssetResolveResponse {
shop_name: string // 所属店铺名称
series_id: number // 套餐系列 ID
series_name: string // 套餐系列名称
real_name_status: RealNameStatus // 实名状态0 未实名 / 1 实名中 / 2 已实名
real_name_status: RealNameStatus // 实名状态0 未实名 / 1 已实名
network_status?: NetworkStatus // 网络状态0 停机 / 1 开机(仅 card
current_package: string // 当前套餐名称(无则空)
package_total_mb: number // 当前套餐总虚流量 MB
@@ -93,6 +92,11 @@ export interface AssetResolveResponse {
device_type?: string // 设备类型
max_sim_slots?: number // 最大插槽数
manufacturer?: string // 制造商
online_status?: number // 在线状态0=未知, 1=在线, 2=离线(仅 device
last_online_time?: string | null // 最后在线时间(仅 device
software_version?: string // 固件版本号(仅 device
switch_mode?: string // 切卡模式:"0"=自动, "1"=手动(仅 device
last_gateway_sync_at?: string | null // 最后 sync-info 同步时间(仅 device
}
/**
@@ -105,10 +109,49 @@ export interface AssetBoundCard {
network_status: NetworkStatus // 网络状态
real_name_status: RealNameStatus // 实名状态
slot_position: number // 插槽位置
is_current?: boolean // 是否为设备当前使用的卡
}
// ========== 资产实时状态响应 ==========
/**
* 设备 Gateway 实时信息
*/
export interface DeviceGatewayInfo {
online_status?: number // 1=在线, 2=离线
battery_level?: number | null // 电量 %(无电池时 null
status?: number // 设备状态 1=正常, 0=禁用
run_time?: string // 本次开机时长(秒)
connect_time?: string // 本次联网时长(秒)
last_online_time?: string // 设备最后在线时间
last_update_time?: string // 信息最后更新时间
rsrp?: number // 信号接收功率(dBm)
rsrq?: number // 信号接收质量(dB)
rssi?: string // 信号强度
sinr?: number // 信噪比(dB)
ssid?: string // WiFi 热点名称
wifi_enabled?: boolean // WiFi 开关
wifi_password?: string // WiFi 密码
ip_address?: string // IP
wan_ip?: string // 基站分配 IPv4
lan_ip?: string // 局域网网关 IP
mac_address?: string // MAC 地址
daily_usage?: string // 日使用流量(字节)
dl_stats?: string // 本次开机下载(字节)
ul_stats?: string // 本次开机上传(字节)
limit_speed?: number // 限速(KB/s)0=不限
current_iccid?: string // 当前使用卡 ICCID
max_clients?: number // 最大连接客户端数
software_version?: string // 固件版本
switch_mode?: string // 切卡模式
sync_interval?: number // 上报周期(秒)
device_id?: string // Gateway 设备ID
device_name?: string // Gateway 设备名称
device_type?: string // Gateway 设备类型
imei?: string
imsi?: string
}
/**
* 资产实时状态响应
* 对应接口GET /api/admin/assets/:asset_type/:id/realtime-status
@@ -126,6 +169,12 @@ export interface AssetRealtimeStatusResponse {
// ===== 设备专属字段 =====
device_protect_status?: DeviceProtectStatus // 保护期(仅 device
cards?: AssetBoundCard[] // 所有绑定卡的状态(仅 device
online_status?: number // 在线状态(仅 device
last_online_time?: string | null // 最后在线时间(仅 device
software_version?: string // 固件版本号(仅 device
switch_mode?: string // 切卡模式(仅 device
last_gateway_sync_at?: string | null // 最后同步时间(仅 device
device_realtime?: DeviceGatewayInfo | null // Gateway 实时数据(仅 deviceGateway 不可达时为 null
}
/**
@@ -161,6 +210,25 @@ export interface AssetPackageUsageRecord {
created_at?: string // 创建时间
}
/**
* 资产套餐列表分页响应
* 对应接口GET /api/admin/assets/:asset_type/:id/packages?page=1&page_size=50
*/
export interface AssetPackageListResponse {
total: number // 总记录数
page: number // 当前页码
page_size: number // 每页数量
items: AssetPackageUsageRecord[] // 套餐记录列表
}
/**
* 资产套餐查询参数
*/
export interface AssetPackageParams {
page?: number // 页码默认1
page_size?: number // 每页数量默认50
}
/**
* 当前套餐响应(结构同套餐使用记录单项)
* 对应接口GET /api/admin/assets/:asset_type/:id/current-package

View File

@@ -9,7 +9,8 @@ export enum CommissionStatus {
FROZEN = 1, // 已冻结
UNFREEZING = 2, // 解冻中
RELEASED = 3, // 已发放
INVALID = 4 // 已失效
INVALID = 4, // 已失效
PENDING_CORRECTION = 99 // 待人工修正
}
// 提现状态
@@ -92,7 +93,7 @@ export interface ApproveWithdrawalParams {
*/
export interface RejectWithdrawalParams {
reject_reason: string // 拒绝原因
remark?: string // 备注
remark: string // 备注(必填)
}
// ==================== 提现配置相关 ====================
@@ -294,3 +295,19 @@ export interface DailyCommissionStatsItem {
total_amount: number // 当日总收入(分)
total_count: number // 当日总笔数
}
// ==================== 佣金记录修正相关 ====================
/**
* 佣金记录修正动作类型
*/
export type CommissionResolveAction = 'release' | 'invalidate'
/**
* 佣金记录修正请求参数
*/
export interface ResolveCommissionParams {
action: CommissionResolveAction // 操作类型release入账/ invalidate作废
amount?: number // 佣金金额action=release 时必填
remark?: string // 备注可选最多500字符
}

View File

@@ -14,6 +14,16 @@ export enum DeviceStatus {
DEACTIVATED = 4 // 已停用
}
// 设备在线状态枚举
export enum DeviceOnlineStatus {
UNKNOWN = 0, // 未知
ONLINE = 1, // 在线
OFFLINE = 2 // 离线
}
// 切卡模式
export type SwitchMode = '0' | '1' // 0=自动, 1=手动
// ========== 设备基础类型 ==========
// 设备信息
@@ -35,6 +45,11 @@ export interface Device {
created_at: string // 创建时间
updated_at: string // 更新时间
series_id?: number | null // 套餐系列ID
online_status?: DeviceOnlineStatus // 在线状态0=未知, 1=在线, 2=离线
last_online_time?: string | null // 最后在线时间
software_version?: string // 固件版本号
switch_mode?: SwitchMode // 切卡模式:"0"=自动, "1"=手动
last_gateway_sync_at?: string | null // 最后 sync-info 同步时间
}
// 设备查询参数
@@ -71,6 +86,7 @@ export interface DeviceCardBinding {
slot_position: number // 插槽位置 (1-4)
status: number // 卡状态 (1:在库, 2:已分销, 3:已激活, 4:已停用)
bind_time: string | null // 绑定时间
is_current?: boolean // 是否为设备当前使用的卡
}
// 设备绑定的卡列表响应

View File

@@ -96,6 +96,11 @@ export interface CommissionTierInfo {
next_threshold?: number | null // 下一档位阈值
}
/**
* 套餐到期计时基准枚举
*/
export type ExpiryBase = 'from_activation' | 'from_purchase'
/**
* 套餐响应
*/
@@ -114,7 +119,7 @@ export interface PackageResponse {
virtual_data_mb?: number // 虚流量额度MB
virtual_ratio?: number // 虚流量比例real_data_mb / virtual_data_mb。启用虚流量时计算否则为 1.0
enable_virtual_data?: boolean // 是否启用虚流量
enable_realname_activation?: boolean // 是否启用实名激活 (true:需实名后激活, false:立即激活)
expiry_base?: ExpiryBase // 到期计时基准: from_activation(实名后开始计时) / from_purchase(购买即开始计时)
cost_price?: number // 成本价(分)
suggested_retail_price?: number // 建议零售价(分)
current_commission_rate?: string // 当前返佣比例(仅代理用户可见)
@@ -155,7 +160,7 @@ export interface CreatePackageRequest {
real_data_mb?: number | null // 真流量额度MB可选
virtual_data_mb?: number | null // 虚流量额度MB可选
enable_virtual_data?: boolean // 是否启用虚流量,可选
enable_realname_activation?: boolean | null // 是否启用实名激活 (true:需实名后激活, false:立即激活),可选
expiry_base?: ExpiryBase | null // 到期计时基准: from_activation(实名后开始计时) / from_purchase(购买即开始计时),可选
cost_price: number // 成本价(分),必填
suggested_retail_price?: number | null // 建议零售价(分),可选
}
@@ -174,7 +179,7 @@ export interface UpdatePackageRequest {
real_data_mb?: number | null // 真流量额度MB可选
virtual_data_mb?: number | null // 虚流量额度MB可选
enable_virtual_data?: boolean | null // 是否启用虚流量,可选
enable_realname_activation?: boolean | null // 是否启用实名激活,可选
expiry_base?: ExpiryBase | null // 到期计时基准,可选
cost_price?: number | null // 成本价(分),可选
suggested_retail_price?: number | null // 建议零售价(分),可选
}