init: AI培训与智能巡检系统
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Param,
|
||||
ParseIntPipe,
|
||||
Query,
|
||||
} from '@nestjs/common';
|
||||
import { ModelsService } from './models.service';
|
||||
import { QueryModelsDto } from './query-models.dto';
|
||||
|
||||
@Controller('api/models')
|
||||
export class ModelsController {
|
||||
constructor(private readonly models: ModelsService) {}
|
||||
|
||||
@Get()
|
||||
list(@Query() query: QueryModelsDto) {
|
||||
return this.models.list(query);
|
||||
}
|
||||
|
||||
@Get('families')
|
||||
families(@Query('category') category?: string) {
|
||||
return this.models.families(category);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
detail(@Param('id', ParseIntPipe) id: number) {
|
||||
return this.models.getById(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user