/* * @author wuweiru * @date 2020/12/08 15:02 */ import { TowifyClient } from './towify.client'; import { MapPoiSearchResponseType, MapRecodingResponseType } from '../../module/map/type/map.type'; export enum MapMicroserviceFunction { getRecodingData = 'MapService:getRecodingData', getPointOfInterestData = 'MapService:getPointOfInterestData' } export class MapMicroserviceHandler { public static async getRecodingData(params: { location: string; radius: string; }): Promise { const result = await TowifyClient.getInstance().sendMessage< MapRecodingResponseType[], { location: string; radius: string; } >(MapMicroserviceFunction.getRecodingData, params); return result; } public static async getPointOfInterestData(params: { keywords: string; city: string; offset: string; page: string; }): Promise { const result = await TowifyClient.getInstance().sendMessage< MapPoiSearchResponseType[], { keywords: string; city: string; offset: string; page: string; } >(MapMicroserviceFunction.getPointOfInterestData, params); return result; } }