21 lines
533 B
TypeScript
21 lines
533 B
TypeScript
import { Controller, Get, Query } from '@nestjs/common';
|
|
import { FeatureQuery, GeonameQuery } from './geonames.interfaces';
|
|
import { GeonamesService } from './geonames.service';
|
|
|
|
@Controller({
|
|
path: 'geonames',
|
|
})
|
|
export class GeonamesController {
|
|
constructor(private readonly service: GeonamesService) {}
|
|
|
|
@Get()
|
|
async search(@Query() query: GeonameQuery) {
|
|
return this.service.search(query);
|
|
}
|
|
|
|
@Get('features')
|
|
async features(@Query() query: FeatureQuery) {
|
|
return this.service.getFeatureList(query);
|
|
}
|
|
}
|