company.js 766 B

123456789101112131415161718192021222324252627282930
  1. 'use strict';
  2. const _ = require('lodash');
  3. const meta = require('./.company.js');
  4. const Controller = require('egg').Controller;
  5. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  6. // 管理
  7. class CompanyController extends Controller {
  8. constructor(ctx) {
  9. super(ctx);
  10. this.service = this.ctx.service.company;
  11. }
  12. // 更新其他信息
  13. async updateotherinfo() {
  14. const res = await this.service.updateotherinfo(this.ctx.params, this.ctx.request.body);
  15. this.ctx.ok({ data: res });
  16. }
  17. // 删除其他信息
  18. async deleteotherinfo() {
  19. await this.service.deleteotherinfo(this.ctx.params, this.ctx.request.body);
  20. this.ctx.ok({ msg: 'deleted' });
  21. }
  22. }
  23. module.exports = CrudController(CompanyController, meta);