notice.js 641 B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. const _ = require('lodash');
  3. const meta = require('./.notice.js');
  4. const Controller = require('egg').Controller;
  5. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  6. // 通知管理
  7. class NoticeController extends Controller {
  8. constructor(ctx) {
  9. super(ctx);
  10. this.service = this.ctx.service.notice;
  11. }
  12. async look() {
  13. const res = await this.service.look(this.ctx.request.body);
  14. this.ctx.ok({ data: res });
  15. }
  16. async index() {
  17. const data = await this.service.query(this.ctx.query);
  18. this.ctx.ok({ ...data });
  19. }
  20. }
  21. module.exports = CrudController(NoticeController, meta);