| 1 | /* |
| 2 | * @Author: nevin |
| 3 | * @Date: 2024-06-17 19:19:20 |
| 4 | * @LastEditTime: 2025-05-06 14:10:25 |
| 5 | * @LastEditors: nevin |
| 6 | * @Description: Tracing tracing |
| 7 | */ |
| 8 | import { Body, Controller, Get, Post } from '@nestjs/common'; |
| 9 | import { TracingService } from './tracing.service'; |
| 10 | import { Manager } from 'src/auth/manager.guard'; |
| 11 | import { TracingTimeDto } from './dto/tracing.dto'; |
| 12 | |
| 13 | @Manager() |
| 14 | @Controller('admin/tracing') |
| 15 | export class TracingAdminController { |
| 16 | constructor(private readonly tracingService: TracingService) {} |
| 17 | |
| 18 | // 账号总数 |
| 19 | @Get('count/account') |
| 20 | async getTracingAccountCount() { |
| 21 | const res = await this.tracingService.getTracingAccountCount(); |
| 22 | return res; |
| 23 | } |
| 24 | |
| 25 | // 时间段内发视频的用户总数 |
| 26 | @Post('video/user/count') |
| 27 | async getTracingVideoUserCount(@Body() body: TracingTimeDto) { |
| 28 | const res = await this.tracingService.getTracingVideoUserCount(body.time); |
| 29 | return res; |
| 30 | } |
| 31 | |
| 32 | // 时间段内发视频的总数 |
| 33 | @Post('video/count') |
| 34 | async getTracingVideoCount(@Body() body: TracingTimeDto) { |
| 35 | const res = await this.tracingService.getTracingVideoCount(body.time); |
| 36 | return res; |
| 37 | } |
| 38 | |
| 39 | // 时间段内开源项目调用总数 |
| 40 | @Post('openProject/count') |
| 41 | async getTracingOpenProjectCount(@Body() body: TracingTimeDto) { |
| 42 | const res = await this.tracingService.getTracingOpenProjectCount(body.time); |
| 43 | return res; |
| 44 | } |
| 45 | } |
| 46 |