server: add POST bounds get method by list of ids

This commit is contained in:
2025-09-24 11:12:59 +09:00
parent 83b94126fc
commit bf3638f1d5
2 changed files with 56 additions and 1 deletions

View File

@ -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)