config.js 482 B

12345678910111213141516171819
  1. 'use strict';
  2. const { CrudService } = require('naf-framework-mongoose-free/lib/service');
  3. const { BusinessError, ErrorCode } = require('naf-core').Error;
  4. const _ = require('lodash');
  5. const assert = require('assert');
  6. //
  7. class ConfigService extends CrudService {
  8. constructor(ctx) {
  9. super(ctx, 'config');
  10. this.model = this.ctx.model.System.Config;
  11. }
  12. async query() {
  13. const data = await this.model.findOne({});
  14. return data;
  15. }
  16. }
  17. module.exports = ConfigService;