接口文件
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Etor.Infrastructure\Etor.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Net.Http;
|
||||
|
||||
namespace ServiceClient
|
||||
{
|
||||
public class BaseInfoHttpClient
|
||||
{
|
||||
private IHttpClientFactory _httpClientFactory;
|
||||
|
||||
internal static string _BaseUrl = "";
|
||||
|
||||
public string BaseUrl => _BaseUrl;
|
||||
|
||||
public BaseInfoHttpClient(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
}
|
||||
|
||||
public HttpClient CreateHttpClient()
|
||||
{
|
||||
return _httpClientFactory.CreateClient();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace ServiceClient
|
||||
{
|
||||
public static class IServiceCollectionExtension
|
||||
{
|
||||
public static void AddBaseInfoClient(this IServiceCollection service, string baseUrl)
|
||||
{
|
||||
BaseInfoHttpClient._BaseUrl = baseUrl;
|
||||
|
||||
service.AddSingleton<BaseInfoHttpClient>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ServiceClient.Response.Householder
|
||||
{
|
||||
public class HouseholderItem
|
||||
{
|
||||
[JsonProperty("ID")] public int UserId { get; set; }
|
||||
|
||||
[JsonProperty("name")] public string Name { get; set; } = "";
|
||||
|
||||
[JsonProperty("mobile")] public string Mobile { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Householder;
|
||||
|
||||
namespace ServiceClient.Response.Householder
|
||||
{
|
||||
|
||||
|
||||
public class QueryAllHouseholdersByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("userData")]
|
||||
public List<HouseholderItem> HouseholderItems { get; set; } = new List<HouseholderItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllHouseholdersByOwnerIdExtension
|
||||
{
|
||||
public static async Task<List<HouseholderItem>> QueryAllHouseholdersByOwnerId(this BaseInfoHttpClient client
|
||||
, int ownerId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBasePerson?OwnerID={ownerId}&Data.IsGetUser=true");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllHouseholdersByOwnerIdResponse>>().Data.HouseholderItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<HouseholderItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<HouseholderItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Householder;
|
||||
|
||||
namespace ServiceClient.Response.Householder
|
||||
{
|
||||
public class QueryHouseholderInfoByUserIdResponse
|
||||
{
|
||||
[JsonProperty("userData")] public HouseholderItem HouseholderItem { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryHouseholderInfoByUserIdExtension
|
||||
{
|
||||
public static async Task<HouseholderItem> QueryHouseholderInfoByUserId(this BaseInfoHttpClient client
|
||||
, int ownerId, int userId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBasePerson?OwnerID={ownerId}&Data.userId={userId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryHouseholderInfoByUserIdResponse>>().Data.HouseholderItem;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据UserId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new HouseholderItem();
|
||||
}
|
||||
}
|
||||
|
||||
return new HouseholderItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BaseInfoClient.Response.Manage
|
||||
{
|
||||
public class ManageItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 管理员id
|
||||
/// <summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// <summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// <summary>
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 删除标记
|
||||
/// <summary>
|
||||
public int DeleteTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属物业ID
|
||||
/// <summary>
|
||||
public int OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人ID
|
||||
/// <summary>
|
||||
public int UpdatorId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人ID
|
||||
/// <summary>
|
||||
public int CreatorId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管理员登录名[16
|
||||
/// </summary>
|
||||
public string LoginCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登录密码[20]
|
||||
/// </summary>
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联的内部人员id
|
||||
/// </summary>
|
||||
public int workerid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管理员角色
|
||||
/// </summary>
|
||||
public int roleid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public int state { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 头像地址[30
|
||||
/// </summary>
|
||||
public string photourl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信openid[50]
|
||||
/// </summary>
|
||||
public string wxopenid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信昵称
|
||||
/// </summary>
|
||||
public string wxnickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信头像
|
||||
/// </summary>
|
||||
public string wximage { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 注册来源
|
||||
/// </summary>
|
||||
public int source { get; set; }
|
||||
/// <summary>
|
||||
/// 系统ID
|
||||
/// </summary>
|
||||
public int systemid { get; set; }
|
||||
/// <summary>
|
||||
/// 管理员手机号
|
||||
/// </summary>
|
||||
public string Phone { get; set; }
|
||||
/// <summary>
|
||||
/// 账号code
|
||||
/// </summary>
|
||||
public string managercode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管理员姓名
|
||||
/// </summary>
|
||||
public string RealName { get; set; }
|
||||
/// <summary>
|
||||
/// 电子邮箱
|
||||
/// </summary>
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目关联
|
||||
/// </summary>
|
||||
public string ProjectContact { get; set; }
|
||||
|
||||
public bool IsIntegrator { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否主管理员权限
|
||||
/// </summary>
|
||||
public bool Isroot { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BaseInfoClient.Response.Manage
|
||||
{
|
||||
public class PermissionProjectByManagerItem
|
||||
{
|
||||
/// <summary>
|
||||
/// ID
|
||||
/// <summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属物业ID
|
||||
/// <summary>
|
||||
public int OwnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管理员数据库ID
|
||||
/// </summary>
|
||||
public int ManagerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目编码
|
||||
/// </summary>
|
||||
public int ProjectCode { get; set; }
|
||||
/// <summary>
|
||||
/// 小区名称
|
||||
/// </summary>
|
||||
public string ProjectName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
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<List<PermissionProjectByManagerItem>> 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<ApiResult<List<PermissionProjectByManagerItem>>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<PermissionProjectByManagerItem>();
|
||||
}
|
||||
}
|
||||
return new List<PermissionProjectByManagerItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BaseInfoClient.Response.Project
|
||||
{
|
||||
public class ProjectItem
|
||||
{
|
||||
[JsonProperty("projectCode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("name")] public string Name { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Ð¡ÇøµØÖ·
|
||||
/// </summary>
|
||||
[JsonProperty("location")] public string Location { get; set; } = "";
|
||||
|
||||
|
||||
[JsonProperty("projectType")] public int projectType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BaseInfoClient.Response.Project;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
|
||||
namespace BaseInfoClient.Response.Project
|
||||
{
|
||||
|
||||
|
||||
public class QueryAllProjectsByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("projectData")] public List<ProjectItem> ProjectItems { get; set; } = new List<ProjectItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllProjectsByOwnerIdExtension
|
||||
{
|
||||
public static async Task<List<ProjectItem>> QueryAllProjectsByOwnerIdAsync(this BaseInfoHttpClient client
|
||||
, int ownerId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBaseProject?OwnerID={ownerId}&Data.IsGetproject=true");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllProjectsByOwnerIdResponse>>().Data.ProjectItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取小区", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取小区信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<ProjectItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<ProjectItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BaseInfoClient.Response.Project;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
|
||||
namespace BaseInfoClient.Response.Project
|
||||
{
|
||||
public class QueryOneProjectByCodeResponse
|
||||
{
|
||||
[JsonProperty("projectData")] public ProjectItem ProjectItem { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryProjectByCodeResponseExtension
|
||||
{
|
||||
public static async Task<ProjectItem> QueryOneProjectByCodeAsync(this BaseInfoHttpClient client
|
||||
, int ownerId, int projectCode, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBaseProject?OwnerID={ownerId}&Data.projectCode={projectCode}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryOneProjectByCodeResponse>>().Data.ProjectItem;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据ProjectCode获取小区", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取小区信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ProjectItem();
|
||||
}
|
||||
}
|
||||
|
||||
return new ProjectItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ServiceClient.Response.PropertyEmployee
|
||||
{
|
||||
public class EmployeeItem
|
||||
{
|
||||
[JsonProperty("ID")] public int UserId { get; set; }
|
||||
|
||||
[JsonProperty("mobile")] public string Mobile { get; set; } = "";
|
||||
|
||||
[JsonProperty("name")] public string Name { get; set; } = "";
|
||||
|
||||
[JsonProperty("projectCode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("isInternal")] public bool IsInternal { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.PropertyEmployee;
|
||||
using ServiceClient.Response.User;
|
||||
|
||||
namespace ServiceClient.Response.PropertyEmployee
|
||||
{
|
||||
public class QueryAllEmployeesByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("staffData")]
|
||||
public List<EmployeeItem> EmployeeInfos { get; set; }=new List<EmployeeItem>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllEmployeesByOwnerIdResponseExtension
|
||||
{
|
||||
public static async Task<List<EmployeeItem>> QueryAllEmployeesByOwnerId(this BaseInfoHttpClient client
|
||||
, int ownerId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBasePerson?Data.IsGetSaff=true&OwnerID={ownerId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllEmployeesByOwnerIdResponse>>().Data.EmployeeInfos;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取物业员工",e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取员工信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<EmployeeItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<EmployeeItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.PropertyEmployee;
|
||||
using ServiceClient.Response.User;
|
||||
|
||||
namespace ServiceClient.Response.PropertyEmployee
|
||||
{
|
||||
|
||||
|
||||
public class QueryEmployeeInfoByUserIdResponse
|
||||
{
|
||||
[JsonProperty("staffData")] public EmployeeItem UserInfo { get; set; } = new EmployeeItem();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryEmployeeInfoByUserIdResponseExtension
|
||||
{
|
||||
public static async Task<EmployeeItem> QueryEmployeeInfoByUserId(this BaseInfoHttpClient client, int ownerId,
|
||||
int userId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBasePerson?Data.staffId={userId}&OwnerID={ownerId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryEmployeeInfoByUserIdResponse>>().Data.UserInfo;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据员工Id获取员工信息",e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取员工信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new EmployeeItem();
|
||||
}
|
||||
}
|
||||
|
||||
return new EmployeeItem();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Room;
|
||||
|
||||
namespace ServiceClient.Response.Room
|
||||
{
|
||||
public class QueryAllHouseholderRoomsByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("userToRoomData")]
|
||||
public List<UserRoomItem> UserRoomItems { get; set; } = new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryAllHouseholderRoomsByOwnerIdResponseExtension
|
||||
{
|
||||
public static async Task<List<UserRoomItem>> QueryAllHouseholderRoomsByOwnerId(this BaseInfoHttpClient client
|
||||
, int ownerId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBasePerson?Data.IsGetUserToRoom=true&OwnerID={ownerId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllHouseholderRoomsByOwnerIdResponse>>().Data.UserRoomItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据UserId获取用户房间信息", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取用户房间信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Room;
|
||||
|
||||
namespace ServiceClient.Response.Room
|
||||
{
|
||||
|
||||
|
||||
public class QueryHouseholderRoomsByUserIdResponse
|
||||
{
|
||||
[JsonProperty("userToRoomData")]
|
||||
public List<UserRoomItem> UserRoomItems { get; set; } = new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryHouseholderRoomsByUserIdExtension
|
||||
{
|
||||
public static async Task<List<UserRoomItem>> QueryHouseholderRoomsByUserId(this BaseInfoHttpClient client
|
||||
, int ownerId, int userId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBasePerson?Data.userToroomUserId={userId}&OwnerID={ownerId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryHouseholderRoomsByUserIdResponse>>().Data.UserRoomItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据UserId获取用户房间信息", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取用户房间信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<UserRoomItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ServiceClient.Response.Room
|
||||
{
|
||||
public class UserRoomItem
|
||||
{
|
||||
[JsonProperty("userId")] public int UserId { get; set; }
|
||||
|
||||
[JsonProperty("roomCode")] public string RoomCode { get; set; } = "";
|
||||
|
||||
[JsonProperty("deleteTag")] public int DeleteTag { get; set; }
|
||||
|
||||
[JsonProperty("state")] public int State { get; set; }
|
||||
|
||||
[JsonProperty("floor")] public int Floor { get; set; }
|
||||
|
||||
[JsonProperty("roomNo")] public string RoomNo { get; set; }
|
||||
|
||||
[JsonProperty("projectCode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("buildCode")] public string BuildCode { get; set; }
|
||||
|
||||
[JsonProperty("unit")] public string Unit { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.Householder;
|
||||
using ServiceClient.Response.User;
|
||||
|
||||
namespace ServiceClient.Response.User
|
||||
{
|
||||
public class QueryVisiterAndUserByWxOpenIdResponse
|
||||
{
|
||||
[JsonProperty("userData")]
|
||||
public HouseholderItem HouseholderItem { get; set; }
|
||||
|
||||
[JsonProperty("visterData")]
|
||||
public VisterItem VisterItem { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryVisiterAndUserByWxOpenIdResponseExtension
|
||||
{
|
||||
public static async Task<QueryVisiterAndUserByWxOpenIdResponse> QueryVisiterAndUserByWxOpenId(
|
||||
this BaseInfoHttpClient client, string openId,bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response =
|
||||
await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetUserVisterByOpenID?openId={openId}");
|
||||
//var response =
|
||||
// await client.CreateHttpClient().GetAsync(
|
||||
// $"https://localhost:44324/api/baseinfo/v1/BaseData/GetUserVisterByOpenID?openId={openId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryVisiterAndUserByWxOpenIdResponse>>().Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据openId查询用户",e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取用户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new QueryVisiterAndUserByWxOpenIdResponse();
|
||||
}
|
||||
}
|
||||
|
||||
return new QueryVisiterAndUserByWxOpenIdResponse();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
using ServiceClient.Response.User;
|
||||
|
||||
|
||||
namespace ServiceClient.Response.User
|
||||
{
|
||||
public class QueryVisterByVisterIdResponse
|
||||
{
|
||||
[JsonProperty("visterData")] public VisterItem VisterItem { get; set; } = new VisterItem();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryVisterByVisterIdResponseExtension
|
||||
{
|
||||
public static async Task<VisterItem> QueryVisterByVisterId(this BaseInfoHttpClient client, int ownerId,
|
||||
int visterId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetOneBasePerson?OwnerID={ownerId}&Data.visterId={visterId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryVisterByVisterIdResponse>>().Data.VisterItem;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据访客Id查询访客信息",e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取访客信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new VisterItem();
|
||||
}
|
||||
}
|
||||
|
||||
return new VisterItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ServiceClient.Response.User
|
||||
{
|
||||
public class VisterItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 邀请人姓名
|
||||
/// </summary>
|
||||
[JsonProperty("username")]
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客姓名
|
||||
/// </summary>
|
||||
[JsonProperty("visitorname")]
|
||||
public string VisitorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客电话
|
||||
/// </summary>
|
||||
[JsonProperty("visitorphone")]
|
||||
public string VisitorPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 20 前台登记 10 用户邀请 30 人脸访问 40员工端邀请
|
||||
/// </summary>
|
||||
[JsonProperty("visitortype")]
|
||||
public int VisitorType { get; set; }
|
||||
|
||||
[JsonProperty("openid")] public string OpenId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来访日期
|
||||
/// </summary>
|
||||
[JsonProperty("entrytime")]
|
||||
public DateTime EntryTime { get; set; }
|
||||
|
||||
[JsonProperty("expirytime")] public DateTime ExpiryTime { get; set; }
|
||||
|
||||
[JsonProperty("projectcode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("buildcode")] public string BuildCode { get; set; }
|
||||
|
||||
[JsonProperty("unit")] public string Unit { get; set; }
|
||||
|
||||
[JsonProperty("room")] public string Room { get; set; }
|
||||
|
||||
[JsonProperty("reason")] public string Reason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邀请函模板类型
|
||||
/// </summary>
|
||||
[JsonProperty("templatetype")]
|
||||
public int TemplateType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 10:申请中 20:申请通过 30: 黑名单用户 40:申请作废
|
||||
/// </summary>
|
||||
[JsonProperty("stats")]
|
||||
public int Stats { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客接受时间
|
||||
/// </summary>
|
||||
[JsonProperty("accepttime")]
|
||||
public DateTime AcceptTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[JsonProperty("bak")]
|
||||
public string Bak { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信头像
|
||||
/// </summary>
|
||||
[JsonProperty("wxImgUrl")]
|
||||
public string WxImgUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 人脸地址
|
||||
/// </summary>
|
||||
[JsonProperty("faceUrl")]
|
||||
public string FaceUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访客人员ID
|
||||
/// </summary>
|
||||
[JsonProperty("userId")]
|
||||
public System.Int32? UserId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("ID")]
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
using BaseInfoClient.Response.Visitor;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using ServiceClient;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QueryVisitorByOpenidOrId
|
||||
{
|
||||
public static async Task<List<VisitorResponseItem>> QueryVisitorByOpenId(this BaseInfoHttpClient client
|
||||
, QueryMenJinVisitorRequest param, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/visitor/v1/Request/QueryByOpenId?OwnerId={param.OwnerId}&Data.OpenId={param.OpenId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<List<VisitorResponseItem>>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<VisitorResponseItem>();
|
||||
}
|
||||
}
|
||||
return new List<VisitorResponseItem>();
|
||||
}
|
||||
|
||||
public static async Task<VisitorResponseItem> QueryVisitorById(this BaseInfoHttpClient client
|
||||
, QueryMenJinVisitorRequest param, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/visitor/v1/Request/QueryById?OwnerId={param.OwnerId}&Data.Id={param.Id}&Data.Type={param.Type}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<VisitorResponseItem>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new VisitorResponseItem();
|
||||
}
|
||||
}
|
||||
return new VisitorResponseItem();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据人脸ID获取访客信息
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="param"></param>
|
||||
/// <param name="throwException"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<VisitorResponseItem> QueryVisitorByFaceId(this BaseInfoHttpClient client
|
||||
, int ownerId,string faceId, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/visitor/v1/Request/QueryByFaceId?OwnerId={ownerId}&Data.FaceId={faceId}");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<VisitorResponseItem>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new VisitorResponseItem();
|
||||
}
|
||||
}
|
||||
return new VisitorResponseItem();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据人脸ID获取访客信息
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="param"></param>
|
||||
/// <param name="throwException"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<QueryDeviceByBuildResponse>> QueryVisitorProFace(this BaseInfoHttpClient client
|
||||
, int projectCode, string buildCode,string unit,int operaterID, int ownerID, bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/doorway/v1/device/GetFacesClient?OperaterID={operaterID}&OwnerID={ownerID}&Data.ProjectCode={projectCode}&Data.BuildCode={buildCode}&Data.Unit={unit}&Data.UserType=0");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
var result = content.FromJsonTo<ApiResult<List<QueryDeviceByBuildResponse>>>();
|
||||
return result.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取住户", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取住户设备信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<QueryDeviceByBuildResponse>();
|
||||
}
|
||||
}
|
||||
return new List<QueryDeviceByBuildResponse>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BaseInfoClient.Response.Visitor
|
||||
{
|
||||
public class VisitorResponseItem
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public DateTime ExpiryTime { get; set; }
|
||||
public DateTime EntryTime { get; set; }
|
||||
public string Unit { get; set; }
|
||||
public string BuildCode { get; set; }
|
||||
public int ProjectCode { get; set; }
|
||||
/// <summary>
|
||||
/// 10邀约 20申请
|
||||
/// </summary>
|
||||
public int Type { get; set; }
|
||||
public string Reason { get; set; }
|
||||
public string VisitorName { get; set; }
|
||||
/// <summary>
|
||||
/// 访客电话
|
||||
/// </summary>
|
||||
public string VisitorPhone { get; set; }
|
||||
public int CheckUserId { get; set; }
|
||||
/// <summary>
|
||||
/// 审核人姓名
|
||||
/// </summary>
|
||||
public string CheckUserName { get; set; }
|
||||
public string Room { get; set; }
|
||||
/// <summary>
|
||||
/// 状态 10 审核中 20 已通过 30 已拒绝
|
||||
/// </summary>
|
||||
public int State { get; set; }
|
||||
}
|
||||
public class QueryMenJinVisitorRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string OpenId { get; set; }
|
||||
public DateTime InTime { get; set; }
|
||||
/// <summary>
|
||||
/// 10 申请 20 邀约
|
||||
/// </summary>
|
||||
public int Type { get; set; }
|
||||
public int OwnerId { get; set; }
|
||||
}
|
||||
|
||||
public class QueryDeviceByBuildResponse
|
||||
{
|
||||
public string Ip { get; set; }
|
||||
public string PassWord { get; set; }
|
||||
public string DeviceNo { get; set; }
|
||||
public int Port { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BaseInfoClient.Response.Build
|
||||
{
|
||||
public class BuildItem
|
||||
{
|
||||
[JsonProperty("projectCode")] public int ProjectCode { get; set; }
|
||||
|
||||
[JsonProperty("buildCode")] public string BuildCode { get; set; } = "";
|
||||
|
||||
[JsonProperty("name")] public string Name { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BaseInfoClient.Response.Build;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Data;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceClient;
|
||||
|
||||
namespace BaseInfoClient.Response.Build
|
||||
{
|
||||
|
||||
|
||||
public class QueryAllBuildsByOwnerIdResponse
|
||||
{
|
||||
[JsonProperty("buildData")] public List<BuildItem> BuildItems { get; set; } = new List<BuildItem>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace BaseInfoClient.Extension
|
||||
{
|
||||
public static class QuerAllyBuildsByOwnerIdExtension
|
||||
{
|
||||
public static async Task<List<BuildItem>> QueryAllBuildsByOwnerIdAsync(this BaseInfoHttpClient client, int ownerId,
|
||||
bool throwException = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.CreateHttpClient().GetAsync(
|
||||
$"{client.BaseUrl}/api/baseinfo/v1/BaseData/GetAllBaseProject?OwnerID={ownerId}&Data.IsGetBuild=true");
|
||||
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return content.FromJsonTo<ApiResult<QueryAllBuildsByOwnerIdResponse>>().Data.BuildItems;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("根据OwnerId获取楼宇", e);
|
||||
|
||||
if (throwException)
|
||||
{
|
||||
BusinessException.Throw("获取楼宇信息失败");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<BuildItem>();
|
||||
}
|
||||
}
|
||||
|
||||
return new List<BuildItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user