public static CreateMapPoiResultJson CreateMapPoi(string accessTokenOrAppId, CreateMapPoiData data, int timeOut = Config.TIME_OUT) { return(ApiHandlerWapper.TryCommonApi(accessToken => { var urlFormat = string.Format(Config.ApiMpHost + "/wxa/create_map_poi?access_token={0}", accessToken.AsUrlData()); return CommonJsonSend.Send <CreateMapPoiResultJson>(null, urlFormat, data, timeOut: timeOut); }, accessTokenOrAppId)); }
/// <summary> /// 在腾讯地图中创建门店 /// </summary> /// <param name="accessTokenOrAppId">AccessToken或AppId(推荐使用AppId,需要先注册)</param> /// <param name="data">门店数据</param> /// <param name="timeout">请求超时时长</param> /// <returns></returns> public static CreateMapPoiJsonResult CreateMapPoi(string accessTokenOrAppId, CreateMapPoiData data, int timeout = Config.TIME_OUT) { return(ApiHandlerWapper.TryCommonApi(accessToken => { string urlFormat = Config.ApiMpHost + "/wxa/create_map_poi?access_token={0}"; return CommonJsonSend.Send <CreateMapPoiJsonResult>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeout); }, accessTokenOrAppId)); }
/// <summary> /// 【异步方法】在腾讯地图中创建门店 /// </summary> /// <param name="accessTokenOrAppId">AccessToken或AppId(推荐使用AppId,需要先注册)</param> /// <param name="data">门店数据</param> /// <param name="timeout">请求超时时长</param> /// <returns></returns> public static async Task <CreateMapPoiJsonResult> CreateMapPoiAsync(string accessTokenOrAppId, CreateMapPoiData data, int timeout = Config.TIME_OUT) { return(await ApiHandlerWapper.TryCommonApiAsync(async accessToken => { var url = string.Format(Config.ApiMpHost + "/wxa/create_map_poi?access_token={0}", accessToken.AsUrlData()); return await CommonJsonSend.SendAsync <CreateMapPoiJsonResult>(null, url, data, CommonJsonSendType.POST, timeout) .ConfigureAwait(false); }, accessTokenOrAppId).ConfigureAwait(false)); }