| 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: Cfg cfg |
| 7 | */ |
| 8 | import { Controller, Get, Param } from '@nestjs/common'; |
| 9 | import { ApiOperation } from '@nestjs/swagger'; |
| 10 | import { ParamsValidationPipe } from 'src/validation.pipe'; |
| 11 | import { CfgService } from './cfg.service'; |
| 12 | import { CfgKeyDto } from './dto/cfg.dto'; |
| 13 | |
| 14 | @Controller('cfg') |
| 15 | export class CfgController { |
| 16 | constructor(private readonly bannerService: CfgService) {} |
| 17 | |
| 18 | @ApiOperation({ |
| 19 | description: '获取信息', |
| 20 | summary: '获取信息', |
| 21 | }) |
| 22 | @Get('info/:key') |
| 23 | async getInfoByKey(@Param(new ParamsValidationPipe()) param: CfgKeyDto) { |
| 24 | const res = await this.bannerService.getInfoByKey(param.key); |
| 25 | return res; |
| 26 | } |
| 27 | } |
| 28 |