server: add POST bounds get method by list of ids
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import { Controller, Get, Param, ParseIntPipe, Query } from '@nestjs/common';
|
||||
import { Body, Controller, Get, Param, ParseIntPipe, Post, Query } from '@nestjs/common';
|
||||
import { GisService } from './gis.service';
|
||||
import { ApiBody } from '@nestjs/swagger';
|
||||
import { BoundsRequestDto } from './dto/bound';
|
||||
|
||||
@Controller('gis')
|
||||
export class GisController {
|
||||
@ -20,6 +22,15 @@ export class GisController {
|
||||
return await this.gisService.getBoundsByEntityTypeAndId(entity_type, entity_id)
|
||||
}
|
||||
|
||||
@Post('/bounds/:entity_type')
|
||||
@ApiBody({ type: BoundsRequestDto })
|
||||
async getBoundsByEntityTypeAndList(
|
||||
@Param('entity_type') entity_type: 'region' | 'district' | 'city',
|
||||
@Body('list') list: number[],
|
||||
) {
|
||||
return await this.gisService.getBoundsByEntityTypeAndList(entity_type, list);
|
||||
}
|
||||
|
||||
@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)
|
||||
|
Reference in New Issue
Block a user