CarouselController.ts
1.67 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
57
58
59
60
61
62
63
import { AxiosResponse, AxiosStatic } from "axios";
import dayjs, { Dayjs } from "dayjs";
// region 前端扩展导入包
import { Carousel } from "lib/src/entity/business/entity/Carousel";
import { Page } from "autumn-vue/lib/core/page/Page";
// endregion
/**
* 轮播图(Carousel) PI接口
* @author gonglei
* @since 2025-10-13 12:18:11
*/
export class CarouselController {
/**
* 新增轮播图
* @param carousel
* @return Carousel
*/
static addCarousel(axios: AxiosStatic, carousel: any): Promise<AxiosResponse<Carousel>> {
return axios.post("carousel/addCarousel", carousel);
}
/**
* 根据id查询轮播图
* @param carouselId
* @return Carousel
*/
static getCarouselById(axios: AxiosStatic, carouselId: number): Promise<AxiosResponse<Carousel>> {
return axios.get("carousel/getCarouselById", { params: { carouselId: carouselId } });
}
/**
* 分页查询轮播图
* @param pagination
* @return Page
*/
static pageCarousel(axios: AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Carousel>>> {
return axios.post("carousel/pageCarousel", pagination);
}
static PAGE_CAROUSEL = "carousel/pageCarousel";
/**
* 删除轮播图
* @param carouselId
* @return int
*/
static removeCarouselById(axios: AxiosStatic, carouselId: number): Promise<AxiosResponse<number>> {
return axios.delete("carousel/removeCarouselById", { params: { carouselId: carouselId } });
}
/**
* 修改轮播图
* @param carousel
* @return Carousel
*/
static updateCarousel(axios: AxiosStatic, carousel: any): Promise<AxiosResponse<Carousel>> {
return axios.post("carousel/updateCarousel", carousel);
}
// region 前端扩展代码区
// endregion
}