import { Controller, Get, Inject, Query } from '@midwayjs/decorator'; import { ApiResponse, ApiTags } from '@midwayjs/swagger'; import { ToolService } from '../service/tool.service'; @ApiTags(['工具']) @Controller('/tool') export class ToolController { @Inject() service: ToolService; @Get('/getTotal') @ApiResponse({}) async getTotal(@Query() filter) { const result = await this.service.getTotal(filter); return result; } @Get('/query') @ApiResponse({}) async query(@Query() filter) { const result = await this.service.query(filter); return result; } @Get('/CollectionTotal') @ApiResponse({}) async getCollectionTotal() { const result = await this.service.getCollectionTotal(); return result; } @Get('/MyCollection') @ApiResponse({}) async MyCollection(@Query() filter) { const result = await this.service.getCollection(filter); return result; } }