1234567891011121314151617181920 |
- '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;
|