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 e64d361c..7b660a7e 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs @@ -16,7 +16,7 @@ TemplateFactory templateFactory = new(); //List entityNames = new() { "Banner" }; string modelName = "Forum"; string nameSpaces = "Yi.BBS"; -List entityNames = new() { "Plate" }; +List entityNames = new() { "Comment" }; diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentCreateInputVo.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentCreateInputVo.cs new file mode 100644 index 00000000..dbf65e7e --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentCreateInputVo.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 +{ + /// + /// Comment输入创建对象 + /// + public class CommentCreateInputVo + { + public long Id { get; set; } + public DateTime? CreateTime { get; set; } + public string Content { get; set; } + public long DiscussId { get; set; } + public long UserId { get; set; } + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentGetListInputVo.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentGetListInputVo.cs new file mode 100644 index 00000000..59e9a9d5 --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentGetListInputVo.cs @@ -0,0 +1,18 @@ +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 CommentGetListInputVo : PagedAndSortedResultRequestDto + { + public long Id { get; set; } + public DateTime? CreateTime { get; set; } + public string Content { get; set; } + public long DiscussId { get; set; } + public long UserId { get; set; } + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentGetListOutputDto.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentGetListOutputDto.cs new file mode 100644 index 00000000..d1e59e27 --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentGetListOutputDto.cs @@ -0,0 +1,18 @@ +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 CommentGetListOutputDto : IEntityDto + { + public long Id { get; set; } + public DateTime? CreateTime { get; set; } + public string Content { get; set; } + public long DiscussId { get; set; } + public long UserId { get; set; } + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentGetOutputDto.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentGetOutputDto.cs new file mode 100644 index 00000000..291c642e --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentGetOutputDto.cs @@ -0,0 +1,18 @@ +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 CommentGetOutputDto : IEntityDto + { + public long Id { get; set; } + public DateTime? CreateTime { get; set; } + public string Content { get; set; } + public long DiscussId { get; set; } + public long UserId { get; set; } + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentUpdateInputVo.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentUpdateInputVo.cs new file mode 100644 index 00000000..8c8d993d --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentUpdateInputVo.cs @@ -0,0 +1,17 @@ +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 CommentUpdateInputVo + { + public long Id { get; set; } + public DateTime? CreateTime { get; set; } + public string Content { get; set; } + public long DiscussId { get; set; } + public long UserId { get; set; } + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/ICommentService.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/ICommentService.cs new file mode 100644 index 00000000..eccbc829 --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/ICommentService.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 +{ + /// + /// Comment服务抽象 + /// + public interface ICommentService : ICrudAppService + { + + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/CommentService.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/CommentService.cs new file mode 100644 index 00000000..15600324 --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/CommentService.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 +{ + /// + /// Comment服务实现 + /// + [AppService] + public class CommentService : CrudAppService, + ICommentService, IAutoApiService + { + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/CommentProfile.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/CommentProfile.cs new file mode 100644 index 00000000..9d581293 --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/Forum/MapperConfig/CommentProfile.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 CommentProfile: Profile + { + public CommentProfile() + { + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + } + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain.Shared/Forum/ConstClasses/CommentConst.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain.Shared/Forum/ConstClasses/CommentConst.cs new file mode 100644 index 00000000..c661d369 --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain.Shared/Forum/ConstClasses/CommentConst.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 CommentConst + { + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/Entities/CommentEntity.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/Entities/CommentEntity.cs new file mode 100644 index 00000000..0f84f69d --- /dev/null +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/Entities/CommentEntity.cs @@ -0,0 +1,25 @@ +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("Comment")] + public class CommentEntity : IEntity, ISoftDelete + { + [SugarColumn(IsPrimaryKey = true)] + public long Id { get; set; } + public bool IsDeleted { get; set; } + + public DateTime? CreateTime { get; set; } + public string Content { get; set; } + + public long DiscussId { get; set; } + public long UserId { get; set; } + } +} diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/ForumManager.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/ForumManager.cs index 327b5cb2..6148f6ca 100644 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/ForumManager.cs +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Domain/Forum/ForumManager.cs @@ -17,7 +17,8 @@ namespace Yi.BBS.Domain.Forum { private readonly IRepository _discussRepository; private readonly IRepository _plateEntityRepository; - public ForumManager(IRepository discussRepository, IRepository plateEntityRepository) + private readonly IRepository commentRepository; + public ForumManager(IRepository discussRepository, IRepository plateEntityRepository,IRepository commentRepository) { _discussRepository = discussRepository; _plateEntityRepository = plateEntityRepository;