diff --git a/Yi.Framework.Net6/Yi.Framework.sln b/Yi.Framework.Net6/Yi.Framework.sln index 81bda6e3..5d02b5af 100644 --- a/Yi.Framework.Net6/Yi.Framework.sln +++ b/Yi.Framework.Net6/Yi.Framework.sln @@ -57,17 +57,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "template", "template", "{A3 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "bbs", "bbs", "{B758A87D-0BFA-44A5-BA33-FBA44151CEB4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.BBS.Domain.Shared", "src\project\BBS\Yi.BBS.Domain.Shared\Yi.BBS.Domain.Shared.csproj", "{DEA3342F-1954-4EE9-9A59-CAF1D7832F33}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.BBS.Domain.Shared", "src\project\bbs\Yi.BBS.Domain.Shared\Yi.BBS.Domain.Shared.csproj", "{DEA3342F-1954-4EE9-9A59-CAF1D7832F33}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.BBS.Domain", "src\project\BBS\Yi.BBS.Domain\Yi.BBS.Domain.csproj", "{86C82BB6-E333-40E8-8DDE-20C3A538433C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.BBS.Domain", "src\project\bbs\Yi.BBS.Domain\Yi.BBS.Domain.csproj", "{86C82BB6-E333-40E8-8DDE-20C3A538433C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.BBS.Application.Contracts", "src\project\BBS\Yi.BBS.Application.Contracts\Yi.BBS.Application.Contracts.csproj", "{679625DD-4BF6-4CD6-99FD-7A3E6D9B04A1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.BBS.Application.Contracts", "src\project\bbs\Yi.BBS.Application.Contracts\Yi.BBS.Application.Contracts.csproj", "{679625DD-4BF6-4CD6-99FD-7A3E6D9B04A1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.BBS.Sqlsugar", "src\project\BBS\Yi.BBS.Sqlsugar\Yi.BBS.Sqlsugar.csproj", "{A8043204-9DAC-4F08-8C73-423CB72927EF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.BBS.Sqlsugar", "src\project\bbs\Yi.BBS.Sqlsugar\Yi.BBS.Sqlsugar.csproj", "{A8043204-9DAC-4F08-8C73-423CB72927EF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.BBS.Web", "src\project\BBS\Yi.BBS.Web\Yi.BBS.Web.csproj", "{83BE964D-D53C-4D1B-B8C6-5306C393C07F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.BBS.Web", "src\project\bbs\Yi.BBS.Web\Yi.BBS.Web.csproj", "{83BE964D-D53C-4D1B-B8C6-5306C393C07F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.BBS.Application", "src\project\BBS\Yi.BBS.Application\Yi.BBS.Application.csproj", "{959A33C5-7826-4AE7-AC51-40BDC2B767B2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.BBS.Application", "src\project\bbs\Yi.BBS.Application\Yi.BBS.Application.csproj", "{959A33C5-7826-4AE7-AC51-40BDC2B767B2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/ConstClasses/TemplateConst.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/ConstClasses/TemplateConst.cs index 54822a33..991209f5 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/ConstClasses/TemplateConst.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/ConstClasses/TemplateConst.cs @@ -38,7 +38,7 @@ namespace Yi.Framework.Template.ConstClasses public const string NameSpaces = "#NameSpaces#"; - public const string BuildRootPath = "../../../../../project/bbs"; - public const string BuildEntityPath = "../../../../../project/bbs"; + public const string BuildRootPath = "../../../../../project/BBS"; + public const string BuildEntityPath = "../../../../../project/BBS"; } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs index 53e06cc5..9dc287f3 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs @@ -7,9 +7,9 @@ TemplateFactory templateFactory = new(); //选择需要生成的模板提供者 -string modelName = "School"; +string modelName = "Forum"; string nameSpaces = "Yi.BBS"; -List entityNames = new() { "Student" }; +List entityNames = new() { "Plate" }; foreach (var entityName in entityNames) { @@ -29,7 +29,7 @@ foreach (var entityName in entityNames) //option.Add(new ApiTemplateProvider(modelName, entityName)); }); //开始构建模板 - //templateFactory.BuildTemplate(); + templateFactory.BuildTemplate(); Console.WriteLine($"Yi.Framework.Template:{entityName}构建完成!"); } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Site/ApiTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Site/ApiTemplateProvider.cs index 5a164c5d..b0865456 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Site/ApiTemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Site/ApiTemplateProvider.cs @@ -10,7 +10,7 @@ namespace Yi.Framework.Template.Provider.Site { public class ApiTemplateProvider : ProgramTemplateProvider { - public ApiTemplateProvider(string modelName, string entityName) : base(modelName, entityName) + public ApiTemplateProvider(string modelName, string entityName, string nameSpaces) : base(modelName, entityName, nameSpaces) { BuildPath = $@"..\..\..\Code_Site\src\api\{TemplateConst.LowerModelName}\{TemplateConst.LowerEntityName}Api.js"; TemplatePath = $@"..\..\..\Template\Site\ApiTemplate.txt"; diff --git a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Application.Contracts/ApplicationContractsSwaggerDoc.xml b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Application.Contracts/ApplicationContractsSwaggerDoc.xml index f083287c..152a55ff 100644 --- a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Application.Contracts/ApplicationContractsSwaggerDoc.xml +++ b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Application.Contracts/ApplicationContractsSwaggerDoc.xml @@ -4,14 +4,14 @@ Yi.BBS.Application.Contracts - + - Student输入创建对象 + Plate输入创建对象 - + - Student + Plate������� diff --git a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Application/ApplicationSwaggerDoc.xml b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Application/ApplicationSwaggerDoc.xml index 41e91c0e..05e1dc4d 100644 --- a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Application/ApplicationSwaggerDoc.xml +++ b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Application/ApplicationSwaggerDoc.xml @@ -4,9 +4,9 @@ Yi.BBS.Application - + - Student服务实现 + Plate服务实现 diff --git a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/Program.cs b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/Program.cs index 1cbc57f6..4f4eab28 100644 --- a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/Program.cs +++ b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/Program.cs @@ -5,13 +5,10 @@ using Yi.Framework.Core.Extensions; using Yi.BBS.Web; var builder = WebApplication.CreateBuilder(args); -//��������url builder.WebHost.UseStartUrlsServer(builder.Configuration); -//����ģ�� builder.UseYiModules(typeof(YiBBSWebModule)); -//����autofacģ��,��Ҫ����ģ�� builder.Host.ConfigureAutoFacContainer(container => { container.RegisterYiModule(AutoFacModuleEnum.PropertiesAutowiredModule, typeof(YiBBSWebModule).Assembly); @@ -19,7 +16,6 @@ builder.Host.ConfigureAutoFacContainer(container => var app = builder.Build(); -//ȫ�ִ����м������Ҫ�������� app.UseErrorHandlingServer(); app.UseAuthentication(); diff --git a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/Properties/launchSettings.json b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/Properties/launchSettings.json index c20b77c7..1f81c189 100644 --- a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/Properties/launchSettings.json +++ b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/Properties/launchSettings.json @@ -6,7 +6,7 @@ "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://localhost:19002", + "applicationUrl": "http://localhost:19003", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } 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 35a27b42..bf88b491 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 @@ -8,7 +8,7 @@ "AllowedHosts": "*", //程序启动地址,*代表全部网口 - "StartUrl": "http://*:19002", + "StartUrl": "http://*:19003", //数据库类型列表 "DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ], 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 a53c9587..6b48b71a 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/Template/Yi.Template.Web/Program.cs b/Yi.Framework.Net6/src/project/Template/Yi.Template.Web/Program.cs index 838b40e8..2b788ad7 100644 --- a/Yi.Framework.Net6/src/project/Template/Yi.Template.Web/Program.cs +++ b/Yi.Framework.Net6/src/project/Template/Yi.Template.Web/Program.cs @@ -5,13 +5,13 @@ using Yi.Framework.Core.Extensions; using Yi.Template.Web; var builder = WebApplication.CreateBuilder(args); -//url +//设置启动url builder.WebHost.UseStartUrlsServer(builder.Configuration); -//ģ +//添加模块 builder.UseYiModules(typeof(YiTemplateWebModule)); -//autofacģ,Ҫģ +//添加autofac模块,需要添加模块 builder.Host.ConfigureAutoFacContainer(container => { container.RegisterYiModule(AutoFacModuleEnum.PropertiesAutowiredModule, typeof(YiTemplateWebModule).Assembly); @@ -19,7 +19,7 @@ builder.Host.ConfigureAutoFacContainer(container => var app = builder.Build(); -//ȫִмҪ +//全局错误中间件,需要放在最早 app.UseErrorHandlingServer(); app.UseAuthentication(); diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Plate/PlateGetOutputDto.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Plate/PlateGetOutputDto.cs new file mode 100644 index 00000000..c46f824e --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Plate/PlateGetOutputDto.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Ddd.Dtos; + +namespace Yi.BBS.Application.Contracts.Forum.Dtos +{ + public class PlateGetOutputDto : IEntityDto + { + public long Id { get; set; } + public string Title { get; set; } + public string PlateType { get; set; } + public string Introduction { get; set; } + public DateTime? CreateTime { get; set; } + public int AgreeNum { get; set; } + public int SeeNum { get; set; } + public string Content { get; set; } + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/PlateCreateInputVo.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/PlateCreateInputVo.cs new file mode 100644 index 00000000..5a12c669 --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/PlateCreateInputVo.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.BBS.Application.Contracts.Forum.Dtos +{ + /// + /// Plate输入创建对象 + /// + public class PlateCreateInputVo + { + public long Id { get; set; } + public string Title { get; set; } + public string PlateType { get; set; } + public string Introduction { get; set; } + public DateTime? CreateTime { get; set; } + public int AgreeNum { get; set; } + public int SeeNum { get; set; } + public string Content { get; set; } + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/PlateGetListInputVo.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/PlateGetListInputVo.cs new file mode 100644 index 00000000..c470deed --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/PlateGetListInputVo.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Ddd.Dtos; + +namespace Yi.BBS.Application.Contracts.Forum.Dtos +{ + public class PlateGetListInputVo : PagedAndSortedResultRequestDto + { + public long Id { get; set; } + public string Title { get; set; } + public string PlateType { get; set; } + public string Introduction { get; set; } + public DateTime? CreateTime { get; set; } + public int AgreeNum { get; set; } + public int SeeNum { get; set; } + public string Content { get; set; } + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/PlateGetListOutputDto.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/PlateGetListOutputDto.cs new file mode 100644 index 00000000..c061f32a --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/PlateGetListOutputDto.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Ddd.Dtos; + +namespace Yi.BBS.Application.Contracts.Forum.Dtos +{ + public class PlateGetListOutputDto : IEntityDto + { + public long Id { get; set; } + public string Title { get; set; } + public string PlateType { get; set; } + public string Introduction { get; set; } + public DateTime? CreateTime { get; set; } + public int AgreeNum { get; set; } + public int SeeNum { get; set; } + public string Content { get; set; } + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/PlateUpdateInputVo.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/PlateUpdateInputVo.cs new file mode 100644 index 00000000..b6c573ad --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/PlateUpdateInputVo.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.BBS.Application.Contracts.Forum.Dtos +{ + public class PlateUpdateInputVo + { + public long Id { get; set; } + public string Title { get; set; } + public string PlateType { get; set; } + public string Introduction { get; set; } + public DateTime? CreateTime { get; set; } + public int AgreeNum { get; set; } + public int SeeNum { get; set; } + public string Content { get; set; } + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/IPlateService.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/IPlateService.cs new file mode 100644 index 00000000..f34b74c4 --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/IPlateService.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.BBS.Application.Contracts.Forum.Dtos; +using Yi.Framework.Ddd.Services.Abstract; + +namespace Yi.BBS.Application.Contracts.Forum +{ + /// + /// Plate������� + /// + public interface IPlateService : ICrudAppService + { + + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/PlateProfile.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/PlateProfile.cs new file mode 100644 index 00000000..5ab2b17b --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/PlateProfile.cs @@ -0,0 +1,23 @@ +using AutoMapper; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.BBS.Application.Contracts.Forum.Dtos; +using Yi.BBS.Domain.Forum.Entities; + +namespace Yi.BBS.Application.Forum.MapperConfig +{ + public class PlateProfile: Profile + { + public PlateProfile() + { + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + } + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/PlateService.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/PlateService.cs new file mode 100644 index 00000000..dd4835a7 --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/PlateService.cs @@ -0,0 +1,17 @@ +using Yi.BBS.Application.Contracts.Forum; +using NET.AutoWebApi.Setting; +using Yi.BBS.Application.Contracts.Forum.Dtos; +using Yi.BBS.Domain.Forum.Entities; +using Yi.Framework.Ddd.Services; + +namespace Yi.BBS.Application.Forum +{ + /// + /// Plate服务实现 + /// + [AppService] + public class PlateService : CrudAppService, + IPlateService, IAutoApiService + { + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain.Shared/Forum/ConstClasses/PlateConst.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain.Shared/Forum/ConstClasses/PlateConst.cs new file mode 100644 index 00000000..8edbe1e1 --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain.Shared/Forum/ConstClasses/PlateConst.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.BBS.Domain.Shared.Forum.ConstClasses +{ + /// + /// 常量定义 + /// + + public class PlateConst + { + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/Entities/PlateEntity.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/Entities/PlateEntity.cs new file mode 100644 index 00000000..218d8bab --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/Entities/PlateEntity.cs @@ -0,0 +1,27 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Data.Entities; +using Yi.Framework.Ddd.Entities; + +namespace Yi.BBS.Domain.Forum.Entities +{ + [SugarTable("Plate")] + public class PlateEntity : IEntity, ISoftDelete + { + [SugarColumn(IsPrimaryKey = true)] + public long Id { get; set; } + public string Title { get; set; } + public string PlateType { get; set; } + public string Introduction { get; set; } + public DateTime? CreateTime { get; set; } + public int AgreeNum { get; set; } + public int SeeNum { get; set; } + + public string Content { get; set; } + public bool IsDeleted { get; set; } + } +}