wangzhibo
2026-07-16 bac4362a0b7726d38a23d38f0d7913f2c2bab262
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
import { Body, Get, Inject, Post, Provide } from '@midwayjs/core';
import {
  CoolController,
  BaseController,
  CoolUrlTag,
  TagTypes,
  CoolTag,
} from '@cool-midway/core';
import { DictInfoService } from '../../service/info';
 
/**
 * 字典信息
 */
@Provide()
@CoolController()
@CoolUrlTag()
export class AppDictInfoController extends BaseController {
  @Inject()
  dictInfoService: DictInfoService;
 
  @CoolTag(TagTypes.IGNORE_TOKEN)
  @Post('/data', { summary: '获得字典数据' })
  async data(@Body('types') types: string[] = []) {
    return this.ok(await this.dictInfoService.data(types));
  }
 
  @CoolTag(TagTypes.IGNORE_TOKEN)
  @Get('/types', { summary: '获得所有字典类型' })
  async types() {
    return this.ok(await this.dictInfoService.types());
  }
}