Skip to content

Commit

Permalink
Merge pull request #141 from i66soft/dev/develop
Browse files Browse the repository at this point in the history
3.1.2-preview3-26
  • Loading branch information
gmf520 authored Mar 25, 2020
2 parents 949ddd2 + 0aed79d commit 249c2cc
Show file tree
Hide file tree
Showing 227 changed files with 11,014 additions and 6,795 deletions.
9 changes: 5 additions & 4 deletions .github/ISSUE_TEMPLATE/-----.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ assignees: ''

---

**您的功能请求与现有问题有关吗?请描述**
### 您的功能请求与现有问题有关吗?请描述
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**描述您想要的解决方案**
### 描述您想要的解决方案
A clear and concise description of what you want to happen.

**描述你考虑过的替代方案**
### 描述你考虑过的替代方案
A clear and concise description of any alternative solutions or features you've considered.

**附加上下文,比如截图**
### 附加上下文,比如截图
Add any other context or screenshots about the feature request here.

13 changes: 7 additions & 6 deletions .github/ISSUE_TEMPLATE/--bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ assignees: ''

---

**描述一下BUG**
### 描述一下BUG
A clear and concise description of what the bug is.

**重现步骤**
### 重现步骤
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**期望行为**
### 期望行为
A clear and concise description of what you expected to happen.

**截图**
### 截图
If applicable, add screenshots to help explain your problem.

**附加上下文,如截图**
### 附加上下文,如截图
Add any other context about the problem here.

**运行环境**
### 运行环境

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
Expand All @@ -38,3 +38,4 @@ Add any other context about the problem here.
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

12 changes: 6 additions & 6 deletions build/OSharpNS.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>OSharpNS</id>
<version>3.1.2-preview3-01</version>
<version>3.1.2-preview3-26</version>
<title>OSharpFramework(.NETCoreApp3.1)</title>
<authors>柳柳软件(66soft.net)</authors>
<owners>柳柳软件(66soft.net)</owners>
Expand All @@ -15,11 +15,11 @@
<tags>osharp osharpns</tags>
<dependencies>
<group targetFramework=".NETCoreApp3.1">
<dependency id="OSharpNS.Core" version="3.1.2-preview3-01" />
<dependency id="OSharpNS.EntityFrameworkCore" version="3.1.2-preview3-01" />
<dependency id="OSharpNS.AutoMapper" version="3.1.2-preview3-01" />
<dependency id="OSharpNS.AspNetCore" version="3.1.2-preview3-01" />
<dependency id="OSharpNS.Log4Net" version="3.1.2-preview3-01" />
<dependency id="OSharpNS.Core" version="3.1.2-preview3-26" />
<dependency id="OSharpNS.EntityFrameworkCore" version="3.1.2-preview3-26" />
<dependency id="OSharpNS.AutoMapper" version="3.1.2-preview3-26" />
<dependency id="OSharpNS.AspNetCore" version="3.1.2-preview3-26" />
<dependency id="OSharpNS.Log4Net" version="3.1.2-preview3-26" />
</group>
</dependencies>
</metadata>
Expand Down
2 changes: 1 addition & 1 deletion build/version.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<VersionMain>3.1</VersionMain>
<VersionPrefix>2</VersionPrefix>
<VersionSuffix>-preview</VersionSuffix>
<VersionSuffixVersion>3-01</VersionSuffixVersion>
<VersionSuffixVersion>3-26</VersionSuffixVersion>
<Version>$(VersionMain).$(VersionPrefix)$(VersionSuffix)$(VersionSuffixVersion)</Version>
<AssemblyVersion>$(VersionMain).$(VersionPrefix)</AssemblyVersion>
<FileVersion>$(VersionMain).$(VersionSuffixVersion)</FileVersion>
Expand Down
2 changes: 1 addition & 1 deletion osharp.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,8 @@ public static $propertyType$ Get$propertyName$(DependencyObject $element$)&#xD;
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=1B77F2C8904D5643B6E8DDEC184FD895/Shortcut/@EntryValue">actp</s:String>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=1B77F2C8904D5643B6E8DDEC184FD895/ShortenQualifiedReferences/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=1B77F2C8904D5643B6E8DDEC184FD895/Text/@EntryValue">[HttpPost]&#xD;
[UnitOfWork]&#xD;
[Description("$功能描述$")]&#xD;
[ServiceFilter(typeof(UnitOfWorkAttribute))]&#xD;
public Task&lt;ActionResult&gt; $ActionName$($param$)&#xD;
{&#xD;
return new EmptyResult();$END$&#xD;
Expand Down
3 changes: 0 additions & 3 deletions samples/web/Liuliu.Demo.Core/Authorization/DataAuthManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@
using Liuliu.Demo.Authorization.Entities;
using Liuliu.Demo.Identity.Entities;

using Microsoft.Extensions.DependencyInjection;

using OSharp.Authorization.DataAuthorization;
using OSharp.Authorization.Dtos;
using OSharp.Authorization.EntityInfos;
using OSharp.Dependency;
using OSharp.Entity;
using OSharp.EventBuses;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,32 @@
// <last-date>2020-02-27 0:35</last-date>
// -----------------------------------------------------------------------

using System.ComponentModel;

using Liuliu.Demo.Authorization.Dtos;
using Liuliu.Demo.Authorization.Entities;

using Microsoft.Extensions.DependencyInjection;

using OSharp.Authorization;
using OSharp.Authorization.Dtos;
using OSharp.Authorization.EntityInfos;
using OSharp.AutoMapper;


namespace Liuliu.Demo.Authorization
{
public class DataAuthorizationPack
: DataAuthorizationPackBase<DataAuthManager, DataAuthCache, EntityInfo, EntityInfoInputDto, EntityRole, EntityRoleInputDto, int>
{ }
{
/// <summary>
/// 将模块服务添加到依赖注入服务容器中
/// </summary>
/// <param name="services">依赖注入服务容器</param>
/// <returns></returns>
public override IServiceCollection AddServices(IServiceCollection services)
{
services.AddSingleton<IAutoMapperConfiguration, AutoMapperConfiguration>();

return base.AddServices(services);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@

using Liuliu.Demo.Authorization.Entities;

using Microsoft.Extensions.DependencyInjection;

using OSharp.AutoMapper;
using OSharp.Dependency;
using OSharp.Json;


Expand All @@ -23,7 +20,6 @@ namespace Liuliu.Demo.Authorization.Dtos
/// <summary>
/// DTO对象映射类
/// </summary>
[Dependency(ServiceLifetime.Singleton)]
public class AutoMapperConfiguration : IAutoMapperConfiguration
{
/// <summary>
Expand Down
36 changes: 3 additions & 33 deletions samples/web/Liuliu.Demo.Core/Authorization/FunctionAuthManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,56 +13,26 @@
using Liuliu.Demo.Authorization.Entities;
using Liuliu.Demo.Identity.Entities;

using Microsoft.Extensions.DependencyInjection;

using OSharp.Authorization;
using OSharp.Authorization.Dtos;
using OSharp.Authorization.Functions;
using OSharp.Dependency;
using OSharp.Entity;
using OSharp.EventBuses;


namespace Liuliu.Demo.Authorization
{
/// <summary>
/// 功能权限管理器
/// </summary>
[Dependency(ServiceLifetime.Scoped, AddSelf = true)]
public class FunctionAuthManager
: FunctionAuthorizationManagerBase<Function, FunctionInputDto, Module, ModuleInputDto, int, ModuleFunction, ModuleRole, ModuleUser, UserRole,
Guid, Role, int, User, int>
{
/// <summary>
/// 初始化一个 SecurityManager 类型的新实例
/// </summary>
/// <param name="eventBus">事件总线</param>
/// <param name="functionRepository">功能仓储</param>
/// <param name="moduleRepository">模块仓储</param>
/// <param name="moduleFunctionRepository">模块功能仓储</param>
/// <param name="moduleRoleRepository">模块角色仓储</param>
/// <param name="moduleUserRepository">模块用户仓储</param>
/// <param name="roleRepository">角色仓储</param>
/// <param name="userRepository">用户仓储</param>
/// <param name="userRoleRepository">用户角色仓储</param>
public FunctionAuthManager(IEventBus eventBus,
IRepository<Function, Guid> functionRepository,
IRepository<Module, int> moduleRepository,
IRepository<ModuleFunction, Guid> moduleFunctionRepository,
IRepository<ModuleRole, Guid> moduleRoleRepository,
IRepository<ModuleUser, Guid> moduleUserRepository,
IRepository<UserRole, Guid> userRoleRepository,
IRepository<Role, int> roleRepository,
IRepository<User, int> userRepository)
: base(eventBus,
functionRepository,
moduleRepository,
moduleFunctionRepository,
moduleRoleRepository,
moduleUserRepository,
userRoleRepository,
roleRepository,
userRepository)
/// <param name="provider">服务提供程序</param>
public FunctionAuthManager(IServiceProvider provider)
: base(provider)
{ }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,35 @@

using Liuliu.Demo.Authorization.Dtos;
using Liuliu.Demo.Authorization.Entities;
using Liuliu.Demo.Identity;

using Microsoft.Extensions.DependencyInjection;

using OSharp.AspNetCore.Mvc;
using OSharp.Authorization;
using OSharp.Authorization.Dtos;
using OSharp.Authorization.Functions;
using OSharp.Core.Packs;
using OSharp.Entity;


namespace Liuliu.Demo.Authorization
{
[DependsOnPacks(typeof(IdentityPack), typeof(MvcFunctionPack))]
public class FunctionAuthorizationPack
: FunctionAuthorizationPackBase<FunctionAuthManager, FunctionAuthorization, FunctionAuthCache, ModuleHandler, Function,
FunctionInputDto, Module, ModuleInputDto, int, ModuleFunction, ModuleRole, ModuleUser, int, int>
{ }
{
/// <summary>
/// 将模块服务添加到依赖注入服务容器中
/// </summary>
/// <param name="services">依赖注入服务容器</param>
/// <returns></returns>
public override IServiceCollection AddServices(IServiceCollection services)
{
services.AddSingleton<ISeedDataInitializer, ModuleSeedDataInitializer>();

return base.AddServices(services);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// -----------------------------------------------------------------------
// <copyright file="ModuleSeedDataInitializer.cs" company="OSharp开源团队">
// Copyright (c) 2014-2020 OSharp. All rights reserved.
// </copyright>
// <site>http://www.osharp.org</site>
// <last-editor>郭明锋</last-editor>
// <last-date>2020-03-07 1:01</last-date>
// -----------------------------------------------------------------------

using System;
using System.Linq.Expressions;

using Liuliu.Demo.Authorization.Entities;

using OSharp.Entity;


namespace Liuliu.Demo.Authorization
{
public class ModuleSeedDataInitializer : SeedDataInitializerBase<Module, int>
{
/// <summary>
/// 初始化一个<see cref="SeedDataInitializerBase{TEntity, TKey}"/>类型的新实例
/// </summary>
public ModuleSeedDataInitializer(IServiceProvider rootProvider)
: base(rootProvider)
{ }

/// <summary>
/// 重写以提供要初始化的种子数据
/// </summary>
/// <returns></returns>
protected override Module[] SeedData()
{
return new[]
{
new Module(){Id=1, Name = "根节点", Remark = "系统根节点", Code = "Root", OrderCode = 1, TreePathString = "$1$"},
};
}

/// <summary>
/// 重写以提供判断某个实体是否存在的表达式
/// </summary>
/// <param name="entity">要判断的实体</param>
/// <returns></returns>
protected override Expression<Func<Module, bool>> ExistingExpression(Module entity)
{
return m => m.TreePathString == entity.TreePathString;
}
}
}
2 changes: 2 additions & 0 deletions samples/web/Liuliu.Demo.Core/Common/CommonService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
using System.Collections.Generic;
using System.Security.Claims;

using Microsoft.Extensions.DependencyInjection;

using OSharp.Collections;
using OSharp.Dependency;

Expand Down
39 changes: 39 additions & 0 deletions samples/web/Liuliu.Demo.Core/Identity/AuthenticationPack.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// -----------------------------------------------------------------------
// <copyright file="AuthenticationPack.cs" company="OSharp开源团队">
// Copyright (c) 2014-2020 OSharp. All rights reserved.
// </copyright>
// <site>http://www.osharp.org</site>
// <last-editor>郭明锋</last-editor>
// <last-date>2020-03-02 21:21</last-date>
// -----------------------------------------------------------------------

using Liuliu.Demo.Identity.Entities;
using Liuliu.Demo.Identity.Events;

using Microsoft.Extensions.DependencyInjection;

using OSharp.Authentication;
using OSharp.Core.Packs;


namespace Liuliu.Demo.Identity
{
/// <summary>
/// 身份认证模块
/// </summary>
[DependsOnPacks(typeof(IdentityPack))]
public class AuthenticationPack : AuthenticationPackBase<User, int>
{
/// <summary>
/// 将模块服务添加到依赖注入服务容器中
/// </summary>
/// <param name="services">依赖注入服务容器</param>
/// <returns></returns>
public override IServiceCollection AddServices(IServiceCollection services)
{
services.AddEventHandler<Logout_RemoveRefreshTokenEventHandler>();

return base.AddServices(services);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,14 @@

using Liuliu.Demo.Identity.Entities;

using Microsoft.Extensions.DependencyInjection;

using OSharp.AutoMapper;
using OSharp.Dependency;


namespace Liuliu.Demo.Identity.Dtos
{
/// <summary>
/// DTO对象映射配置
/// </summary>
[Dependency(ServiceLifetime.Singleton)]
public class AutoMapperConfiguration : IAutoMapperConfiguration
{
/// <summary>
Expand Down
Loading

0 comments on commit 249c2cc

Please sign in to comment.