'use strict'; const { CrudService } = require('naf-framework-mongoose-free/lib/service'); const { BusinessError, ErrorCode } = require('naf-core').Error; const _ = require('lodash'); const assert = require('assert'); // 初始化 class InstallService extends CrudService { constructor(ctx) { super(ctx, 'install'); } async index() { const config = await this.ctx.model.Config.findOne(); if (config) return; await this.ctx.model.Config.create({ proportion: [], exam_proportion: [] }); } } module.exports = InstallService;