using System; using System.Collections.Generic; using System.Threading.Tasks; using BaseInfoClient.Response.Manage; using Etor.Infrastructure.Common; using Etor.Infrastructure.Data; using Etor.Infrastructure.Serializer; using Etor.Infrastructure.WebApi; using Newtonsoft.Json; using ServiceClient; using System.Text; namespace BaseInfoClient.Extension { public static class QueryPermissionProjectByManagerIdResponse { public static async Task> QueryProjectCodeByManageId(this BaseInfoHttpClient client , int Id, bool throwException = false) { try { var response = await client.CreateHttpClient().GetAsync( $"{client.BaseUrl}/api/manage/v1/Manager/GetByManageId?ManagerId={Id}"); var content = await response.Content.ReadAsStringAsync(); var result = content.FromJsonTo>>(); return result.Data; } catch (Exception e) { LogHelper.Error("根据OwnerId获取住户", e); if (throwException) { BusinessException.Throw("获取住户信息失败"); } else { return new List(); } } return new List(); } } }