diff --git a/Yi.Framework.Net6/Yi.DataBaseTool.zip b/Yi.Framework.Net6/Yi.DataBaseTool.zip new file mode 100644 index 00000000..b6fa0add Binary files /dev/null and b/Yi.Framework.Net6/Yi.DataBaseTool.zip differ diff --git a/Yi.Framework.Net6/Yi.Framework.sln b/Yi.Framework.Net6/Yi.Framework.sln index d72cc841..e818051e 100644 --- a/Yi.Framework.Net6/Yi.Framework.sln +++ b/Yi.Framework.Net6/Yi.Framework.sln @@ -103,6 +103,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.MultiTenancy", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.DictionaryManager", "src\module\Yi.Framework.DictionaryManager\Yi.Framework.DictionaryManager.csproj", "{8941B30D-698B-477A-8737-43E7B4A8695A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.Sms.Aliyun", "src\module\Yi.Framework.Sms.Aliyun\Yi.Framework.Sms.Aliyun.csproj", "{063178CF-C5B9-463C-A8A4-F32B743818E2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -269,6 +271,10 @@ Global {8941B30D-698B-477A-8737-43E7B4A8695A}.Debug|Any CPU.Build.0 = Debug|Any CPU {8941B30D-698B-477A-8737-43E7B4A8695A}.Release|Any CPU.ActiveCfg = Release|Any CPU {8941B30D-698B-477A-8737-43E7B4A8695A}.Release|Any CPU.Build.0 = Release|Any CPU + {063178CF-C5B9-463C-A8A4-F32B743818E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {063178CF-C5B9-463C-A8A4-F32B743818E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {063178CF-C5B9-463C-A8A4-F32B743818E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {063178CF-C5B9-463C-A8A4-F32B743818E2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -317,6 +323,7 @@ Global {1BF3115D-B027-4805-AF7B-41B3AE9CB355} = {EEF5F221-0E32-4A3D-B647-B4B5E7305806} {590B1EC0-CDA9-4937-BE07-FBB04437D21F} = {5F2B846D-96CE-400A-878E-220498F4EE31} {8941B30D-698B-477A-8737-43E7B4A8695A} = {EEF5F221-0E32-4A3D-B647-B4B5E7305806} + {063178CF-C5B9-463C-A8A4-F32B743818E2} = {EEF5F221-0E32-4A3D-B647-B4B5E7305806} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {6C1A3808-0F4F-43FB-A9FE-5F27A3BB2ECF} diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/YiFrameworkCoreSqlsugarModule.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/YiFrameworkCoreSqlsugarModule.cs index 01a744f2..104082e7 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/YiFrameworkCoreSqlsugarModule.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/YiFrameworkCoreSqlsugarModule.cs @@ -25,7 +25,7 @@ namespace Yi.Framework.Core.Sqlsugar public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context) { services.AddTransient(typeof(IRepository<>), typeof(SqlsugarRepository<>)); - services.Replace(new ServiceDescriptor(typeof(IUnitOfWorkManager), typeof(SqlsugarUnitOfWorkManager), ServiceLifetime.Singleton)); + //services.Replace(new ServiceDescriptor(typeof(IUnitOfWorkManager), typeof(SqlsugarUnitOfWorkManager), ServiceLifetime.Singleton)); services.Replace(new ServiceDescriptor(typeof(IDataFilter), typeof(SqlsugarDataFilter), ServiceLifetime.Scoped)); services.Configure(Appsettings.appConfiguration("DbConnOptions")); diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Data/YiFrameworkDataModule.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Data/YiFrameworkDataModule.cs index e2072859..67a9679e 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Data/YiFrameworkDataModule.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Data/YiFrameworkDataModule.cs @@ -12,11 +12,13 @@ using Yi.Framework.Data.Entities; using Yi.Framework.Data.Extensions; using Yi.Framework.Data.Filters; using Yi.Framework.Ddd; +using Yi.Framework.Uow; namespace Yi.Framework.Data { [DependsOn( - typeof(YiFrameworkDddModule)) ] + typeof(YiFrameworkDddModule), + typeof(YiFrameworkUowModule)) ] public class YiFrameworkDataModule : IStartupModule { public void Configure(IApplicationBuilder app, ConfigureMiddlewareContext context) diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkDddModule.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkDddModule.cs index 0eb72f32..a9fee9f5 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkDddModule.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkDddModule.cs @@ -13,6 +13,7 @@ namespace Yi.Framework.Ddd { [DependsOn( typeof(YiFrameworkCoreMapsterModule) + )] public class YiFrameworkDddModule:IStartupModule { diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Sms.Aliyun/SmsAliyunManager.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Sms.Aliyun/SmsAliyunManager.cs new file mode 100644 index 00000000..9af7d3d9 --- /dev/null +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Sms.Aliyun/SmsAliyunManager.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AlibabaCloud.SDK.Dysmsapi20170525; +using Tea; + +namespace Yi.Framework.Sms.Aliyun +{ + public class SmsAliyunManager + { + private static Client CreateClient(string accessKeyId, string accessKeySecret) + { + AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config + { + // 必填,您的 AccessKey ID + AccessKeyId = accessKeyId, + // 必填,您的 AccessKey Secret + AccessKeySecret = accessKeySecret, + }; + // 访问的域名 + config.Endpoint = "dysmsapi.aliyuncs.com"; + return new Client(config); + } + + public Client AliyunClient { get; set; } + public SmsAliyunManager() { + + AliyunClient = CreateClient("accessKeyId", "accessKeySecret"); + } + + public async Task Send(string phoneNumbers, string code) + { + try + { + AlibabaCloud.SDK.Dysmsapi20170525.Models.SendSmsRequest sendSmsRequest = new AlibabaCloud.SDK.Dysmsapi20170525.Models.SendSmsRequest + { + PhoneNumbers = phoneNumbers, + SignName = "", + TemplateCode = code, + }; + + var response= await AliyunClient.SendSmsAsync(sendSmsRequest); + } + catch (TeaException error) + { + + Console.WriteLine(error.Message); + } + catch (Exception _error) + { + Console.WriteLine(_error.Message); + } + } + } +} \ No newline at end of file diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Sms.Aliyun/SmsAliyunOptions.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Sms.Aliyun/SmsAliyunOptions.cs new file mode 100644 index 00000000..1bc41dc1 --- /dev/null +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Sms.Aliyun/SmsAliyunOptions.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Sms.Aliyun +{ + public class SmsAliyunOptions + { + } +} diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Sms.Aliyun/Yi.Framework.Sms.Aliyun.csproj b/Yi.Framework.Net6/src/module/Yi.Framework.Sms.Aliyun/Yi.Framework.Sms.Aliyun.csproj new file mode 100644 index 00000000..bb4208eb --- /dev/null +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Sms.Aliyun/Yi.Framework.Sms.Aliyun.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Sms.Aliyun/YiFrameworkSmsAliyunModule.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Sms.Aliyun/YiFrameworkSmsAliyunModule.cs new file mode 100644 index 00000000..9493e7f6 --- /dev/null +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Sms.Aliyun/YiFrameworkSmsAliyunModule.cs @@ -0,0 +1,19 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using StartupModules; + +namespace Yi.Framework.Sms.Aliyun +{ + public class YiFrameworkSmsAliyunModule : IStartupModule + { + public void Configure(IApplicationBuilder app, ConfigureMiddlewareContext context) + { + + } + + public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context) + { + + } + } +} \ No newline at end of file diff --git a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/appsettings.json b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/appsettings.json index a4139195..af693d93 100644 --- a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/appsettings.json +++ b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/appsettings.json @@ -14,9 +14,9 @@ "DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ], "DbConnOptions": { - "Url": "DataSource=yi-sqlsugar-dev.db", - //"Url": "server=106.52.94.217;port=3306;database=yi-bbs-dev;user id=root;password=Qz52013142020.", - "DbType": "Sqlite", + //"Url": "DataSource=yi-sqlsugar-dev.db", + "Url": "server=106.52.94.217;port=3306;database=yi-bbs-dev;user id=root;password=Qz52013142020.", + "DbType": "Mysql", "EnabledDbSeed": true, "EnabledReadWrite": false, "EnabledCodeFirst": true, diff --git a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/yi-sqlsugar-dev.db b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/yi-sqlsugar-dev.db index eccd441d..32705633 100644 Binary files a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/yi-sqlsugar-dev.db and b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/yi-sqlsugar-dev.db differ diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Discuss/DiscussCreateInputVo.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Discuss/DiscussCreateInputVo.cs index 20b1d4c3..4e3093e5 100644 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Discuss/DiscussCreateInputVo.cs +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Discuss/DiscussCreateInputVo.cs @@ -13,7 +13,7 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos.Discuss public class DiscussCreateInputVo { public string Title { get; set; } - public string Types { get; set; } + public string? Types { get; set; } public string? Introduction { get; set; } public DateTime? CreateTime { get; set; } = DateTime.Now; public string Content { get; set; } diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Discuss/DiscussGetOutputDto.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Discuss/DiscussGetOutputDto.cs index 19e1067b..57eb36b2 100644 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Discuss/DiscussGetOutputDto.cs +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Discuss/DiscussGetOutputDto.cs @@ -15,7 +15,7 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos public long Id { get; set; } public string Title { get; set; } - public string Types { get; set; } + public string? Types { get; set; } public string? Introduction { get; set; } public int AgreeNum { get; set; } public int SeeNum { get; set; } diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Discuss/DiscussUpdateInputVo.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Discuss/DiscussUpdateInputVo.cs index e65d890a..b6e53d15 100644 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Discuss/DiscussUpdateInputVo.cs +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Discuss/DiscussUpdateInputVo.cs @@ -10,7 +10,7 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos.Discuss public class DiscussUpdateInputVo { public string Title { get; set; } - public string Types { get; set; } + public string? Types { get; set; } public string? Introduction { get; set; } public int AgreeNum { get; set; } public int SeeNum { get; set; } diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/Entities/ArticleEntity.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/Entities/ArticleEntity.cs index d48458e2..fdf068c6 100644 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/Entities/ArticleEntity.cs +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/Entities/ArticleEntity.cs @@ -18,6 +18,7 @@ namespace Yi.BBS.Domain.Forum.Entities public long Id { get; set; } public bool IsDeleted { get; set; } + [SugarColumn(Length = 9999)] public string Content { get; set; } public string Name { get; set; } diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/Entities/DiscussEntity.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/Entities/DiscussEntity.cs index d38565c6..37bf9112 100644 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/Entities/DiscussEntity.cs +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/Entities/DiscussEntity.cs @@ -26,7 +26,7 @@ namespace Yi.BBS.Domain.Forum.Entities [SugarColumn(IsPrimaryKey = true)] public long Id { get; set; } public string Title { get; set; } - public string Types { get; set; } + public string? Types { get; set; } public string? Introduction { get; set; } public int AgreeNum { get; set; } public int SeeNum { get; set; } @@ -34,6 +34,8 @@ namespace Yi.BBS.Domain.Forum.Entities /// 封面 /// public string? Cover { get; set; } + + [SugarColumn(Length =9999)] public string Content { get; set; } public string? Color { get; set; } diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/appsettings.json b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/appsettings.json index a4139195..af693d93 100644 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/appsettings.json +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/appsettings.json @@ -14,9 +14,9 @@ "DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ], "DbConnOptions": { - "Url": "DataSource=yi-sqlsugar-dev.db", - //"Url": "server=106.52.94.217;port=3306;database=yi-bbs-dev;user id=root;password=Qz52013142020.", - "DbType": "Sqlite", + //"Url": "DataSource=yi-sqlsugar-dev.db", + "Url": "server=106.52.94.217;port=3306;database=yi-bbs-dev;user id=root;password=Qz52013142020.", + "DbType": "Mysql", "EnabledDbSeed": true, "EnabledReadWrite": false, "EnabledCodeFirst": true, diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/wwwroot/Image/1640596730678480896.png b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/wwwroot/Image/1640596730678480896.png new file mode 100644 index 00000000..a07294e8 Binary files /dev/null and b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/wwwroot/Image/1640596730678480896.png differ diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/wwwroot/Thumbnail/1640596730678480896.png b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/wwwroot/Thumbnail/1640596730678480896.png new file mode 100644 index 00000000..703bb487 Binary files /dev/null and b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/wwwroot/Thumbnail/1640596730678480896.png differ diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/yi-sqlsugar-dev.db b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/yi-sqlsugar-dev.db index eccd441d..32705633 100644 Binary files a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/yi-sqlsugar-dev.db and b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/yi-sqlsugar-dev.db differ diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/AccountService.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/AccountService.cs index a8c1f305..2c5f056d 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/AccountService.cs +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/AccountService.cs @@ -65,7 +65,8 @@ namespace Yi.RBAC.Application.Identity [Autowired] private IUnitOfWorkManager _unitOfWorkManager { get; set; } - + [Autowired] + private IRepository _roleRepository { get; set; } /// /// 登录 /// @@ -152,7 +153,7 @@ namespace Yi.RBAC.Application.Identity var entity = await _userRepository.InsertReturnEntityAsync(newUser); //赋上一个初始角色 - var roleRepository = uow.GetRepository(); + var roleRepository = _roleRepository; var role = await roleRepository.GetFirstAsync(x => x.RoleName == UserConst.GuestRoleName); if (role is not null) {