更改项目目录
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@ TemplateFactory templateFactory = new();
|
||||
|
||||
//选择需要生成的模板提供者
|
||||
|
||||
string modelName = "School";
|
||||
string modelName = "Forum";
|
||||
string nameSpaces = "Yi.BBS";
|
||||
List<string> entityNames = new() { "Student" };
|
||||
List<string> 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}构建完成!");
|
||||
}
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
<name>Yi.BBS.Application.Contracts</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:Yi.BBS.Application.Contracts.School.Dtos.StudentCreateInputVo">
|
||||
<member name="T:Yi.BBS.Application.Contracts.Forum.Dtos.PlateCreateInputVo">
|
||||
<summary>
|
||||
Student输入创建对象
|
||||
Plate输入创建对象
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Yi.BBS.Application.Contracts.School.IStudentService">
|
||||
<member name="T:Yi.BBS.Application.Contracts.Forum.IPlateService">
|
||||
<summary>
|
||||
Student
|
||||
Plate<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<name>Yi.BBS.Application</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:Yi.BBS.Application.School.StudentService">
|
||||
<member name="T:Yi.BBS.Application.Forum.PlateService">
|
||||
<summary>
|
||||
Student服务实现
|
||||
Plate服务实现
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
|
||||
@@ -5,13 +5,10 @@ using Yi.Framework.Core.Extensions;
|
||||
using Yi.BBS.Web;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>url
|
||||
builder.WebHost.UseStartUrlsServer(builder.Configuration);
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
||||
builder.UseYiModules(typeof(YiBBSWebModule));
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>autofacģ<63><C4A3>,<2C><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
||||
builder.Host.ConfigureAutoFacContainer(container =>
|
||||
{
|
||||
container.RegisterYiModule(AutoFacModuleEnum.PropertiesAutowiredModule, typeof(YiBBSWebModule).Assembly);
|
||||
@@ -19,7 +16,6 @@ builder.Host.ConfigureAutoFacContainer(container =>
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//ȫ<>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
app.UseErrorHandlingServer();
|
||||
|
||||
app.UseAuthentication();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "http://localhost:19002",
|
||||
"applicationUrl": "http://localhost:19003",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"AllowedHosts": "*",
|
||||
|
||||
//程序启动地址,*代表全部网口
|
||||
"StartUrl": "http://*:19002",
|
||||
"StartUrl": "http://*:19003",
|
||||
|
||||
//数据库类型列表
|
||||
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
|
||||
|
||||
Binary file not shown.
@@ -5,13 +5,13 @@ using Yi.Framework.Core.Extensions;
|
||||
using Yi.Template.Web;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>url
|
||||
//设置启动url
|
||||
builder.WebHost.UseStartUrlsServer(builder.Configuration);
|
||||
|
||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD>
|
||||
//添加模块
|
||||
builder.UseYiModules(typeof(YiTemplateWebModule));
|
||||
|
||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>autofacģ<EFBFBD><EFBFBD>,<2C><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
||||
//添加autofac模块,需要添加模块
|
||||
builder.Host.ConfigureAutoFacContainer(container =>
|
||||
{
|
||||
container.RegisterYiModule(AutoFacModuleEnum.PropertiesAutowiredModule, typeof(YiTemplateWebModule).Assembly);
|
||||
@@ -19,7 +19,7 @@ builder.Host.ConfigureAutoFacContainer(container =>
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//ȫ<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//全局错误中间件,需要放在最早
|
||||
app.UseErrorHandlingServer();
|
||||
|
||||
app.UseAuthentication();
|
||||
|
||||
@@ -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<long>
|
||||
{
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// Plate输入创建对象
|
||||
/// </summary>
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// Plate<74><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public interface IPlateService : ICrudAppService<PlateGetOutputDto, PlateGetListOutputDto, long, PlateGetListInputVo, PlateCreateInputVo, PlateUpdateInputVo>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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<PlateGetListInputVo, PlateEntity>();
|
||||
CreateMap<PlateCreateInputVo, PlateEntity>();
|
||||
CreateMap<PlateUpdateInputVo, PlateEntity>();
|
||||
CreateMap<PlateEntity, PlateGetListOutputDto>();
|
||||
CreateMap<PlateEntity, PlateGetOutputDto>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// Plate服务实现
|
||||
/// </summary>
|
||||
[AppService]
|
||||
public class PlateService : CrudAppService<PlateEntity, PlateGetOutputDto, PlateGetListOutputDto, long, PlateGetListInputVo, PlateCreateInputVo, PlateUpdateInputVo>,
|
||||
IPlateService, IAutoApiService
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 常量定义
|
||||
/// </summary>
|
||||
|
||||
public class PlateConst
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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<long>, 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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user