返回 AiToEarn
banner.controller.ts
根目录 / project / aitoearn-electron / server / src / modules / operate / banner.controller.ts
1 /*
2 * @Author: nevin
3 * @Date: 2024-06-17 19:19:20
4 * @LastEditTime: 2025-03-03 18:45:45
5 * @LastEditors: nevin
6 * @Description: banner Banner
7 */
8 import { Controller, Get, Param, Query } from '@nestjs/common';
9 import { ApiOperation } from '@nestjs/swagger';
10 import { ParamsValidationPipe } from 'src/validation.pipe';
11 import { BannerService } from './banner.service';
12 import { AppGetBannerListDto, BannerIdDto } from './dto/banner.dto';
13
14 @Controller('banner')
15 export class BannerController {
16 constructor(private readonly bannerService: BannerService) {}
17 @ApiOperation({
18 description: '获取信息',
19 summary: '获取信息',
20 })
21 @Get('info/:id')
22 async getBannerInfoById(
23 @Param(new ParamsValidationPipe()) param: BannerIdDto,
24 ) {
25 const res = await this.bannerService.getBannerInfo(param.id);
26 return res;
27 }
28
29 @ApiOperation({
30 description: '获取列表',
31 summary: '获取列表',
32 })
33 @Get('list')
34 getMineBannerList(
35 @Query(new ParamsValidationPipe()) query: AppGetBannerListDto,
36 ) {
37 return this.bannerService.getBannerAll(query.tag);
38 }
39 }
40
40 lines TYPESCRIPT