mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-11-07 18:04:45 +08:00
同步openauth.Core:
采用代码生成器的表结构控制前端显示,删除以前按照dbset获取数据库结构 优化注释 升级EF及所有三方的版本
This commit is contained in:
@@ -27,6 +27,12 @@ namespace Infrastructure.Cache
|
||||
_memcachedClient = client;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
public override T Get<T>(string key)
|
||||
{
|
||||
return _memcachedClient.Get<T>(key);
|
||||
|
||||
@@ -14,7 +14,6 @@ namespace Infrastructure.Cache
|
||||
private ConnectionMultiplexer _conn { get; set; }
|
||||
private IDatabase iDatabase { get; set; }
|
||||
|
||||
private AppSetting _appSettings;
|
||||
public RedisCacheContext(IOptions<AppSetting> options)
|
||||
{
|
||||
_conn = ConnectionMultiplexer.Connect(options.Value.RedisConf);
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Infrastructure.Extensions.AutofacManager
|
||||
{
|
||||
/// <summary>
|
||||
/// 提供全局静态获取服务的能力。
|
||||
/// <para>例:AutofacContainerModule.GetService<IPathProvider>()</para>
|
||||
/// <para>例:AutofacContainerModule.GetService<IPathProvider>()</para>
|
||||
/// </summary>
|
||||
public class AutofacContainerModule
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Infrastructure.Extensions
|
||||
/// <summary>
|
||||
/// list转换为json
|
||||
/// </summary>
|
||||
/// <typeparam name="T1"></typeparam>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="list"></param>
|
||||
/// <param name="p"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Infrastructure.Extensions
|
||||
/// 获取对象里指定成员名称
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
/// <param name="properties"> 格式 Expression<Func<entityt, object>> exp = x => new { x.字段1, x.字段2 };或x=>x.Name</param>
|
||||
/// <param name="properties"> <![CDATA[格式 Expression<Func<entityt, object>> exp = x => new { x.字段1, x.字段2 };或x=>x.Name]]></param>
|
||||
/// <returns></returns>
|
||||
public static string[] GetExpressionProperty<TEntity>(this Expression<Func<TEntity, object>> properties)
|
||||
{
|
||||
@@ -132,7 +132,7 @@ namespace Infrastructure.Extensions
|
||||
colType += "(" + (asType ? ((DisplayFormatAttribute) objAtrr).DataFormatString : "18,5") + ")";
|
||||
}
|
||||
|
||||
///如果是string,根据 varchar或nvarchar判断最大长度
|
||||
//如果是string,根据 varchar或nvarchar判断最大长度
|
||||
if (property.PropertyType.ToString() == "System.String")
|
||||
{
|
||||
colType = colType.Split("(")[0];
|
||||
@@ -198,7 +198,6 @@ namespace Infrastructure.Extensions
|
||||
/// </summary>
|
||||
/// <param name="array"></param>
|
||||
/// <param name="fieldType">指定生成的数组值的类型</param>
|
||||
/// <param name="sql"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetArraySql(this object[] array, FieldType fieldType, string sql)
|
||||
{
|
||||
@@ -220,7 +219,6 @@ namespace Infrastructure.Extensions
|
||||
/// <summary>
|
||||
/// 根据实体获取key的类型,用于update或del操作
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
public static FieldType GetFieldType(this Type typeEntity)
|
||||
{
|
||||
@@ -607,13 +605,9 @@ namespace Infrastructure.Extensions
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 判断是否包含某个属性:
|
||||
/// 如 [Editable(true)]
|
||||
// public string MO { get; set; }包含Editable
|
||||
/// 判断是否包含某个属性
|
||||
/// <para>public string MO {get; set; }包含Editable</para>
|
||||
/// </summary>
|
||||
/// <param name="propertyInfo"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public static bool ContainsCustomAttributes(this PropertyInfo propertyInfo, Type type)
|
||||
{
|
||||
propertyInfo.GetTypeCustomAttributes(type, out bool contains);
|
||||
@@ -795,7 +789,7 @@ namespace Infrastructure.Extensions
|
||||
/// 如果是小数float或Decimal必须对propertyInfo字段加DisplayFormatAttribute属性
|
||||
/// </param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns>IEnumerable<(bool, string, object)> bool成否校验成功,string校验失败信息,object,当前校验的值</returns>
|
||||
/// <returns>IEnumerable<(bool, string, object)> bool成否校验成功,string校验失败信息,object,当前校验的值</returns>
|
||||
public static IEnumerable<(bool, string, object)> ValidationValueForDbType(this PropertyInfo propertyInfo,
|
||||
params object[] values)
|
||||
{
|
||||
@@ -1036,7 +1030,7 @@ namespace Infrastructure.Extensions
|
||||
/// </summary>
|
||||
/// <param name="member">当前类</param>
|
||||
/// <param name="type">指定的类</param>
|
||||
/// <param name="expression">指定属性的值 格式 Expression<Func<entityt, object>> exp = x => new { x.字段1, x.字段2 };</param>
|
||||
/// <param name="expression">指定属性的值 格式 Expression<Func<entityt, object>> exp = x => new { x.字段1, x.字段2 };</param>
|
||||
/// <returns>返回的是字段+value</returns>
|
||||
public static Dictionary<string, string> GetTypeCustomValues<TEntity>(this MemberInfo member,
|
||||
Expression<Func<TEntity, object>> expression)
|
||||
@@ -1066,7 +1060,7 @@ namespace Infrastructure.Extensions
|
||||
/// </summary>
|
||||
/// <param name="member">当前类</param>
|
||||
/// <param name="type">指定的类</param>
|
||||
/// <param name="expression">指定属性的值 格式 Expression<Func<entityt, object>> exp = x => new { x.字段1, x.字段2 };</param>
|
||||
/// <param name="expression">指定属性的值 格式 Expression<Func<entityt, object>> exp = x => new { x.字段1, x.字段2 };</param>
|
||||
/// <returns></returns>
|
||||
public static string GetTypeCustomValue<TEntity>(this MemberInfo member,
|
||||
Expression<Func<TEntity, object>> expression)
|
||||
@@ -1259,7 +1253,7 @@ namespace Infrastructure.Extensions
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将数据源映射到新的数据中,目前只支持List<TSource>映射到List<TResult>或TSource映射到TResult
|
||||
/// 将数据源映射到新的数据中,目前只支持List<TSource>映射到List<TResult>或TSource映射到TResult
|
||||
/// 目前只支持Dictionary或实体类型
|
||||
/// </summary>
|
||||
/// <typeparam name="TSource"></typeparam>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using System.Xml;
|
||||
|
||||
/// 这个是用VS2010写的,如果用VS2005,请去掉System.Linq和System.Xml.Linq的引用
|
||||
/// 可以将此文件直接编译成dll,今后程序只需要引用该dll后开头添加using XmlLibrary;即可。
|
||||
namespace Infrastructure.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
@@ -371,7 +369,7 @@ namespace Infrastructure.Helpers
|
||||
else
|
||||
{
|
||||
XmlNode xn = GetNode(xns, nodeName);
|
||||
if (xn != null) return xn; /// V1.0.0.3添加节点判断
|
||||
if (xn != null) return xn;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -6,15 +6,16 @@
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DocumentationFile>bin\Debug\net5.0\Infrastructure.xml</DocumentationFile>
|
||||
<NoWarn>1701;1702;1591;1573;1572;1570</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper" Version="9.0.0" />
|
||||
<PackageReference Include="EnyimMemcachedCore" Version="2.1.5" />
|
||||
<PackageReference Include="EnyimMemcachedCore" Version="2.5.3" />
|
||||
<PackageReference Include="log4net" Version="2.0.12" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="NUnit" Version="3.13.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
|
||||
|
||||
@@ -126,18 +126,18 @@ namespace Yitter.IdGenerator
|
||||
{
|
||||
return;
|
||||
|
||||
if (GenAction == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DoGenIdAction(new OverCostActionArg(
|
||||
WorkerId,
|
||||
useTimeTick,
|
||||
1,
|
||||
_OverCostCountInOneTerm,
|
||||
_GenCountInOneTerm,
|
||||
_TermIndex));
|
||||
// if (GenAction == null)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// DoGenIdAction(new OverCostActionArg(
|
||||
// WorkerId,
|
||||
// useTimeTick,
|
||||
// 1,
|
||||
// _OverCostCountInOneTerm,
|
||||
// _GenCountInOneTerm,
|
||||
// _TermIndex));
|
||||
}
|
||||
|
||||
private void EndOverCostAction(in long useTimeTick)
|
||||
@@ -148,54 +148,54 @@ namespace Yitter.IdGenerator
|
||||
}
|
||||
return;
|
||||
|
||||
if (GenAction == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DoGenIdAction(new OverCostActionArg(
|
||||
WorkerId,
|
||||
useTimeTick,
|
||||
2,
|
||||
_OverCostCountInOneTerm,
|
||||
_GenCountInOneTerm,
|
||||
_TermIndex));
|
||||
// if (GenAction == null)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// DoGenIdAction(new OverCostActionArg(
|
||||
// WorkerId,
|
||||
// useTimeTick,
|
||||
// 2,
|
||||
// _OverCostCountInOneTerm,
|
||||
// _GenCountInOneTerm,
|
||||
// _TermIndex));
|
||||
}
|
||||
|
||||
private void BeginTurnBackAction(in long useTimeTick)
|
||||
{
|
||||
return;
|
||||
|
||||
if (GenAction == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DoGenIdAction(new OverCostActionArg(
|
||||
WorkerId,
|
||||
useTimeTick,
|
||||
8,
|
||||
0,
|
||||
0,
|
||||
_TurnBackIndex));
|
||||
// if (GenAction == null)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// DoGenIdAction(new OverCostActionArg(
|
||||
// WorkerId,
|
||||
// useTimeTick,
|
||||
// 8,
|
||||
// 0,
|
||||
// 0,
|
||||
// _TurnBackIndex));
|
||||
}
|
||||
|
||||
private void EndTurnBackAction(in long useTimeTick)
|
||||
{
|
||||
return;
|
||||
|
||||
if (GenAction == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DoGenIdAction(new OverCostActionArg(
|
||||
WorkerId,
|
||||
useTimeTick,
|
||||
9,
|
||||
0,
|
||||
0,
|
||||
_TurnBackIndex));
|
||||
// if (GenAction == null)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// DoGenIdAction(new OverCostActionArg(
|
||||
// WorkerId,
|
||||
// useTimeTick,
|
||||
// 9,
|
||||
// 0,
|
||||
// 0,
|
||||
// _TurnBackIndex));
|
||||
}
|
||||
|
||||
private long NextOverCostId()
|
||||
|
||||
@@ -58,17 +58,5 @@ namespace Infrastructure.Utilities
|
||||
String result = url.ToLower().Replace("&" + fragmentToRemove, string.Empty).Replace("?" + fragmentToRemove, string.Empty);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据URL的相对地址获取决定路径
|
||||
/// <para>eg: /Home/About ==>http://192.168.0.1/Home/About</para>
|
||||
/// </summary>
|
||||
/// <returns>System.String.</returns>
|
||||
//public static string GetAbsolutePathForRelativePath(string relativePath)
|
||||
//{
|
||||
// HttpRequest Request = HttpContext.Current.Request;
|
||||
// string returnUrl = string.Format("{0}{1}",Request.Url.AbsoluteUri.Replace(Request.Url.PathAndQuery, string.Empty) , VirtualPathUtility.ToAbsolute(relativePath));
|
||||
// return returnUrl;
|
||||
//}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user