123456789101112131415161718192021222324252627282930 |
- import { Controller, Get, Inject } from '@midwayjs/core';
- import { StatisticsService } from '../../service/core/statistics.service';
- import { RF } from '../../response/CustomerResponse';
- import { Page, Query } from '../../decorator/page.decorator';
- @Controller('/statistics')
- export class StatisticsController {
- @Inject()
- service: StatisticsService;
- // 资源统计
- @Get('/resource')
- async resource(@Query() query, @Page() page) {
- const result = await this.service.resource(query, page);
- return RF.success(result);
- }
- // 作业统计
- @Get('/work')
- async work(@Query() query, @Page() page) {
- const result = await this.service.work(query, page);
- return RF.success(result);
- }
- // 用户统计
- @Get('/user')
- async user(@Query() query, @Page() page) {
- const result = await this.service.user(query, page);
- return RF.success(result);
- }
- }
|