sysDictController.js 564 B

123456789101112131415161718192021222324
  1. 'use strict';
  2. const Controller = require('../extend/baseController');
  3. class SysDictController extends Controller {
  4. tag() {
  5. return this.ctx.service.sysDictService;
  6. }
  7. async listForPageSortAsc() {
  8. const { ctx } = this;
  9. ctx.setOrder();
  10. const result = await this.tag().listForPage(ctx.query);
  11. ctx.success(result);
  12. }
  13. async deleteWithSub() {
  14. const { ctx } = this;
  15. const result = await this.tag().deleteWithSub(ctx.query.id);
  16. ctx.logic(result, '删除失败,该字典存在下级');
  17. }
  18. }
  19. module.exports = SysDictController;