ApproveController.ts
1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { AxiosResponse, AxiosStatic } from "axios";
import dayjs, { Dayjs } from "dayjs";
import { DateCount } from "lib/src/entity/analysis/domain/DateCount";
// region 前端扩展导入包
import { ApproveHistory } from "lib/src/entity/track/entity/ApproveHistory";
import { ApproveView } from "lib/src/entity/track/entity/ApproveView";
// endregion
/**
*/
export const ApproveController = {
/**
*/
getApproveHistoriesByApproveId(
axios: AxiosStatic,
approveType: any,
approveId: number,
): Promise<AxiosResponse<ApproveHistory[]>> {
return axios.get("approve/getApproveHistoriesByApproveId", {
params: { approveType, approveId },
});
},
/**
*/
getApproveViewCount(axios: AxiosStatic): Promise<AxiosResponse<number>> {
return axios.get("approve/getApproveViewCount");
},
/**
*/
getApproveViewsCountByDate(axios: AxiosStatic, date: Dayjs | string): Promise<AxiosResponse<DateCount[]>> {
if (date instanceof Object) {
date = dayjs(date).format("YYYY-MM-DD");
}
return axios.get("approve/getApproveViewsCountByDate", { params: { date } });
},
/**
*/
getLastApproveViews(
axios: AxiosStatic,
date: Dayjs | null | string | undefined,
): Promise<AxiosResponse<ApproveView[]>> {
if (date instanceof Object) {
date = dayjs(date).format("YYYY-MM-DD");
}
return axios.get("approve/getLastApproveViews", { params: { date } });
},
// region 前端扩展代码区
// endregion
};