From 1fe8b9c5c9225bec71fad1ceec3482ed8f71b08b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B7=B3?= Date: Sat, 10 Jun 2023 13:53:00 +0800 Subject: [PATCH 1/8] =?UTF-8?q?feat:=E6=90=AD=E5=BB=BAwebfirst=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/WebFirstGetOutputDto.cs | 12 +++++++ .../Entities/TemplateEntity.cs | 28 ++++++++++++++++ .../Entities/TemplateVarEntity.cs | 21 ++++++++++++ .../WebFirstManager/ITemplateService.cs | 12 +++++++ .../WebFirstManager/ITemplateVarService.cs | 12 +++++++ .../WebFirstManager/IWebFirstService.cs | 12 +++++++ .../WebFirstManager/Impl/TemplateService.cs | 12 +++++++ .../Impl/TemplateVarService.cs | 12 +++++++ .../WebFirstManager/Impl/WebFirstService.cs | 33 +++++++++++++++++++ 9 files changed, 154 insertions(+) create mode 100644 Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Dtos/WebFirstGetOutputDto.cs create mode 100644 Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Entities/TemplateEntity.cs create mode 100644 Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Entities/TemplateVarEntity.cs create mode 100644 Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/ITemplateService.cs create mode 100644 Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/ITemplateVarService.cs create mode 100644 Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/IWebFirstService.cs create mode 100644 Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Impl/TemplateService.cs create mode 100644 Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Impl/TemplateVarService.cs create mode 100644 Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Impl/WebFirstService.cs diff --git a/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Dtos/WebFirstGetOutputDto.cs b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Dtos/WebFirstGetOutputDto.cs new file mode 100644 index 00000000..f4a2da45 --- /dev/null +++ b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Dtos/WebFirstGetOutputDto.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Module.WebFirstManager.Dtos +{ + public class WebFirstGetOutputDto + { + } +} diff --git a/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Entities/TemplateEntity.cs b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Entities/TemplateEntity.cs new file mode 100644 index 00000000..5f68e67e --- /dev/null +++ b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Entities/TemplateEntity.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using SqlSugar; +using Yi.Framework.Infrastructure.Data.Auditing; +using Yi.Framework.Infrastructure.Ddd.Entities; + +namespace Yi.Framework.Module.WebFirstManager.Entities +{ + public class TemplateEntity : IEntity, ICreationAuditedObject + { + + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true)] + public long Id { get; set; } + + /// + /// 模板字符串 + /// + public string TemplateStr { get; set; } = string.Empty; + + + public long? CreatorId { get; set; } + + public DateTime CreationTime { get; set; } + } +} diff --git a/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Entities/TemplateVarEntity.cs b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Entities/TemplateVarEntity.cs new file mode 100644 index 00000000..e6288876 --- /dev/null +++ b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Entities/TemplateVarEntity.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Module.WebFirstManager.Entities +{ + public class TemplateVarEntity + { + /// + /// 变量名称 + /// + public string Name { get; set; }=string.Empty; + + /// + /// 变量值 + /// + public string Value { get; set; } = string.Empty; + } +} diff --git a/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/ITemplateService.cs b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/ITemplateService.cs new file mode 100644 index 00000000..7c5c34a4 --- /dev/null +++ b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/ITemplateService.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Module.WebFirstManager +{ + public interface ITemplateService + { + } +} diff --git a/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/ITemplateVarService.cs b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/ITemplateVarService.cs new file mode 100644 index 00000000..3b481571 --- /dev/null +++ b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/ITemplateVarService.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Module.WebFirstManager +{ + public interface ITemplateVarService + { + } +} diff --git a/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/IWebFirstService.cs b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/IWebFirstService.cs new file mode 100644 index 00000000..9cec1608 --- /dev/null +++ b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/IWebFirstService.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Module.WebFirstManager +{ + public interface IWebFirstService + { + } +} diff --git a/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Impl/TemplateService.cs b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Impl/TemplateService.cs new file mode 100644 index 00000000..c8a5d11b --- /dev/null +++ b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Impl/TemplateService.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Module.WebFirstManager.Impl +{ + public class TemplateService: ITemplateService + { + } +} diff --git a/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Impl/TemplateVarService.cs b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Impl/TemplateVarService.cs new file mode 100644 index 00000000..3ca54984 --- /dev/null +++ b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Impl/TemplateVarService.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Module.WebFirstManager.Impl +{ + public class TemplateVarService: ITemplateVarService + { + } +} diff --git a/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Impl/WebFirstService.cs b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Impl/WebFirstService.cs new file mode 100644 index 00000000..8aabc68f --- /dev/null +++ b/Yi.Furion.Net6/Yi.Framework.Module/WebFirstManager/Impl/WebFirstService.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Mapster; +using Microsoft.AspNetCore.DataProtection.KeyManagement; +using Yi.Framework.Infrastructure.Ddd.Repositories; +using Yi.Framework.Infrastructure.Ddd.Services; +using Yi.Framework.Module.WebFirstManager.Dtos; +using Yi.Framework.Module.WebFirstManager.Entities; + +namespace Yi.Framework.Module.WebFirstManager.Impl +{ + public class WebFirstService : ApplicationService, IWebFirstService + { + private IRepository _repository; + public WebFirstService(IRepository repository) { _repository = repository; } + + /// + /// 根据模板id生成对应的结果 + /// + /// + /// + public async Task GetAsync(Guid id) + { + var entity = await _repository.GetByIdAsync(id); + + return entity.Adapt(); + } + + } +} From 9cc41e8558aa3dd52c106e632c16acd778368cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Mon, 12 Jun 2023 08:48:29 +0000 Subject: [PATCH 2/8] update README.md. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 橙子 <454313500@qq.com> --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index c494c401..05dc909a 100644 --- a/README.md +++ b/README.md @@ -78,8 +78,6 @@ Rbac后台管理系统:[yi.ccnetcore.com](http://yi.ccnetcore.com) (已上 例如:我们大部分功能紧密贴合Sqlsugar,虽然缺少其他orm的替换性,但在使用程度上降低的使用难度 -例如:我们在应用层中使用属性注入,虽然依赖关系会比较模糊,但是使用起来会减少一定代码量 - > 一个面向用户的快速开发后端框架 在真正的使用这,你会明白这一点,极致的简单,也是优雅的一种体现。 From 174f247a8ef63b851be4f3fc1c273b82873be626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B7=B3?= Date: Wed, 28 Jun 2023 16:01:26 +0800 Subject: [PATCH 3/8] =?UTF-8?q?style:=E6=B7=BB=E5=8A=A0config=E7=A7=8D?= =?UTF-8?q?=E5=AD=90=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bbs/DataSeeds/ConfigDataSeed.cs | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Yi.Furion.Net6/Yi.Furion.Core/Bbs/DataSeeds/ConfigDataSeed.cs diff --git a/Yi.Furion.Net6/Yi.Furion.Core/Bbs/DataSeeds/ConfigDataSeed.cs b/Yi.Furion.Net6/Yi.Furion.Core/Bbs/DataSeeds/ConfigDataSeed.cs new file mode 100644 index 00000000..64f4fdb1 --- /dev/null +++ b/Yi.Furion.Net6/Yi.Furion.Core/Bbs/DataSeeds/ConfigDataSeed.cs @@ -0,0 +1,57 @@ +using SqlSugar; +using Yi.Framework.Infrastructure.Data.DataSeeds; +using Yi.Framework.Infrastructure.Ddd.Repositories; +using Yi.Framework.Module.DictionaryManager.Entities; +using Yi.Furion.Core.Rbac.Entities; + +namespace Yi.Furion.Core.Bbs.DataSeeds +{ + public class ConfigDataSeed : AbstractDataSeed, ITransient + { + public ConfigDataSeed(IRepository repository) : base(repository) + { + } + + public override List GetSeedData() + { + List entities = new List(); + ConfigEntity config1 = new ConfigEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + ConfigKey= "bbs.site.name", + ConfigName="站点名称", + ConfigValue="意社区" + }; + entities.Add(config1); + + ConfigEntity config2 = new ConfigEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + ConfigKey = "bbs.site.author", + ConfigName = "站点作者", + ConfigValue = "橙子" + }; + entities.Add(config2); + + ConfigEntity config3 = new ConfigEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + ConfigKey = "bbs.site.icp", + ConfigName = "站点Icp备案", + ConfigValue = "赣ICP备20008025号" + }; + entities.Add(config3); + + + ConfigEntity config4 = new ConfigEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + ConfigKey = "bbs.site.bottom", + ConfigName = "站点底部信息", + ConfigValue = "你好世界" + }; + entities.Add(config4); + return entities; + } + } +} From 7d0fa7f5d142a48b16b65be0026fe10ac0d94eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B7=B3?= Date: Wed, 28 Jun 2023 16:27:13 +0800 Subject: [PATCH 4/8] Update Login.vue --- Yi.BBS.Vue3/src/views/Login.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Yi.BBS.Vue3/src/views/Login.vue b/Yi.BBS.Vue3/src/views/Login.vue index 5b516844..a39f813b 100644 --- a/Yi.BBS.Vue3/src/views/Login.vue +++ b/Yi.BBS.Vue3/src/views/Login.vue @@ -69,8 +69,8 @@ password:[ ]}) const loginForm = reactive({ - userName: "", - password: "", + userName: "cc", + password: "123456", uuid: "", code: "" }) From f1e95b960a3d750faed56c2f07b88b26a03d62f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B7=B3?= Date: Wed, 5 Jul 2023 15:51:16 +0800 Subject: [PATCH 5/8] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Yi.Furion.Net6/.template.config/template.json | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Yi.Furion.Net6/.template.config/template.json diff --git a/Yi.Furion.Net6/.template.config/template.json b/Yi.Furion.Net6/.template.config/template.json new file mode 100644 index 00000000..86262b2c --- /dev/null +++ b/Yi.Furion.Net6/.template.config/template.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "YI", + "classifications": [ "Common", "Code" ], + "identity": "yi", + "name": "YI", + "shortName": "yi", + "sourceName": "Yi.Furion", + "tags": { + "language": "C#", + "type": "item" + }, + "sources": [ + { + "modifiers": [ + { + "exclude": [ "Server.Bin/**/*", "obj/**/*", "*.user", "*.vspscc", "*.vssscc", "*.cache",".git/**/*",".vs/**/*" ] + } + ] + } + ] + +} \ No newline at end of file From dfe8806344fcc445913397a46c1202b7dd9704a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B7=B3?= Date: Thu, 13 Jul 2023 16:04:15 +0800 Subject: [PATCH 6/8] =?UTF-8?q?feat:=E5=AE=8C=E5=96=84=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Yi.Furion.Net6/Yi.Furion.Web.Core/Startup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Yi.Furion.Net6/Yi.Furion.Web.Core/Startup.cs b/Yi.Furion.Net6/Yi.Furion.Web.Core/Startup.cs index bded8a46..375f00de 100644 --- a/Yi.Furion.Net6/Yi.Furion.Web.Core/Startup.cs +++ b/Yi.Furion.Net6/Yi.Furion.Web.Core/Startup.cs @@ -24,7 +24,7 @@ public class Startup : AppStartup services.AddCorsAccessor(); services.AddControllers().AddInjectWithUnifyResult().AddJsonOptions(x => { - //x.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter("yyyy-MM-dd HH:mm:ss")); + x.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter("yyyy-MM-dd HH:mm:ss")); x.JsonSerializerOptions.Converters.Add(new LongToStringConverter()); }); From d62baa0e51b6c2b06a684b3fc936e39c85f5c26b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B7=B3?= Date: Wed, 19 Jul 2023 01:24:27 +0800 Subject: [PATCH 7/8] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E9=87=8D=E7=BD=AE?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Yi.Furion.Application/Rbac/Services/Impl/AccountService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Yi.Furion.Net6/Yi.Furion.Application/Rbac/Services/Impl/AccountService.cs b/Yi.Furion.Net6/Yi.Furion.Application/Rbac/Services/Impl/AccountService.cs index 8ec75824..1faa9396 100644 --- a/Yi.Furion.Net6/Yi.Furion.Application/Rbac/Services/Impl/AccountService.cs +++ b/Yi.Furion.Net6/Yi.Furion.Application/Rbac/Services/Impl/AccountService.cs @@ -346,7 +346,7 @@ namespace Yi.Furion.Application.Rbac.Services.Impl [HttpPut] public async Task RestPasswordAsync(long userId, RestPasswordDto input) { - if (!string.IsNullOrEmpty(input.Password)) + if (string.IsNullOrEmpty(input.Password)) { throw new UserFriendlyException("重置密码不能为空!"); } From 3a61df42ead6ad740dc12a71c4c1346c879fa1fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B7=B3?= Date: Tue, 8 Aug 2023 10:35:09 +0800 Subject: [PATCH 8/8] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84aop=E6=8F=92?= =?UTF-8?q?=E5=85=A5=E5=AE=A1=E8=AE=A1=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sqlsugar/SqlSugarDbContext.cs | 14 +++++++++++--- Yi.Furion.Net6/Yi.Furion.Web.Core/Startup.cs | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Yi.Furion.Net6/Yi.Framework.Infrastructure/Sqlsugar/SqlSugarDbContext.cs b/Yi.Furion.Net6/Yi.Framework.Infrastructure/Sqlsugar/SqlSugarDbContext.cs index 880ef42c..702ca832 100644 --- a/Yi.Furion.Net6/Yi.Framework.Infrastructure/Sqlsugar/SqlSugarDbContext.cs +++ b/Yi.Furion.Net6/Yi.Framework.Infrastructure/Sqlsugar/SqlSugarDbContext.cs @@ -13,7 +13,7 @@ using Yi.Framework.Infrastructure.Data.Entities; namespace Yi.Framework.Infrastructure.Sqlsugar { - public class SqlSugarDbContext + public class SqlSugarDbContext { /// /// SqlSugar 客户端 @@ -109,7 +109,11 @@ namespace Yi.Framework.Infrastructure.Sqlsugar if (entityInfo.PropertyName.Equals(nameof(IAuditedObject.LastModificationTime))) { - entityInfo.SetValue(DateTime.Now); + //为空或者为默认最小值 + if (oldValue is null || DateTime.MinValue.Equals((DateTime)oldValue)) + { + entityInfo.SetValue(DateTime.Now); + } } if (entityInfo.PropertyName.Equals(nameof(IAuditedObject.LastModifierId))) { @@ -122,7 +126,11 @@ namespace Yi.Framework.Infrastructure.Sqlsugar case DataFilterType.InsertByObject: if (entityInfo.PropertyName.Equals(nameof(IAuditedObject.CreationTime))) { - entityInfo.SetValue(DateTime.Now); + //为空或者为默认最小值 + if (oldValue is null || DateTime.MinValue.Equals((DateTime)oldValue)) + { + entityInfo.SetValue(DateTime.Now); + } } if (entityInfo.PropertyName.Equals(nameof(IAuditedObject.CreatorId))) { diff --git a/Yi.Furion.Net6/Yi.Furion.Web.Core/Startup.cs b/Yi.Furion.Net6/Yi.Furion.Web.Core/Startup.cs index 375f00de..51900e3b 100644 --- a/Yi.Furion.Net6/Yi.Furion.Web.Core/Startup.cs +++ b/Yi.Furion.Net6/Yi.Furion.Web.Core/Startup.cs @@ -36,7 +36,7 @@ public class Startup : AppStartup services.AddSchedule(options => { // 注册作业,并配置作业触发器 - options.AddJob(Triggers.Period(10000)); + //options.AddJob(Triggers.Period(10000)); options.AddJob(Triggers.Cron("0 0 0,12 ? * ?",CronStringFormat.WithSeconds)); // 表示每天凌晨与12点 }); services.AddFileLogging("log/application-{0:yyyy}-{0:MM}-{0:dd}.log", options =>