忽略
This commit is contained in:
@@ -1,18 +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; }
|
||||
}
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -1,55 +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>();
|
||||
}
|
||||
}
|
||||
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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +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();
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user