FavoriteController.ts
1.53 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
56
import {AxiosResponse, AxiosStatic} from 'axios';
import dayjs,{Dayjs} from 'dayjs';
// region 前端扩展导入包
import {Favorite} from "lib/src/entity/account/entity/Favorite";
import {Page} from "autumn-vue/lib/core/page/Page";
// endregion
/**
* 收藏(Favorite) PI接口
* @author gonglei
* @since 2025-10-13 12:18:11
*/
export class FavoriteController{
/**
* 根据id查询收藏
* @param aucvehId
* @return int
*/
static getFavoriteCountByAucvehId(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<number>> {
return axios.get('favorite/getFavoriteCountByAucvehId', {params: {aucvehId: aucvehId}});
}
/**
* 分页查询收藏
* @param pagination
* @return Page
*/
static pageFavorite(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Favorite>>> {
return axios.post('favorite/pageFavorite', pagination);
}
static PAGE_FAVORITE = 'favorite/pageFavorite';
/**
* 删除收藏
* @param aucvehId
* @return int
*/
static removeFavoriteById(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<number>> {
return axios.delete('favorite/removeFavoriteById', {params: {aucvehId: aucvehId}});
}
/**
* 新增收藏
* @param aucvehId
* @return boolean
*/
static toggleFavorite(axios:AxiosStatic, aucvehId: number): Promise<AxiosResponse<boolean>> {
return axios.post('favorite/toggleFavorite', null, {params: {aucvehId: aucvehId}});
}
// region 前端扩展代码区
// endregion
}