nestjs rewrite

This commit is contained in:
popovspiridon99
2025-08-01 11:33:40 +09:00
parent 145827ab6d
commit 37bfa912a0
58 changed files with 17130 additions and 0 deletions

View File

@ -0,0 +1,42 @@
import { Controller, Get, Param, ParseIntPipe, Query } from '@nestjs/common';
import { GisService } from './gis.service';
@Controller('gis')
export class GisController {
constructor(private readonly gisService: GisService) { }
@Get('/type-roles')
async getTypeRoles() {
return await this.gisService.getTypeRoles()
}
@Get('/bounds/:entity_type')
async getBoundsByEntityType(@Param('entity_type') entity_type: 'region' | 'district' | 'city') {
return await this.gisService.getBoundsByEntityType(entity_type)
}
@Get('/bounds/:entity_type/:entity_id')
async getBoundsByEntityTypeAndId(@Param('entity_type') entity_type: 'region' | 'district' | 'city', @Param('entity_id', new ParseIntPipe()) entity_id: number) {
return await this.gisService.getBoundsByEntityTypeAndId(entity_type, entity_id)
}
@Get('/images/all')
async getImages(@Query('offset') offset: number, @Query('limit') limit: number, @Query('city_id') city_id: number) {
return await this.gisService.getImages(offset, limit, city_id)
}
@Get('/figures/all')
async getFigures(@Query('offset') offset: number, @Query('limit') limit: number, @Query('year') year: number, @Query('city_id') city_id: number) {
return await this.gisService.getFigures(offset, limit, year, city_id)
}
@Get('/lines/all')
async getLines(@Query('year') year: number, @Query('city_id') city_id: number) {
return await this.gisService.getLines(year, city_id)
}
@Get('/regions/borders')
async getRegionBorders() {
return await this.gisService.getRegionBorders()
}
}