subject.js 680 B

12345678910111213141516171819202122232425
  1. 'use strict';
  2. const assert = require('assert');
  3. const _ = require('lodash');
  4. const { ObjectId } = require('mongoose').Types;
  5. const { CrudService } = require('naf-framework-mongoose/lib/service');
  6. const { BusinessError, ErrorCode } = require('naf-core').Error;
  7. class SubjectService extends CrudService {
  8. constructor(ctx) {
  9. super(ctx, 'subject');
  10. this.model = this.ctx.model.Subject;
  11. }
  12. // async create(data) {
  13. // const { code, name } = data;
  14. // assert(code && name, '缺少部分信息项');
  15. // const newdata = data;
  16. // newdata.passwd = { secret: passwd };
  17. // return await this.model.create(newdata);
  18. // }
  19. }
  20. module.exports = SubjectService;