去除引用common.props
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using Aop.Api;
|
||||
using Aop.Api;
|
||||
using Aop.Api.Request;
|
||||
using Aop.Api.Response;
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using System.Net;
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using System.Net;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using Newtonsoft.Json;
|
||||
using DingTalk.Api;
|
||||
using DingTalk.Api.Response;
|
||||
using DingTalk.Api.Request;
|
||||
using JNPF.Common.Security;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using System.Text;
|
||||
using System.Security.Cryptography;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using JNPF.Common.Security;
|
||||
using System.Web;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using System.Web;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
@@ -71,7 +71,7 @@ public class HuaweiAuthRequest : DefaultAuthRequest
|
||||
authUser.nickname = userObj.getString("userName");
|
||||
authUser.gender = gender;
|
||||
authUser.avatar = userObj.getString("headPictureURL");
|
||||
|
||||
|
||||
authUser.token = authToken;
|
||||
authUser.source = source.getName();
|
||||
authUser.originalUser = userObj;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
@@ -136,7 +136,7 @@ public class MicrosoftAuthRequest : DefaultAuthRequest
|
||||
*
|
||||
* @param authToken 用户授权后的token
|
||||
* @return 返回获取userInfo的url
|
||||
*/
|
||||
*/
|
||||
protected override string userInfoUrl(AuthToken authToken)
|
||||
{
|
||||
return UrlBuilder.fromBaseUrl(source.userInfo()).build();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
@@ -74,7 +74,7 @@ public class TeambitionAuthRequest : DefaultAuthRequest
|
||||
return authUser;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override AuthResponse refresh(AuthToken oldToken)
|
||||
{
|
||||
string uid = oldToken.uid;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ public class WeChatEnterpriseAuthRequest : DefaultAuthRequest
|
||||
{
|
||||
}
|
||||
|
||||
public WeChatEnterpriseAuthRequest(ClientConfig config, IAuthStateCache authStateCache)
|
||||
public WeChatEnterpriseAuthRequest(ClientConfig config, IAuthStateCache authStateCache)
|
||||
: base(config, new WechatEnterpriseAuthSource(), authStateCache)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class WeChatEnterpriseScanAuthRequest : DefaultAuthRequest
|
||||
authUser.location = userDetailObj.getString("address");
|
||||
authUser.email = userDetailObj.getString("email");
|
||||
authUser.uuid = userDetailObj.getString("userId");
|
||||
if(authUser.uuid.IsNullOrWhiteSpace()) authUser.uuid = userDetailObj.getString("userid");
|
||||
if (authUser.uuid.IsNullOrWhiteSpace()) authUser.uuid = userDetailObj.getString("userid");
|
||||
authUser.token = authToken;
|
||||
authUser.source = source.getName();
|
||||
authUser.gender = GlobalAuthUtil.getWechatRealGender(userDetailObj.getString("gender"));
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
@@ -12,7 +12,7 @@ public partial class WeChatOpenAuthRequest : DefaultAuthRequest
|
||||
{
|
||||
}
|
||||
|
||||
public WeChatOpenAuthRequest(ClientConfig config, IAuthStateCache authStateCache)
|
||||
public WeChatOpenAuthRequest(ClientConfig config, IAuthStateCache authStateCache)
|
||||
: base(config, new WechatOpenAuthSource(), authStateCache)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Cache;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Request;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class WeiboAuthRequest : DefaultAuthRequest
|
||||
reqParams.Add("API-RemoteIP", "application/x-www-form-urlencoded");
|
||||
|
||||
string response = HttpUtils.RequestGet(userInfoUrl(authToken), reqParams);
|
||||
|
||||
|
||||
var userObj = response.parseObject();
|
||||
if (userObj.ContainsKey("error"))
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Specialized;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Utils;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace JNPF.Extras.CollectiveOAuth.Utils;
|
||||
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.Common.Core.EventBus.Constants
|
||||
namespace Tnb.Common.Core.EventBus.Constants
|
||||
{
|
||||
public class EventSubscribeEventConsts
|
||||
{
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JNPF.EventBus;
|
||||
using SqlSugar;
|
||||
using JNPF.EventBus;
|
||||
|
||||
namespace Tnb.Common.Core.EventBus.Sources
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Channels;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.Logging;
|
||||
using RabbitMQ.Client;
|
||||
using RabbitMQ.Client.Events;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Channels;
|
||||
|
||||
namespace JNPF.EventHandler;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using JNPF.Common.Const;
|
||||
using System.Security.Claims;
|
||||
using JNPF.Common.Const;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Net;
|
||||
using JNPF.Common.Security;
|
||||
@@ -8,9 +9,8 @@ using JNPF.EventBus;
|
||||
using JNPF.EventHandler;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Logging.Attributes;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using SqlSugar;
|
||||
|
||||
namespace JNPF.Common.Core.Filter;
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
using JNPF.Common.Const;
|
||||
using System.Diagnostics;
|
||||
using System.Security.Claims;
|
||||
using JNPF.Common.Const;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Net;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DataEncryption;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.EventHandler;
|
||||
using JNPF.Logging;
|
||||
using JNPF.Logging.Attributes;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using System.Diagnostics;
|
||||
using System.Security.Claims;
|
||||
using SqlSugar;
|
||||
using Microsoft.AspNetCore.Mvc.Controllers;
|
||||
using JNPF.Logging;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using SqlSugar;
|
||||
|
||||
namespace JNPF.Common.Core.Filter;
|
||||
|
||||
|
||||
@@ -339,50 +339,50 @@ public class DataBaseManager : IDataBaseManager, ITransient
|
||||
|
||||
//try
|
||||
//{
|
||||
int total = 0;
|
||||
int total = 0;
|
||||
|
||||
if (_sqlSugarClient.CurrentConnectionConfig.DbType == SqlSugar.DbType.Oracle) strSql = strSql.Replace(";", string.Empty);
|
||||
if (_sqlSugarClient.CurrentConnectionConfig.DbType == SqlSugar.DbType.Oracle) strSql = strSql.Replace(";", string.Empty);
|
||||
|
||||
var sidx = pageInput.sidx.IsNotEmptyOrNull() && pageInput.sort.IsNotEmptyOrNull(); // 按前端参数排序
|
||||
var defaultSidx = columnDesign.defaultSidx.IsNotEmptyOrNull() && columnDesign.sort.IsNotEmptyOrNull(); // 按模板默认排序
|
||||
var sidx = pageInput.sidx.IsNotEmptyOrNull() && pageInput.sort.IsNotEmptyOrNull(); // 按前端参数排序
|
||||
var defaultSidx = columnDesign.defaultSidx.IsNotEmptyOrNull() && columnDesign.sort.IsNotEmptyOrNull(); // 按模板默认排序
|
||||
|
||||
var dataRuleJson = new List<IConditionalModel>();
|
||||
if (pageInput.dataRuleJson.IsNotEmptyOrNull()) dataRuleJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.dataRuleJson);
|
||||
var dataRuleJson = new List<IConditionalModel>();
|
||||
if (pageInput.dataRuleJson.IsNotEmptyOrNull()) dataRuleJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.dataRuleJson);
|
||||
|
||||
var querJson = new List<IConditionalModel>();
|
||||
if (pageInput.queryJson.IsNotEmptyOrNull()) querJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.queryJson);
|
||||
var querJson = new List<IConditionalModel>();
|
||||
if (pageInput.queryJson.IsNotEmptyOrNull()) querJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.queryJson);
|
||||
|
||||
var superQueryJson = new List<IConditionalModel>();
|
||||
if (pageInput.superQueryJson.IsNotEmptyOrNull()) superQueryJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.superQueryJson);
|
||||
// var sql = _sqlSugarClient.SqlQueryable<object>(strSql)
|
||||
// .Where(dataRuleJson).Where(querJson).Where(superQueryJson).Where(dataPermissions).ToSqlString();
|
||||
DataTable dt = _sqlSugarClient.SqlQueryable<object>(strSql)
|
||||
.Where(dataRuleJson).Where(querJson).Where(superQueryJson).Where(dataPermissions)
|
||||
.OrderByIF(sidx, pageInput.sidx + " " + pageInput.sort).OrderByIF(!sidx && defaultSidx, columnDesign.defaultSidx + " " + columnDesign.sort)
|
||||
.ToDataTablePage(pageInput.currentPage, pageInput.pageSize, ref total);
|
||||
var superQueryJson = new List<IConditionalModel>();
|
||||
if (pageInput.superQueryJson.IsNotEmptyOrNull()) superQueryJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.superQueryJson);
|
||||
// var sql = _sqlSugarClient.SqlQueryable<object>(strSql)
|
||||
// .Where(dataRuleJson).Where(querJson).Where(superQueryJson).Where(dataPermissions).ToSqlString();
|
||||
DataTable dt = _sqlSugarClient.SqlQueryable<object>(strSql)
|
||||
.Where(dataRuleJson).Where(querJson).Where(superQueryJson).Where(dataPermissions)
|
||||
.OrderByIF(sidx, pageInput.sidx + " " + pageInput.sort).OrderByIF(!sidx && defaultSidx, columnDesign.defaultSidx + " " + columnDesign.sort)
|
||||
.ToDataTablePage(pageInput.currentPage, pageInput.pageSize, ref total);
|
||||
|
||||
// 如果有字段别名 替换 ColumnName
|
||||
if (outColumnName != null && outColumnName.Count > 0)
|
||||
// 如果有字段别名 替换 ColumnName
|
||||
if (outColumnName != null && outColumnName.Count > 0)
|
||||
{
|
||||
var resultKey = string.Empty;
|
||||
for (var i = 0; i < dt.Columns.Count; i++)
|
||||
dt.Columns[i].ColumnName = outColumnName.TryGetValue(dt.Columns[i].ColumnName.ToUpper(), out resultKey) == true ? outColumnName[dt.Columns[i].ColumnName.ToUpper()] : dt.Columns[i].ColumnName.ToUpper();
|
||||
}
|
||||
|
||||
var data = new PageResult<Dictionary<string, object>>()
|
||||
{
|
||||
pagination = new PageResult()
|
||||
{
|
||||
var resultKey = string.Empty;
|
||||
for (var i = 0; i < dt.Columns.Count; i++)
|
||||
dt.Columns[i].ColumnName = outColumnName.TryGetValue(dt.Columns[i].ColumnName.ToUpper(), out resultKey) == true ? outColumnName[dt.Columns[i].ColumnName.ToUpper()] : dt.Columns[i].ColumnName.ToUpper();
|
||||
}
|
||||
currentPage = pageInput.currentPage,
|
||||
pageSize = pageInput.pageSize,
|
||||
total = total
|
||||
},
|
||||
list = dt.ToObject<List<Dictionary<string, string>>>().ToObject<List<Dictionary<string, object>>>()
|
||||
};
|
||||
|
||||
var data = new PageResult<Dictionary<string, object>>()
|
||||
{
|
||||
pagination = new PageResult()
|
||||
{
|
||||
currentPage = pageInput.currentPage,
|
||||
pageSize = pageInput.pageSize,
|
||||
total = total
|
||||
},
|
||||
list = dt.ToObject<List<Dictionary<string, string>>>().ToObject<List<Dictionary<string, object>>>()
|
||||
};
|
||||
_sqlSugarClient.ChangeDatabase(_connectionStrings.ConfigId);
|
||||
|
||||
_sqlSugarClient.ChangeDatabase(_connectionStrings.ConfigId);
|
||||
|
||||
return data;
|
||||
return data;
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
@@ -456,15 +456,15 @@ public class DataBaseManager : IDataBaseManager, ITransient
|
||||
_sqlSugarClient.ChangeDatabase(_connectionStrings.ConfigId);
|
||||
return list.Adapt<List<DbTableFieldModel>>();
|
||||
}
|
||||
|
||||
public List<string> GetPrimaries(DbLinkEntity? link, string tableName)
|
||||
|
||||
public List<string> GetPrimaries(DbLinkEntity? link, string tableName)
|
||||
{
|
||||
if (link != null && _sqlSugarClient.CurrentConnectionConfig.ConfigId != link.Id)
|
||||
_sqlSugarClient = ChangeDataBase(link);
|
||||
_sqlSugarClient = ChangeDataBase(link);
|
||||
|
||||
var data = _sqlSugarClient.DbMaintenance.GetPrimaries(tableName);
|
||||
_sqlSugarClient.ChangeDatabase(_connectionStrings.ConfigId);
|
||||
return data;
|
||||
_sqlSugarClient.ChangeDatabase(_connectionStrings.ConfigId);
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -597,7 +597,7 @@ public class DataBaseManager : IDataBaseManager, ITransient
|
||||
//var modelList = _sqlSugarClient.Ado.SqlQuery<DynamicDbTableModel>(sql).ToList();
|
||||
var modelList = _sqlSugarClient.Ado.SqlQuery<DatabaseTableListOutput>(sql).ToList();
|
||||
//return modelList.Select(x => new DatabaseTableListOutput { table = x.F_TABLE, tableName = x.F_TABLENAME, sum = x.F_SUM.ParseToInt() }).ToList();
|
||||
_sqlSugarClient.ChangeDatabase(_connectionStrings.ConfigId);
|
||||
_sqlSugarClient.ChangeDatabase(_connectionStrings.ConfigId);
|
||||
return modelList;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ public interface IDataBaseManager
|
||||
/// </summary>
|
||||
/// <param name="tableName">表名.</param>
|
||||
/// <param name="tableFieldList">表字段集合.</param>
|
||||
void AddTableColumn(DbLinkEntity link ,string tableName, List<DbTableFieldModel> tableFieldList);
|
||||
void AddTableColumn(DbLinkEntity link, string tableName, List<DbTableFieldModel> tableFieldList);
|
||||
|
||||
/// <summary>
|
||||
/// 删除表.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text;
|
||||
using JNPF.Common.Configuration;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
@@ -321,7 +320,8 @@ namespace JNPF.Common.Core.Manager.Files
|
||||
var stream = new MemoryStream(byteList);
|
||||
await UploadFileByType(stream, _filePath, _fileName);
|
||||
_cacheManager.Set(_fileName, string.Empty);
|
||||
return new {
|
||||
return new
|
||||
{
|
||||
name = _fileName,
|
||||
url = string.Format("/api/file/Download?encryption={0}", DESCEncryption.Encrypt(string.Format("{0}|{1}|json", _userManager.UserId, _fileName), "JNPF"))
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using JNPF.Common.Const;
|
||||
using System.Security.Claims;
|
||||
using JNPF.Common.Const;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Manager;
|
||||
@@ -14,7 +15,6 @@ using JNPF.Systems.Entitys.System;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using SqlSugar;
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace JNPF.Common.Core.Manager;
|
||||
|
||||
|
||||
@@ -1,22 +1,4 @@
|
||||
using JNPF.Common.Const;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Manager;
|
||||
using JNPF.Common.Models.Authorize;
|
||||
using JNPF.Common.Models.User;
|
||||
using JNPF.Common.Net;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DataEncryption;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.Systems.Entitys.Entity.Permission;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using SqlSugar;
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace JNPF.Common.Core.Manager;
|
||||
namespace JNPF.Common.Core.Manager;
|
||||
|
||||
/// <summary>
|
||||
/// 用户管理 .
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Reflection;
|
||||
using JNPF.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using System.Reflection;
|
||||
|
||||
namespace JNPF.Common.Cache;
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ public class RedisCache : ICache, ISingleton
|
||||
}
|
||||
public Task<string> GetHash(string key, string field)
|
||||
{
|
||||
return RedisHelper.HGetAsync(key, field);
|
||||
return RedisHelper.HGetAsync(key, field);
|
||||
}
|
||||
public Task<bool> HashExist(string key, string field)
|
||||
{
|
||||
@@ -238,6 +238,6 @@ public class RedisCache : ICache, ISingleton
|
||||
}
|
||||
public Task<bool> HSet(string key, string field, string value)
|
||||
{
|
||||
return RedisHelper.HSetAsync(key, field,value);
|
||||
return RedisHelper.HSetAsync(key, field, value);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Common.Const;
|
||||
using JNPF.Common.Manager;
|
||||
using System.Runtime.InteropServices;
|
||||
using JNPF.Common.Const;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Manager;
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Runtime.InteropServices;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace JNPF.Common.Captcha.General;
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JNPF.Common.Security;
|
||||
using SqlSugar;
|
||||
using SqlSugar;
|
||||
|
||||
namespace JNPF.Common.Contracts;
|
||||
|
||||
@@ -16,6 +10,6 @@ public class BaseEntity<TKey> : IEntity where TKey : IEquatable<TKey>
|
||||
[SugarColumn(ColumnName = "id", ColumnDescription = "主键", IsPrimaryKey = true)]
|
||||
public TKey id { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using JNPF.Common.Const;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.Extras.DatabaseAccessor.SqlSugar.Models;
|
||||
using SqlSugar;
|
||||
|
||||
namespace JNPF.Common.Contracts;
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using JetBrains.Annotations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Tnb.Common;
|
||||
@@ -159,11 +156,11 @@ public static class Check
|
||||
short value,
|
||||
string parameterName)
|
||||
{
|
||||
if(value == 0)
|
||||
if (value == 0)
|
||||
{
|
||||
throw new ArgumentException($"{parameterName} is equal to zero");
|
||||
}
|
||||
else if(value < 0)
|
||||
else if (value < 0)
|
||||
{
|
||||
throw new ArgumentException($"{parameterName} is less than zero");
|
||||
}
|
||||
@@ -251,7 +248,7 @@ public static class Check
|
||||
Int16 minimumValue,
|
||||
Int16 maximumValue = Int16.MaxValue)
|
||||
{
|
||||
if(value < minimumValue || value > maximumValue)
|
||||
if (value < minimumValue || value > maximumValue)
|
||||
{
|
||||
throw new ArgumentException($"{parameterName} is out of range min: {minimumValue} - max: {maximumValue}");
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace JNPF.Common.Dtos.VisualDev;
|
||||
/// 在线功能开发数据创建输入.
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public class VisualDevModelDataCrInput: FlowTaskOtherModel
|
||||
public class VisualDevModelDataCrInput : FlowTaskOtherModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Enums;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Enums;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Enums;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Enums;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Enums;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Enums;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Enums;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Enums;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Enums;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public enum RequestType
|
||||
/// POST请求.
|
||||
/// </summary>
|
||||
Run = 2,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 本地方法
|
||||
/// </summary>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Dynamic;
|
||||
using System.Reflection;
|
||||
using JNPF.DependencyInjection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace JNPF.Common.Extension;
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Tnb.Common.Extension
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Reflection;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Extension;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Concurrent;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Extension;
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Text;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Extension;
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace JNPF.Common.Extension
|
||||
{
|
||||
@@ -55,7 +50,7 @@ namespace JNPF.Common.Extension
|
||||
var castPropertyValue = Expression.Convert(propertyValue, property!.PropertyType);
|
||||
var assignExp = Expression.Assign(propExp, castPropertyValue);
|
||||
|
||||
return Expression.Lambda<Action<T, object>>(assignExp, new[] { target,propertyValue }).Compile();
|
||||
return Expression.Lambda<Action<T, object>>(assignExp, new[] { target, propertyValue }).Compile();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Text;
|
||||
using System.Text;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Extension;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Text;
|
||||
using System.Text;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Extension;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Text.Json;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Extension;
|
||||
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.Common.Extension
|
||||
namespace Tnb.Common.Extension
|
||||
{
|
||||
public static class TaskEx
|
||||
{
|
||||
@@ -25,7 +19,7 @@ namespace Tnb.Common.Extension
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
public static async Task<T> Retry<T>(Func<Task<T>> task, int retries,
|
||||
public static async Task<T> Retry<T>(Func<Task<T>> task, int retries,
|
||||
TimeSpan delay, CancellationToken cts = default) =>
|
||||
await task().ContinueWith(async innerTask =>
|
||||
{
|
||||
@@ -40,7 +34,7 @@ namespace Tnb.Common.Extension
|
||||
|
||||
|
||||
|
||||
public static async Task Catch(this Task task, Func<Exception,Task> exceptionHandler)
|
||||
public static async Task Catch(this Task task, Func<Exception, Task> exceptionHandler)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using JNPF.Common.Extension;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
|
||||
namespace System;
|
||||
|
||||
@@ -188,7 +187,7 @@ public static class StringExtensions
|
||||
public static (string, string) LastSplit(this string str, char seperate)
|
||||
{
|
||||
int n = str.LastIndexOf(seperate);
|
||||
if(n > 0)
|
||||
if (n > 0)
|
||||
{
|
||||
return (str.Substring(0, n), str.Substring(n + 1));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Drawing;
|
||||
using System.Drawing;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Models.NPOI;
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using NPOI.SS.Formula.Functions;
|
||||
|
||||
namespace JNPF.Common.Models;
|
||||
namespace JNPF.Common.Models;
|
||||
|
||||
/// <summary>
|
||||
/// 通用登录配置-第三方登录配置.
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
namespace JNPF.Common.Net;
|
||||
namespace JNPF.Common.Net;
|
||||
|
||||
public interface IUserAgent
|
||||
{
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Swashbuckle.AspNetCore.SwaggerUI;
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using Aspose.Cells;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.ConfigurableOptions;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using JNPF.ConfigurableOptions;
|
||||
|
||||
namespace JNPF.Common.Options;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.ConfigurableOptions;
|
||||
using JNPF.ConfigurableOptions;
|
||||
|
||||
namespace JNPF.Common.Options;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using JNPF.Common.Configuration;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Models.NPOI;
|
||||
using JNPF.DataEncryption;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Data;
|
||||
using JNPF.DependencyInjection;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using NPOI.SS.UserModel;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using System.Data;
|
||||
|
||||
namespace JNPF.Common.Helper
|
||||
{
|
||||
@@ -10,7 +10,7 @@ namespace JNPF.Common.Helper
|
||||
/// Excel导入操作类
|
||||
/// 版 本:V3.2.0
|
||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
||||
/// 日 期:2017.03.12.
|
||||
/// 日 期:2017.03.12.
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public class ExcelImportHelper
|
||||
@@ -108,7 +108,7 @@ namespace JNPF.Common.Helper
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
dataRow[j] = cell.ToString()?.Trim();
|
||||
dataRow[j] = cell.ToString()?.Trim();
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -134,7 +134,7 @@ namespace JNPF.Common.Helper
|
||||
sheet = null;
|
||||
}
|
||||
#region 清除最后的空行
|
||||
for (int i = table.Rows.Count-1; i >= 0; i--)
|
||||
for (int i = table.Rows.Count - 1; i >= 0; i--)
|
||||
{
|
||||
bool isnull = true;
|
||||
for (int j = 0; j < table.Columns.Count; j++)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using JNPF.Common.Configuration;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Models;
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Drawing;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using JNPF.Common.Configuration;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Models;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Security;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.JsonSerialization;
|
||||
using JNPF.RemoteRequest.Extensions;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
|
||||
@@ -108,16 +108,16 @@ public class PinyinHelper
|
||||
|
||||
#region 汉字转换成全拼的拼音
|
||||
|
||||
/// <summary>
|
||||
/// 汉字转换成全拼的拼音.
|
||||
/// </summary>
|
||||
/// <param name="Chstr"></param>
|
||||
/// <returns></returns>
|
||||
public static string Pinyin(string Chstr)
|
||||
{
|
||||
// 定义拼音区编码数组
|
||||
int[] getValue = new int[]
|
||||
/// <summary>
|
||||
/// 汉字转换成全拼的拼音.
|
||||
/// </summary>
|
||||
/// <param name="Chstr"></param>
|
||||
/// <returns></returns>
|
||||
public static string Pinyin(string Chstr)
|
||||
{
|
||||
// 定义拼音区编码数组
|
||||
int[] getValue = new int[]
|
||||
{
|
||||
-20319, -20317, -20304, -20295, -20292, -20283, -20265, -20257, -20242, -20230, -20051, -20036,
|
||||
-20032, -20026, -20002, -19990, -19986, -19982, -19976, -19805, -19784, -19775, -19774, -19763,
|
||||
-19756, -19751, -19746, -19741, -19739, -19728, -19725, -19715, -19540, -19531, -19525, -19515,
|
||||
@@ -151,11 +151,11 @@ public class PinyinHelper
|
||||
-11055, -11052, -11045, -11041, -11038, -11024, -11020, -11019, -11018, -11014, -10838, -10832,
|
||||
-10815, -10800, -10790, -10780, -10764, -10587, -10544, -10533, -10519, -10331, -10329, -10328,
|
||||
-10322, -10315, -10309, -10307, -10296, -10281, -10274, -10270, -10262, -10260, -10256, -10254
|
||||
};
|
||||
};
|
||||
|
||||
// 定义拼音数组
|
||||
string[] getName = new string[]
|
||||
{
|
||||
// 定义拼音数组
|
||||
string[] getName = new string[]
|
||||
{
|
||||
"A", "Ai", "An", "Ang", "Ao", "Ba", "Bai", "Ban", "Bang", "Bao", "Bei", "Ben",
|
||||
"Beng", "Bi", "Bian", "Biao", "Bie", "Bin", "Bing", "Bo", "Bu", "Ba", "Cai", "Can",
|
||||
"Cang", "Cao", "Ce", "Ceng", "Cha", "Chai", "Chan", "Chang", "Chao", "Che", "Chen", "Cheng",
|
||||
@@ -189,7 +189,7 @@ public class PinyinHelper
|
||||
"Za", "Zai", "Zan", "Zang", "Zao", "Ze", "Zei", "Zen", "Zeng", "Zha", "Zhai", "Zhan",
|
||||
"Zhang", "Zhao", "Zhe", "Zhen", "Zheng", "Zhi", "Zhong", "Zhou", "Zhu", "Zhua", "Zhuai", "Zhuan",
|
||||
"Zhuang", "Zhui", "Zhun", "Zhuo", "Zi", "Zong", "Zou", "Zu", "Zuan", "Zui", "Zun", "Zuo"
|
||||
};
|
||||
};
|
||||
|
||||
// 验证是否输入汉字
|
||||
Regex reg = new Regex("^[\u4e00-\u9fa5]$");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Data;
|
||||
using System.Data;
|
||||
using System.Reflection;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Security;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using JNPF.Common.Cache;
|
||||
using JNPF.Common.Const;
|
||||
using JNPF.FriendlyException;
|
||||
using Yitter.IdGenerator;
|
||||
|
||||
namespace JNPF.Common.Security;
|
||||
@@ -11,56 +9,56 @@ namespace JNPF.Common.Security;
|
||||
/// </summary>
|
||||
public class SnowflakeIdHelper
|
||||
{
|
||||
// 定义dll路径
|
||||
public const string RegWorkerId_DLL_NAME = "lib\\regworkerid_lib_v1.3.1\\yitidgengo.dll";
|
||||
// 定义dll路径
|
||||
public const string RegWorkerId_DLL_NAME = "lib\\regworkerid_lib_v1.3.1\\yitidgengo.dll";
|
||||
|
||||
// 根据文档定义三个接口
|
||||
// 根据文档定义三个接口
|
||||
|
||||
// 注册一个 WorkerId,会先注销所有本机已注册的记录
|
||||
// ip: redis 服务器地址
|
||||
// port: redis 端口
|
||||
// password: redis 访问密码,可为空字符串“”
|
||||
// maxWorkerId: 最大 WorkerId
|
||||
[DllImport(RegWorkerId_DLL_NAME, EntryPoint = "RegisterOne", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
private static extern ushort RegisterOne(string ip, int port, string password, int maxWorkerId);
|
||||
// 注册一个 WorkerId,会先注销所有本机已注册的记录
|
||||
// ip: redis 服务器地址
|
||||
// port: redis 端口
|
||||
// password: redis 访问密码,可为空字符串“”
|
||||
// maxWorkerId: 最大 WorkerId
|
||||
[DllImport(RegWorkerId_DLL_NAME, EntryPoint = "RegisterOne", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
private static extern ushort RegisterOne(string ip, int port, string password, int maxWorkerId);
|
||||
|
||||
// 注销本机已注册的 WorkerId
|
||||
[DllImport(RegWorkerId_DLL_NAME, EntryPoint = "UnRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
private static extern void UnRegister();
|
||||
// 注销本机已注册的 WorkerId
|
||||
[DllImport(RegWorkerId_DLL_NAME, EntryPoint = "UnRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
private static extern void UnRegister();
|
||||
|
||||
// 检查本地WorkerId是否有效(0-有效,其它-无效)
|
||||
[DllImport(RegWorkerId_DLL_NAME, EntryPoint = "Validate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
private static extern int Validate(int workerId);
|
||||
// 检查本地WorkerId是否有效(0-有效,其它-无效)
|
||||
[DllImport(RegWorkerId_DLL_NAME, EntryPoint = "Validate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
private static extern int Validate(int workerId);
|
||||
|
||||
/// <summary>
|
||||
/// 初始化YitId配置
|
||||
/// </summary>
|
||||
public static void InitYitIdWorker()
|
||||
{
|
||||
//var option = new IdGeneratorOptions
|
||||
//{
|
||||
// WorkerId = 1, //必须 全局唯一,必须 程序设定,理论最大值 2^WorkerIdBitLength-1
|
||||
// //BaseTime = new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), //用生成ID时的系统时间与基础时间的差值(毫秒数)作为生成ID的时间戳
|
||||
// WorkerIdBitLength = 16, //机器码位长,决定 WorkerId 的最大值,默认值6,取值范围 [1, 16]
|
||||
// //SeqBitLength = 4, //序列数位长,默认值6,取值范围 [3, 21](建议不小于4),决定每毫秒基础生成的ID个数
|
||||
// //MinSeqNumber = 5, //最小序列数,默认值5,取值范围 [5, MaxSeqNumber]
|
||||
// //MaxSeqNumber 最大序列数,设置范围 [MinSeqNumber, 2^SeqBitLength-1],默认值0
|
||||
//};
|
||||
var option = App.GetConfig<IdGeneratorOptions>("YitId");
|
||||
if (option.WorkerId == 0)
|
||||
/// <summary>
|
||||
/// 初始化YitId配置
|
||||
/// </summary>
|
||||
public static void InitYitIdWorker()
|
||||
{
|
||||
CacheOptions _cacheOptions = App.GetConfig<CacheOptions>("Cache", true);
|
||||
option.WorkerId = RegisterOne(_cacheOptions.ip, _cacheOptions.port, _cacheOptions.password, 63);
|
||||
//var option = new IdGeneratorOptions
|
||||
//{
|
||||
// WorkerId = 1, //必须 全局唯一,必须 程序设定,理论最大值 2^WorkerIdBitLength-1
|
||||
// //BaseTime = new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), //用生成ID时的系统时间与基础时间的差值(毫秒数)作为生成ID的时间戳
|
||||
// WorkerIdBitLength = 16, //机器码位长,决定 WorkerId 的最大值,默认值6,取值范围 [1, 16]
|
||||
// //SeqBitLength = 4, //序列数位长,默认值6,取值范围 [3, 21](建议不小于4),决定每毫秒基础生成的ID个数
|
||||
// //MinSeqNumber = 5, //最小序列数,默认值5,取值范围 [5, MaxSeqNumber]
|
||||
// //MaxSeqNumber 最大序列数,设置范围 [MinSeqNumber, 2^SeqBitLength-1],默认值0
|
||||
//};
|
||||
var option = App.GetConfig<IdGeneratorOptions>("YitId");
|
||||
if (option.WorkerId == 0)
|
||||
{
|
||||
CacheOptions _cacheOptions = App.GetConfig<CacheOptions>("Cache", true);
|
||||
option.WorkerId = RegisterOne(_cacheOptions.ip, _cacheOptions.port, _cacheOptions.password, 63);
|
||||
}
|
||||
YitIdHelper.SetIdGenerator(option);
|
||||
}
|
||||
YitIdHelper.SetIdGenerator(option);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成ID.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string NextId()
|
||||
{
|
||||
return YitIdHelper.NextId().ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// 生成ID.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string NextId()
|
||||
{
|
||||
return YitIdHelper.NextId().ToString();
|
||||
}
|
||||
}
|
||||
@@ -8,17 +8,17 @@ namespace Tnb.Common.Utils
|
||||
{
|
||||
return objectType == typeof(DateTime);
|
||||
}
|
||||
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
TypeCode typeCode = Type.GetTypeCode(reader.Value.GetType());
|
||||
if (typeCode == TypeCode.DateTime)
|
||||
return reader.Value;
|
||||
|
||||
|
||||
var t = long.Parse((string)(reader.Value.ToString()));
|
||||
return new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(t);
|
||||
}
|
||||
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.Common.Utils
|
||||
{
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JNPF.Common.Contracts;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
|
||||
namespace Tnb.Common.Utils
|
||||
namespace Tnb.Common.Utils
|
||||
{
|
||||
/// <summary>
|
||||
/// 迪杰斯特拉(最短路径算法)
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Reflection;
|
||||
using System.Security.Policy;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using JNPF.Logging;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
using Newtonsoft.Json;
|
||||
@@ -130,7 +122,7 @@ namespace Tnb.Common.Utils
|
||||
}
|
||||
|
||||
|
||||
public static async Task<string> PostStreamAsync(string url,object content, CancellationToken cancellationToken)
|
||||
public static async Task<string> PostStreamAsync(string url, object content, CancellationToken cancellationToken)
|
||||
{
|
||||
using (var client = new HttpClient())
|
||||
using (var request = new HttpRequestMessage(HttpMethod.Post, url))
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.Common.Utils
|
||||
namespace Tnb.Common.Utils
|
||||
{
|
||||
public class PropertyNotNullChecker<T>
|
||||
{
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.Common.Utils
|
||||
namespace Tnb.Common.Utils
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class SkipNormalizationAttribute : Attribute
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JNPF.SpecificationDocument;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Tnb.Common.Utils
|
||||
namespace Tnb.Common.Utils
|
||||
{
|
||||
//public class SkipNormalizationAttributeConventionalRegistrar : IConventionalRegistrar
|
||||
//{
|
||||
|
||||
@@ -5,133 +5,133 @@ namespace System;
|
||||
|
||||
public static class ThrowIf
|
||||
{
|
||||
public static void When(bool isMatch, string msg)
|
||||
{
|
||||
if (isMatch)
|
||||
public static void When(bool isMatch, string msg)
|
||||
{
|
||||
throw new ArgumentException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
public static T IsNull<T>([NotNull] T? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw string.IsNullOrEmpty(msg) ? new ArgumentNullException(paraName) : new ArgumentException(msg);
|
||||
if (isMatch)
|
||||
{
|
||||
throw new ArgumentException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static T IsNullOrDefault<T>([NotNull] T? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null) where T : struct
|
||||
{
|
||||
if (!value.HasValue || value.Value.Equals(default(T)))
|
||||
public static T IsNull<T>([NotNull] T? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null)
|
||||
{
|
||||
throw string.IsNullOrEmpty(msg) ? new ArgumentException("值不可为空或默认值", paraName) : new ArgumentException(msg);
|
||||
if (value == null)
|
||||
{
|
||||
throw string.IsNullOrEmpty(msg) ? new ArgumentNullException(paraName) : new ArgumentException(msg);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
return value.Value;
|
||||
}
|
||||
|
||||
|
||||
public static string IsNullOrWhiteSpace([NotNull] string? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
public static T IsNullOrDefault<T>([NotNull] T? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null) where T : struct
|
||||
{
|
||||
throw string.IsNullOrEmpty(msg) ? new ArgumentException("值不可为空或空格", paraName) : new ArgumentException(msg);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
if (!value.HasValue || value.Value.Equals(default(T)))
|
||||
{
|
||||
throw string.IsNullOrEmpty(msg) ? new ArgumentException("值不可为空或默认值", paraName) : new ArgumentException(msg);
|
||||
}
|
||||
|
||||
public static string IsNullOrEmpty([NotNull] string? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
throw string.IsNullOrEmpty(msg) ? new ArgumentException("值不可为空", paraName) : new ArgumentException(msg);
|
||||
return value.Value;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
//public static ICollection<T> NotNullOrEmpty<T>(ICollection<T> value, string paraName)
|
||||
//{
|
||||
// if (value.IsNullOrEmpty())
|
||||
// {
|
||||
// throw new ArgumentException(paraName + " can not be null or empty!", paraName);
|
||||
// }
|
||||
|
||||
// return value;
|
||||
//}
|
||||
|
||||
//public static Type AssignableTo<TBaseType>(Type type, string paraName)
|
||||
//{
|
||||
// NotNull(type, paraName);
|
||||
// if (!type.IsAssignableTo<TBaseType>())
|
||||
// {
|
||||
// throw new ArgumentException(paraName + " (type of " + type.AssemblyQualifiedName + ") should be assignable to the " + typeof(TBaseType).GetFullNameWithAssemblyName() + "!");
|
||||
// }
|
||||
|
||||
// return type;
|
||||
//}
|
||||
|
||||
public static short OutOfRange(short value, string paraName, short minimumValue, short maximumValue = short.MaxValue)
|
||||
{
|
||||
if (value < minimumValue || value > maximumValue)
|
||||
public static string IsNullOrWhiteSpace([NotNull] string? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null)
|
||||
{
|
||||
throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}");
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
throw string.IsNullOrEmpty(msg) ? new ArgumentException("值不可为空或空格", paraName) : new ArgumentException(msg);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static int OutOfRange(int value, string paraName, int minimumValue, int maximumValue = int.MaxValue)
|
||||
{
|
||||
if (value < minimumValue || value > maximumValue)
|
||||
public static string IsNullOrEmpty([NotNull] string? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null)
|
||||
{
|
||||
throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}");
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
throw string.IsNullOrEmpty(msg) ? new ArgumentException("值不可为空", paraName) : new ArgumentException(msg);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
//public static ICollection<T> NotNullOrEmpty<T>(ICollection<T> value, string paraName)
|
||||
//{
|
||||
// if (value.IsNullOrEmpty())
|
||||
// {
|
||||
// throw new ArgumentException(paraName + " can not be null or empty!", paraName);
|
||||
// }
|
||||
|
||||
public static long OutOfRange(long value, string paraName, long minimumValue, long maximumValue = long.MaxValue)
|
||||
{
|
||||
if (value < minimumValue || value > maximumValue)
|
||||
// return value;
|
||||
//}
|
||||
|
||||
//public static Type AssignableTo<TBaseType>(Type type, string paraName)
|
||||
//{
|
||||
// NotNull(type, paraName);
|
||||
// if (!type.IsAssignableTo<TBaseType>())
|
||||
// {
|
||||
// throw new ArgumentException(paraName + " (type of " + type.AssemblyQualifiedName + ") should be assignable to the " + typeof(TBaseType).GetFullNameWithAssemblyName() + "!");
|
||||
// }
|
||||
|
||||
// return type;
|
||||
//}
|
||||
|
||||
public static short OutOfRange(short value, string paraName, short minimumValue, short maximumValue = short.MaxValue)
|
||||
{
|
||||
throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}");
|
||||
if (value < minimumValue || value > maximumValue)
|
||||
{
|
||||
throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}");
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static float OutOfRange(float value, string paraName, float minimumValue, float maximumValue = float.MaxValue)
|
||||
{
|
||||
if (value < minimumValue || value > maximumValue)
|
||||
public static int OutOfRange(int value, string paraName, int minimumValue, int maximumValue = int.MaxValue)
|
||||
{
|
||||
throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}");
|
||||
if (value < minimumValue || value > maximumValue)
|
||||
{
|
||||
throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}");
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static double OutOfRange(double value, string paraName, double minimumValue, double maximumValue = double.MaxValue)
|
||||
{
|
||||
if (value < minimumValue || value > maximumValue)
|
||||
public static long OutOfRange(long value, string paraName, long minimumValue, long maximumValue = long.MaxValue)
|
||||
{
|
||||
throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}");
|
||||
if (value < minimumValue || value > maximumValue)
|
||||
{
|
||||
throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}");
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static decimal OutOfRange(decimal value, string paraName, decimal minimumValue, decimal maximumValue = decimal.MaxValue)
|
||||
{
|
||||
if (value < minimumValue || value > maximumValue)
|
||||
public static float OutOfRange(float value, string paraName, float minimumValue, float maximumValue = float.MaxValue)
|
||||
{
|
||||
throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}");
|
||||
if (value < minimumValue || value > maximumValue)
|
||||
{
|
||||
throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}");
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
public static double OutOfRange(double value, string paraName, double minimumValue, double maximumValue = double.MaxValue)
|
||||
{
|
||||
if (value < minimumValue || value > maximumValue)
|
||||
{
|
||||
throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}");
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static decimal OutOfRange(decimal value, string paraName, decimal minimumValue, decimal maximumValue = decimal.MaxValue)
|
||||
{
|
||||
if (value < minimumValue || value > maximumValue)
|
||||
{
|
||||
throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}");
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using JNPF;
|
||||
using JNPF.DataEncryption;
|
||||
using JNPF.Extras.DatabaseAccessor.SqlSugar;
|
||||
using JNPF.Extras.DatabaseAccessor.SqlSugar.Extensions;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Configuration.Json;
|
||||
|
||||
@@ -42,4 +42,4 @@ public class SqlSugarPagedList<TEntity>
|
||||
/// 分页集合
|
||||
/// </summary>
|
||||
public class PagedModel : SqlSugarPagedList<object>
|
||||
{}
|
||||
{ }
|
||||
@@ -1,5 +1,3 @@
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace SqlSugar;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using JNPF;
|
||||
using JNPF.DataEncryption;
|
||||
using JNPF.Extras.DatabaseAccessor.SqlSugar.Models;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.JsonSerialization;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
|
||||
2
common/Tnb.Thirdparty/Email/MailUtil.cs
vendored
2
common/Tnb.Thirdparty/Email/MailUtil.cs
vendored
@@ -75,7 +75,7 @@ public class MailUtil
|
||||
var mult = new Multipart("mixed") { body };
|
||||
foreach (var attachment in mailModel.Attachment)
|
||||
{
|
||||
var file = new FileInfo(Path.Combine(mailFilePath , attachment.fileId));
|
||||
var file = new FileInfo(Path.Combine(mailFilePath, attachment.fileId));
|
||||
if (file.Exists)
|
||||
{
|
||||
var mimePart = new MimePart();
|
||||
|
||||
1
common/Tnb.Thirdparty/Tnb.Thirdparty.csproj
vendored
1
common/Tnb.Thirdparty/Tnb.Thirdparty.csproj
vendored
@@ -1,5 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Net;
|
||||
using System.Net.WebSockets;
|
||||
using System.Net.WebSockets;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using JNPF.Common.Net;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
|
||||
Reference in New Issue
Block a user