zs 1 year ago
parent
commit
b38d4fc5d2

+ 2 - 0
src/controller/core/video.controller.ts

@@ -36,6 +36,8 @@ export class VideoController extends BaseController {
   @ApiResponse({ type: FVO_video })
   async fetch(@Param('id') id: string) {
     const data = await this.service.fetch(id);
+    // 加浏览量
+    await this.service.fetchBrowse(data);
     const result = new FVO_video(data);
     return result;
   }

+ 1 - 1
src/controller/system/config.controller.ts

@@ -18,7 +18,7 @@ export class ConfigController extends BaseController {
     const result = new CVO_config(dbData);
     return result;
   }
-  @Get('/')
+  @Get('/', { description: 'ignore' })
   @ApiQuery({ name: 'query' })
   @ApiResponse({ type: QVO_config })
   async query(@Query() filter: QDTO_config, @Query('skip') skip: number, @Query('limit') limit: number) {

+ 1 - 1
src/controller/system/dictData.controller.ts

@@ -18,7 +18,7 @@ export class DictDataController extends BaseController {
     const result = new CVO_dictData(dbData);
     return result;
   }
-  @Get('/')
+  @Get('/', { description: 'ignore' })
   @ApiQuery({ name: 'query' })
   @ApiResponse({ type: QVO_dictData })
   async query(@Query() filter: QDTO_dictData, @Query('skip') skip: number, @Query('limit') limit: number) {

+ 5 - 0
src/service/core/video.service.ts

@@ -8,4 +8,9 @@ type modelType = ReturnModelType<typeof Video>;
 export class VideoService extends BaseService<modelType> {
   @InjectEntityModel(Video)
   model: modelType;
+  // 加浏览量
+  async fetchBrowse(data) {
+    const { number, _id } = data;
+    await this.model.updateOne({ _id }, { number: number + 1 });
+  }
 }