This commit is contained in:
“wanyongkang”
2020-12-28 14:55:48 +08:00
parent c2ec7392cb
commit 40a40b6d36
305 changed files with 20629 additions and 20629 deletions

View File

@@ -1,54 +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>();
}
}
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>();
}
}
}

View File

@@ -1,57 +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>();
}
}
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>();
}
}
}

View File

@@ -1,25 +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; }
}
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; }
}
}