mirror of
https://github.com/silenty4ng/k5web
synced 2025-04-01 21:25:02 +00:00
56 lines
1.2 KiB
TypeScript
56 lines
1.2 KiB
TypeScript
import axios from 'axios';
|
|
import qs from 'query-string';
|
|
import type { DescData } from '@arco-design/web-vue/es/descriptions/interface';
|
|
|
|
export interface PolicyRecord {
|
|
id: string;
|
|
number: number;
|
|
name: string;
|
|
contentType: 'img' | 'horizontalVideo' | 'verticalVideo';
|
|
filterType: 'artificial' | 'rules';
|
|
count: number;
|
|
status: 'online' | 'offline';
|
|
createdTime: string;
|
|
}
|
|
|
|
export interface PolicyParams extends Partial<PolicyRecord> {
|
|
current: number;
|
|
pageSize: number;
|
|
}
|
|
|
|
export interface PolicyListRes {
|
|
list: PolicyRecord[];
|
|
total: number;
|
|
}
|
|
|
|
export function queryPolicyList(params: PolicyParams) {
|
|
return axios.get<PolicyListRes>('/api/list/policy', {
|
|
params,
|
|
paramsSerializer: (obj) => {
|
|
return qs.stringify(obj);
|
|
},
|
|
});
|
|
}
|
|
|
|
export interface ServiceRecord {
|
|
id: number;
|
|
title: string;
|
|
description: string;
|
|
name?: string;
|
|
actionType?: string;
|
|
icon?: string;
|
|
data?: DescData[];
|
|
enable?: boolean;
|
|
expires?: boolean;
|
|
}
|
|
export function queryInspectionList() {
|
|
return axios.get('/api/list/quality-inspection');
|
|
}
|
|
|
|
export function queryTheServiceList() {
|
|
return axios.get('/api/list/the-service');
|
|
}
|
|
|
|
export function queryRulesPresetList() {
|
|
return axios.get('/api/list/rules-preset');
|
|
}
|