'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 CollectsService extends CrudService { constructor(ctx) { super(ctx, 'collects'); this.model = this.ctx.model.Collects; } async secollects({ user_id, video_id }) { const data = await this.model.findOne({ user_id, video_id }); if (data) return { id: data._id, is: true }; return { is: false }; } } module.exports = CollectsService;