util.js 703 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. class UtilService extends CrudService {
  7. constructor(ctx) {
  8. super(ctx, 'util');
  9. }
  10. async index() {
  11. // const res = await this.app.mysql.select('jcc_activities_times', {});
  12. const res = await this.ctx.service.mysql.query('jcc_activities_times');
  13. // const res = await this.app.mysql.insert('jcc_activities_times', { id: '123321123', title: '测试2', start_time: '2022-02-01', end_time: '2022-02-20', is_open: 0 });
  14. return res;
  15. }
  16. }
  17. module.exports = UtilService;