egg-ts-decorator
插件安装
npm i egg-ts-decorator --save
依赖说明
依赖的 egg 版本
egg-ts-decorator 版本 | egg 1.x |
---|---|
1.x | 😁 |
0.x | ❌ |
依赖的插件
- lodash
开启插件
// config/plugin.jsexportsdecorators = enable: true package: 'egg-ts-decorator';
使用场景
- 支持定义声明路由
; // 声明restful路由 // 声明具体路由
- 支持规则校验
;
- 支持传入前置中间件,比如想针对接口进行权限校验,日志记录等等
; // config/config.default.ts ; config =
详细配置
请到 config/config.default.js 查看详细配置项说明。
单元测试
npm run test
提问交流
请到 egg issues 异步交流。