diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/CreateUpdateBaseDto/CreateUpdateBaseDto.cs b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/CreateUpdateBaseDto/CreateUpdateBaseDto.cs new file mode 100644 index 0000000..481ee91 --- /dev/null +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/CreateUpdateBaseDto/CreateUpdateBaseDto.cs @@ -0,0 +1,8 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace Faster.Zheng.Winin.AppBase.CreateUpdateBaseDto; + +public class CreateUpdateBaseDto : EntityDto +{ +} \ No newline at end of file diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/Condition.cs b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/Condition.cs new file mode 100644 index 0000000..45980cd --- /dev/null +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/Condition.cs @@ -0,0 +1,8 @@ +using System.Collections.Generic; + +namespace Faster.Zheng.Winin.AppBase.Filters; + +public class Condition +{ + public ICollection Filters { get; set; } = new List(); +} \ No newline at end of file diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/EnumFilterAction.cs b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/EnumFilterAction.cs new file mode 100644 index 0000000..daf5895 --- /dev/null +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/EnumFilterAction.cs @@ -0,0 +1,62 @@ +using System.ComponentModel; + +namespace Faster.Zheng.Winin.AppBase.Filters; + +/// +/// 过滤条件 +/// +public enum EnumFilterAction +{ + /// + /// equal + /// + [Description("等于")] Equal = 0, + + /// + /// Not equal + /// + [Description("不等于")] NotEqual = 1, + + /// + /// Bigger + /// + [Description("大于")] BiggerThan = 2, + + /// + /// Smaller + /// + [Description("小于")] SmallThan = 3, + + /// + /// Bigger or equal + /// + [Description("大于等于")] BiggerThanOrEqual = 4, + + /// + /// Small or equal + /// + [Description("小于等于")] SmallThanOrEqual = 5, + + /// + /// Like + /// + [Description("类似于")] Like = 6, + + /// + /// Not like + /// + [Description("不类似于")] NotLike = 7, + + /// + /// Contained in + /// List items = new List(); + /// string value = JsonSerializer.Serialize(items);//转成Json字符串 + /// FilterCondition filterCondition = new FilterCondition() { Column = "Name", Value = value, Action = EnumFilterAction.In, Logic = EnumFilterLogic.And }; + /// + [Description("包含于")] In = 8, + + /// + /// Not contained in + /// + [Description("不包含于")] NotIn = 9, +} diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/EnumFilterLogic.cs b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/EnumFilterLogic.cs new file mode 100644 index 0000000..cd182d3 --- /dev/null +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/EnumFilterLogic.cs @@ -0,0 +1,17 @@ +namespace Faster.Zheng.Winin.AppBase.Filters; + +/// +/// 过滤逻辑 +/// +public enum EnumFilterLogic +{ + /// + /// 与 + /// + And = 0, + + /// + /// 或 + /// + Or = 1 +} diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/Filter.cs b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/Filter.cs new file mode 100644 index 0000000..3f7b580 --- /dev/null +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/Filter.cs @@ -0,0 +1,40 @@ +namespace Faster.Zheng.Winin.AppBase.Filters; + +public class Filter +{ + public Filter() + { + Logic = "And"; + } + + public Filter(string column, string value, + string action = "==", + string logic = "And") + { + Column = column; + Action = action; + Value = value; + Logic = logic; + } + + /// + /// 过滤条件之间的逻辑关系:AND和OR + /// + public string Logic { get; set; } = "And"; + + /// + /// 过滤条件中使用的数据列 + /// + public string Column { get; set; } + + /// + /// 过滤条件中的操作:==,!=,>,<,>=,<=,In,NotIn,Like,NotLike + /// Equal、NotEqual、BiggerThan、SmallThan、BiggerThanOrEqual、SmallThanOrEqual、In、NotIn + /// + public string Action { get; set; } = "=="; + + /// + /// 过滤条件中的操作的值 + /// + public string Value { get; set; } +} \ No newline at end of file diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/FilterExtensions.cs b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/FilterExtensions.cs new file mode 100644 index 0000000..173eaba --- /dev/null +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/Filters/FilterExtensions.cs @@ -0,0 +1,336 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Linq.Expressions; +using System.Text.Json; +using Volo.Abp; + +namespace Faster.Zheng.Winin.AppBase.Filters; + +public static class FilterExtensions +{ + public static Expression> ToLambda(this string jsonFilter) + { + if (string.IsNullOrWhiteSpace(jsonFilter)) + { + return p => true; + } + + var filterConditions = JsonSerializer.Deserialize>(jsonFilter); + return filterConditions.ToLambda(); + } + + public static Expression> ToLambda(this Filter filter) + { + var filterConditions = new List { filter }; + return filterConditions.ToLambda(); + } + + public static Expression> ToLambda(this ICollection filterConditionList) + { + Expression> condition = null; + try + { + if (!filterConditionList.Any()) + { + //创建默认表达式 + return p => true; + } + + foreach (var filterCondition in filterConditionList) + { + var tempCondition = CreateLambda(filterCondition); + if (condition == null) + { + condition = tempCondition; + } + else + { + condition = filterCondition.Logic switch + { + "And" => condition.And(tempCondition), + "Or" => condition.Or(tempCondition), + _ => condition + }; + } + } + } + catch (Exception ex) + { + throw new Exception($"获取筛选条件异常:{ex.Message}"); + } + + return condition; + } + + private static Expression> CreateLambda(Filter filter) + { + Expression> expression = p => false; + try + { + var parameter = Expression.Parameter(typeof(T), "p"); //创建参数p + var member = Expression.PropertyOrField(parameter, filter.Column); //创建表达式中的属性或字段 + // var propertyType = member.Type; //取属性类型,常量constant按此类型进行转换 + //var constant = Expression.Constant(filterCondition.Value);//创建常数 + + ConstantExpression constant = null; + if (filter.Action != "In" && filter.Action != "NotIn") + { + constant = CreateConstantExpression(member.Type, filter.Value); + } + + switch (filter.Action.ToLower()) + { + case "==": + expression = Expression.Lambda>(Expression.Equal(member, constant), parameter); + break; + + case "!=": + expression = Expression.Lambda>(Expression.NotEqual(member, constant), parameter); + break; + + case ">": + expression = Expression.Lambda>(Expression.GreaterThan(member, constant), parameter); + break; + + case "<": + expression = Expression.Lambda>(Expression.LessThan(member, constant), parameter); + break; + + case ">=": + expression = + Expression.Lambda>(Expression.GreaterThanOrEqual(member, constant), parameter); + break; + + case "<=": + expression = + Expression.Lambda>(Expression.LessThanOrEqual(member, constant), parameter); + break; + + case "like": + expression = GetExpressionLikeMethod("Contains", filter); + break; + + case "notlike": + expression = GetExpressionNotLikeMethod("Contains", filter); + break; + + case "in": + expression = GetExpressionInMethod("Contains", member.Type, filter); + break; + + case "notin": + expression = GetExpressionNotInMethod("Contains", member.Type, filter); + break; + } + } + catch (Exception ex) + { + throw new UserFriendlyException(ex.Message); + } + + return expression; + } + + /// + /// + /// + /// + /// + private static ConstantExpression CreateConstantExpression(Type propertyType, string value) + { + ConstantExpression constant; + try + { + if (propertyType.IsGenericType && + propertyType.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + var objValue = Convert.ChangeType(value, propertyType.GetGenericArguments()[0], + CultureInfo.InvariantCulture); + constant = Expression.Constant(objValue); + } + else if (propertyType.IsEnum) + { + var enumValue = (Enum)Enum.Parse(propertyType, value, true); + constant = Expression.Constant(enumValue); + } + else + { + constant = propertyType.Name switch + { + "Guid" => Expression.Constant(Guid.Parse(value)), + _ => Expression.Constant(Convert.ChangeType(value, propertyType, CultureInfo.InvariantCulture)) + }; + } + } + catch (Exception ex) + { + throw new Exception($"获取ConstantExpression异常:{ex.Message}"); + } + + return constant; + } + + private static Expression> GetExpressionLikeMethod(string methodName, Filter filter) + { + var parameterExpression = Expression.Parameter(typeof(T), "p"); + // MethodCallExpression methodExpression = GetMethodExpression(methodName, filterCondition.Column, filterCondition.Value, parameterExpression); + var methodExpression = GetMethodExpression(methodName, filter.Column, filter.Value, + parameterExpression); + return Expression.Lambda>(methodExpression, parameterExpression); + } + + private static Expression> GetExpressionNotLikeMethod(string methodName, Filter filter) + { + var parameterExpression = Expression.Parameter(typeof(T), "p"); + var methodExpression = GetMethodExpression(methodName, filter.Column, filter.Value, + parameterExpression); + var notMethodExpression = Expression.Not(methodExpression); + return Expression.Lambda>(notMethodExpression, parameterExpression); + } + + /// + /// 生成guidList.Contains(p=>p.GUId); + /// 除String类型,其他类型涉及到类型转换.如GUID + /// + /// + /// Contains + /// PropertyType/typeof(GUId) + /// PropertyName/PropertyValue + /// + private static Expression> GetExpressionInMethod(string methodName, Type propertyType, + Filter filter) + { + var parameterExpression = Expression.Parameter(typeof(T), "p"); + var lstType = typeof(List<>).MakeGenericType(propertyType); + + //转换枚举 + //if (propertyType.IsEnum) + //{ + // var valueArrayStrings = JsonSerializer.Deserialize>(filter.Value); + // List newValues = new List(); + + // var enumValues = propertyType.GetEnumValues(); + + // foreach (var valueArray in valueArrayStrings) + // { + // foreach (var enumValue in enumValues) + // { + // if (enumValue.ToString() == valueArray) + // { + // newValues.Add(enumValue); + // break; + // } + // } + // } + // var newValue = JsonSerializer.Serialize(newValues); + // filter.Value = newValue; + //} + + var propertyValue = JsonSerializer.Deserialize($"{filter.Value}", lstType); + if (propertyValue != null) + { + var methodExpression = GetListMethodExpression(methodName, propertyType, filter.Column, propertyValue, + parameterExpression); + var expression = Expression.Lambda>(methodExpression, parameterExpression); + return expression; + } + + return p => false; + } + + private static Expression> GetExpressionNotInMethod(string methodName, Type propertyType, + Filter filter) + { + var parameterExpression = Expression.Parameter(typeof(T), "p"); + var lstType = typeof(List<>).MakeGenericType(propertyType); + var propertyValue = JsonSerializer.Deserialize(filter.Value, lstType); + if (propertyValue != null) + { + var methodExpression = GetListMethodExpression(methodName, propertyType, filter.Column, propertyValue, + parameterExpression); + var notMethodExpression = Expression.Not(methodExpression); + return Expression.Lambda>(notMethodExpression, parameterExpression); + } + + return p => false; + } + + private static MethodCallExpression GetListMethodExpression(string methodName, Type propertyType, + string propertyName, object propertyValue, ParameterExpression parameterExpression) + { + var propertyExpression = Expression.Property(parameterExpression, propertyName); //p.GUID + var type = typeof(List<>).MakeGenericType(propertyType); + var method = type.GetMethod(methodName); //获取 List.Contains() + var someValue = Expression.Constant(propertyValue); //Value + return Expression.Call(someValue, method, propertyExpression); + } + + /// + /// 生成类似于p=>p.Code.Contains("xxx");的lambda表达式 + /// parameterExpression标识p,propertyName表示values,propertyValue表示"Code",methodName表示Contains + /// 仅处理p的属性类型为string这种情况 + /// + /// + /// + /// + /// + /// + private static MethodCallExpression GetMethodExpression(string methodName, string propertyName, + string propertyValue, ParameterExpression parameterExpression) + { + var propertyExpression = Expression.Property(parameterExpression, propertyName); + var method = typeof(string).GetMethod(methodName, new[] { typeof(string) }); + var someValue = Expression.Constant(propertyValue, typeof(string)); + return Expression.Call(propertyExpression, method, someValue); + } + + /// + /// 默认True条件 + /// + /// + /// + public static Expression> True() + { + return f => true; + } + + /// + /// 默认False条件 + /// + /// + /// + public static Expression> False() + { + return f => false; + } + + /// + /// 拼接 OR 条件 + /// + /// + /// + /// + /// + private static Expression> Or(this Expression> exp, + Expression> condition) + { + var inv = Expression.Invoke(condition, exp.Parameters); + return Expression.Lambda>(Expression.Or(exp.Body, inv), exp.Parameters); + } + + /// + /// 拼接And条件 + /// + /// + /// + /// + /// + private static Expression> And(this Expression> exp, + Expression> condition) + { + var inv = Expression.Invoke(condition, exp.Parameters); + return Expression.Lambda>(Expression.And(exp.Body, inv), exp.Parameters); + } +} \ No newline at end of file diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/ISfsRequest.cs b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/ISfsRequest.cs new file mode 100644 index 0000000..09b5b13 --- /dev/null +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/ISfsRequest.cs @@ -0,0 +1,12 @@ +using Faster.Zheng.Winin.AppBase.Filters; +using Volo.Abp.Application.Dtos; + +namespace Faster.Zheng.Winin.AppBase; + +public interface ISfsRequest : IPagedAndSortedResultRequest +{ + /// + /// 条件 + /// + public Condition Condition { get; set; } +} \ No newline at end of file diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/IZbxBase.cs b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/IZbxBase.cs new file mode 100644 index 0000000..c1d9878 --- /dev/null +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/IZbxBase.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Faster.Zheng.Winin.AppBase; + +public interface IZbxBase +{ + Task> GetPageListByFilterAsync(SfsRequestInputBase sfsRequestInputBase, + bool includeDetails = false, CancellationToken cancellationToken = default); +} \ No newline at end of file diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/SfsRequestInputBase.cs b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/SfsRequestInputBase.cs new file mode 100644 index 0000000..684fef9 --- /dev/null +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application.Contracts/AppBase/SfsRequestInputBase.cs @@ -0,0 +1,12 @@ +using Faster.Zheng.Winin.AppBase.Filters; +using Volo.Abp.Application.Dtos; + +namespace Faster.Zheng.Winin.AppBase; + +public class SfsRequestInputBase : PagedAndSortedResultRequestDto, ISfsRequest +{ + /// + /// 条件 + /// + public Condition Condition { get; set; } = new(); +} \ No newline at end of file diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs new file mode 100644 index 0000000..bd1c6fd --- /dev/null +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs @@ -0,0 +1,213 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Dynamic.Core; +using System.Linq.Expressions; +using System.Threading; +using System.Threading.Tasks; +using Faster.Zheng.Winin.AppBase.Filters; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories; + +namespace Faster.Zheng.Winin.AppBase; + +public class ZbxBase : + CrudAppService, + IZbxBase + where TEntity : class, IEntity + where TEntityDto : IEntityDto +{ + private IRepository _repository; + + public ZbxBase(IRepository repository) : base(repository) + { + _repository = repository; + } + + #region 公开接口 + + /// + /// 分页查询 + /// + /// + /// + /// + /// + //[HttpPost] + public async Task> GetPageListByFilterAsync(SfsRequestInputBase sfsRequestInputBase, + bool includeDetails = false, CancellationToken cancellationToken = default) + { + var expression = sfsRequestInputBase.Condition.Filters?.Count > 0 + ? sfsRequestInputBase.Condition.Filters.ToLambda() + : p => true; + + var result = await GetQueryListAsync(expression, sfsRequestInputBase.SkipCount, + sfsRequestInputBase.MaxResultCount, + sfsRequestInputBase.Sorting, includeDetails, cancellationToken); + + return result; + } + + //[HttpPost] + public override async Task CreateAsync(TCreateInput input) + { + await CheckCreatePolicyAsync(); + var entity = await MapToEntityAsync(input); + + //判断id是否是00000-0000 如果是则赋值 + var mainId = (Guid)entity.GetType().GetProperty("Id")?.GetValue(entity)!; + if (mainId == Guid.Empty) + { + mainId = Guid.NewGuid(); + entity.GetType().GetProperty("Id")?.SetValue(entity, mainId); + } + + #region 给所有字表的 Id和MasterId赋值 否则默认的会是000000-000-....的id 插入时会报错 + + var propertyInfos = entity.GetType().GetProperties(); + foreach (var propertyInfo in propertyInfos) + { + //判断是否是List集合 + if (propertyInfo.Name == "Details" + && propertyInfo.PropertyType.IsGenericType + && propertyInfo.PropertyType.GetGenericTypeDefinition() == typeof(List<>)) + { + var listProperty = typeof(TEntity).GetProperty("Details"); + + // 获取 List 的元素类型 + if (listProperty != null) + { + var listItemType = listProperty.PropertyType.GetGenericArguments()[0]; + + // 获取元素类型的 ID 属性 + var detailIdProperty = listItemType.GetProperty("Id"); + var masterIdProperty = listItemType.GetProperty("MasterId"); + + if (detailIdProperty != null) + { + // 获取 List 属性的值 + var list = (IList)listProperty.GetValue(entity); + + // 遍历 List 集合中的每个元素,给 ID 属性赋值 + if (list != null) + { + foreach (var item in list) + { + if ((Guid)detailIdProperty.GetValue(item)! == Guid.Empty) + { + detailIdProperty.SetValue(item, Guid.NewGuid()); + } + } + } + } + + if (masterIdProperty != null) + { + // 获取 List 属性的值 + var list = (IList)listProperty.GetValue(entity); + + // 遍历 List 集合中的每个元素,给 ID 属性赋值 + if (list != null) + { + foreach (var item in list) + { + masterIdProperty.SetValue(item, mainId); + } + } + } + } + } + } + + #endregion + + TryToSetTenantId(entity); + await Repository.InsertAsync(entity, true); + return await MapToGetOutputDtoAsync(entity); + } + + //[HttpDelete] + public override async Task DeleteAsync(TKey id) + { + await _repository.DeleteAsync(id); + } + + //[HttpPut] + public override Task UpdateAsync(TKey id, TUpdateInput input) + { + return base.UpdateAsync(id, input); + } + + #endregion + + #region 私有处理 + + /// + /// 按表达式条件获取分页列表 + /// + /// + /// + /// + /// + /// + /// + /// + private async Task> GetQueryListAsync(Expression> expression, + int skipCount, int maxResultCount, string sorting, + bool includeDetails = false, CancellationToken cancellationToken = default) + { + var query = await Repository.GetQueryableAsync(); + + var entities = query.Where(expression); + entities = GetSortingQueryable(entities, sorting); + var str = entities.ToQueryString(); + + Console.WriteLine("---------查询开始---------"); + Console.WriteLine(); + Console.WriteLine(str); + Console.WriteLine(); + Console.WriteLine("---------查询结束---------"); + + var result = await entities.PageBy(skipCount, maxResultCount).ToListAsync(cancellationToken) + .ConfigureAwait(false); + + return result; + } + + private IQueryable GetSortingQueryable(IQueryable entities, string sorting) + { + if (string.IsNullOrEmpty(sorting)) + { + entities = entities.OrderBy("Id"); + } + else + { + var sortParams = sorting?.Split(' '); + var sortName = sortParams[0]; + var ascOrDesc = string.Empty; + if (sortParams.Length > 1) + { + var sortDirection = sortParams[1]; + if (sortDirection.Equals("DESC", StringComparison.OrdinalIgnoreCase)) + { + ascOrDesc = " DESC "; + } + } + else + { + ascOrDesc = " DESC "; + } + + entities = entities.OrderBy(sortName + ascOrDesc); + } + + return entities; + } + + #endregion +} \ No newline at end of file diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/Faster.Zheng.Winin.Application.csproj b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/Faster.Zheng.Winin.Application.csproj index 6fd6645..629ae2a 100644 --- a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/Faster.Zheng.Winin.Application.csproj +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/Faster.Zheng.Winin.Application.csproj @@ -14,6 +14,7 @@ + diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/appsettings.json b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/appsettings.json index bbf287c..dca69af 100644 --- a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/appsettings.json +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.DbMigrator/appsettings.json @@ -1,27 +1,27 @@ { - "ConnectionStrings": { - "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=Winin;Trusted_Connection=True;TrustServerCertificate=True" - }, - "OpenIddict": { - "Applications": { - "Winin_Web": { - "ClientId": "Winin_Web", - "ClientSecret": "1q2w3e*", - "RootUrl": "https://localhost:44392" - }, - "Winin_App": { - "ClientId": "Winin_App", - "RootUrl": "http://localhost:4200" - }, - "Winin_BlazorServerTiered": { - "ClientId": "Winin_BlazorServerTiered", - "ClientSecret": "1q2w3e*", - "RootUrl": "https://localhost:44367" - }, - "Winin_Swagger": { - "ClientId": "Winin_Swagger", - "RootUrl": "https://localhost:44380" - } + "ConnectionStrings": { + "Default": "Server=.;Database=Faster.Zheng.Winin;uid=sa;pwd=sasa;timeout=6000;Encrypt=False" + }, + "OpenIddict": { + "Applications": { + "Winin_Web": { + "ClientId": "Winin_Web", + "ClientSecret": "1q2w3e*", + "RootUrl": "https://localhost:44392" + }, + "Winin_App": { + "ClientId": "Winin_App", + "RootUrl": "http://localhost:4200" + }, + "Winin_BlazorServerTiered": { + "ClientId": "Winin_BlazorServerTiered", + "ClientSecret": "1q2w3e*", + "RootUrl": "https://localhost:44367" + }, + "Winin_Swagger": { + "ClientId": "Winin_Swagger", + "RootUrl": "https://localhost:44380" + } + } } - } } \ No newline at end of file diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/appsettings.json b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/appsettings.json index 82d1c8f..a9a3caa 100644 --- a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/appsettings.json +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Web/appsettings.json @@ -1,11 +1,11 @@ { - "App": { - "SelfUrl": "https://localhost:44392" - }, - "ConnectionStrings": { - "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=Winin;Trusted_Connection=True;TrustServerCertificate=True" - }, - "StringEncryption": { - "DefaultPassPhrase": "Aj66rJI3krHbVhS6" - } + "App": { + "SelfUrl": "https://localhost:44392" + }, + "ConnectionStrings": { + "Default": "Server=.;Database=Faster.Zheng.Winin;uid=sa;pwd=sasa;timeout=6000;Encrypt=False" + }, + "StringEncryption": { + "DefaultPassPhrase": "Aj66rJI3krHbVhS6" + } }