初始提交
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
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;
|
||||
|
||||
namespace BaseInfoClient.Response.Manage
|
||||
{
|
||||
|
||||
}
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllManageByOwnerIdResponse
|
||||
{
|
||||
public static async Task<ManageItem> QueryManageById(this BaseInfoHttpClient client
|
||||
, int Id, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/manage/v1/Manager/GetOneManage?Id={Id}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<ManageItem>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ManageItem();
|
||||
}
|
||||
}
|
||||
return new ManageItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user