config.js 346 B

12345678910111213141516
  1. 'use strict';
  2. const { CrudService } = require('naf-framework-mongoose/lib/service');
  3. // 配置表
  4. class ConfigService extends CrudService {
  5. constructor(ctx) {
  6. super(ctx, 'config');
  7. this.model = this.ctx.model.Config;
  8. }
  9. async getOne({ type }) {
  10. return await this.model.findOne({ type });
  11. }
  12. }
  13. module.exports = ConfigService;