feat: 设备详情

This commit is contained in:
许永平
2025-07-05 14:12:47 +08:00
parent c5c559f4ef
commit 87067011df
2 changed files with 872 additions and 4 deletions

View File

@@ -171,4 +171,30 @@ export const devicesApi = {
async checkStatus(ids: string[]): Promise<ApiResponse<Record<string, DeviceStatus>>> {
return post<ApiResponse<Record<string, DeviceStatus>>>(`${API_BASE}/status`, { deviceIds: ids });
},
// 获取设备关联的微信账号
async getRelatedAccounts(id: string | number): Promise<ApiResponse<any>> {
return get<ApiResponse<any>>(`/v1/wechats/related-device/${id}`);
},
// 获取设备操作记录
async getHandleLogs(id: string | number, page: number = 1, limit: number = 10): Promise<ApiResponse<any>> {
return get<ApiResponse<any>>(`/v1/devices/${id}/handle-logs?page=${page}&limit=${limit}`);
},
// 更新设备任务配置
async updateTaskConfig(config: {
deviceId: string | number;
autoAddFriend?: boolean;
autoReply?: boolean;
momentsSync?: boolean;
aiChat?: boolean;
}): Promise<ApiResponse<any>> {
return post<ApiResponse<any>>(`/v1/devices/task-config`, config);
},
// 获取设备任务配置
async getTaskConfig(id: string | number): Promise<ApiResponse<any>> {
return get<ApiResponse<any>>(`/v1/devices/${id}/task-config`);
},
};