1234567891011121314151617181920212223242526 |
- 'use strict';
- // const assert = require('assert');
- // const _ = require('lodash');
- // const { ObjectId } = require('mongoose').Types;
- const { CrudService } = require('naf-framework-mongoose/lib/service');
- // const { BusinessError, ErrorCode } = require('naf-core').Error;
- class PersonroomService extends CrudService {
- constructor(ctx) {
- super(ctx, 'person_room_talk');
- this.model = this.ctx.model.Personroomtalk;
- }
- async delete(params) {
- const talk = await this.model.findOne({ pr_id: params.id });
- return talk.delete();
- }
- async countroom() {
- const total = await this.model.count();
- return total;
- }
- }
- module.exports = PersonroomService;
|