ec-nest/src/dicts/dicts.controller.ts
liuyun 73ed067a82 feat: dict-driven enums — built-in dicts + protection + aggregate query
- dict_type/dict_item 增加 built_in/color_type 字段与唯一约束
- seed 预置 5 个内置枚举字典(幂等)
- 内置类型/项删除与内置项 value 修改保护
- 新增 GET /dicts 聚合接口(登录态)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 14:29:18 +08:00

14 lines
391 B
TypeScript

import { Controller, Get } from '@nestjs/common';
import { DictsService } from './dicts.service.js';
/** 字典聚合接口:前端登录后一次性拉取全部启用字典(仅登录态,无需权限码)。 */
@Controller('dicts')
export class DictsController {
constructor(private readonly service: DictsService) {}
@Get()
all() {
return this.service.allEnabled();
}
}