Add monitoring service and database schema
- Implement monitoring service with heartbeat, lease tasks, resume tasks, and task result handling. - Create monitoring time utilities for business date calculations. - Add unit tests for date window resolution and business day handling. - Define database schema for monitoring-related tables including quotas, daily reports, and task management. - Establish migration scripts for creating and dropping monitoring tables.
This commit is contained in:
@@ -32,6 +32,9 @@ import type {
|
||||
LoginRequest,
|
||||
LoginResponse,
|
||||
MediaPlatform,
|
||||
MonitoringCollectNowResponse,
|
||||
MonitoringDashboardCompositeResponse,
|
||||
MonitoringQuestionDetailResponse,
|
||||
PlatformAccount,
|
||||
PublishRecord,
|
||||
RegisterPluginInstallationRequest,
|
||||
@@ -549,6 +552,40 @@ export const mediaApi = {
|
||||
},
|
||||
};
|
||||
|
||||
export const monitoringApi = {
|
||||
dashboardComposite(params: {
|
||||
brand_id?: number;
|
||||
keyword_id?: number | null;
|
||||
days?: number;
|
||||
business_date?: string;
|
||||
}) {
|
||||
return apiClient.get<MonitoringDashboardCompositeResponse>("/api/tenant/monitoring/dashboard/composite", {
|
||||
params,
|
||||
});
|
||||
},
|
||||
questionDetail(
|
||||
brandId: number,
|
||||
questionId: number,
|
||||
params: {
|
||||
date_from?: string;
|
||||
date_to?: string;
|
||||
question_hash?: string;
|
||||
ai_platform_id?: string;
|
||||
},
|
||||
) {
|
||||
return apiClient.get<MonitoringQuestionDetailResponse>(
|
||||
`/api/tenant/monitoring/brands/${brandId}/questions/${questionId}/detail`,
|
||||
{ params },
|
||||
);
|
||||
},
|
||||
collectNow(brandId: number, payload?: { keyword_id?: number | null }) {
|
||||
return apiClient.post<MonitoringCollectNowResponse, { keyword_id?: number | null }>(
|
||||
`/api/tenant/monitoring/brands/${brandId}/collect-now`,
|
||||
payload ?? {},
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export const promptRulesApi = {
|
||||
list(params?: PromptRuleListParams) {
|
||||
return apiClient.get<PromptRuleListResponse>("/api/tenant/prompt-rules", { params });
|
||||
|
||||
Reference in New Issue
Block a user