懒得勤快 il y a 5 ans
Parent
commit
e980d5a66c
78 fichiers modifiés avec 244 ajouts et 233 suppressions
  1. 44 43
      src/Masuit.MyBlogs.Core/Configs/MappingProfile.cs
  2. 2 2
      src/Masuit.MyBlogs.Core/Controllers/AdminController.cs
  3. 5 5
      src/Masuit.MyBlogs.Core/Controllers/BaseController.cs
  4. 4 3
      src/Masuit.MyBlogs.Core/Controllers/CategoryController.cs
  5. 4 3
      src/Masuit.MyBlogs.Core/Controllers/CommentController.cs
  6. 11 11
      src/Masuit.MyBlogs.Core/Controllers/HomeController.cs
  7. 1 1
      src/Masuit.MyBlogs.Core/Controllers/LinksController.cs
  8. 2 1
      src/Masuit.MyBlogs.Core/Controllers/MenuController.cs
  9. 5 4
      src/Masuit.MyBlogs.Core/Controllers/MergeController.cs
  10. 1 1
      src/Masuit.MyBlogs.Core/Controllers/MiscController.cs
  11. 4 3
      src/Masuit.MyBlogs.Core/Controllers/MsgController.cs
  12. 4 4
      src/Masuit.MyBlogs.Core/Controllers/NoticeController.cs
  13. 3 3
      src/Masuit.MyBlogs.Core/Controllers/PassportController.cs
  14. 11 10
      src/Masuit.MyBlogs.Core/Controllers/PostController.cs
  15. 2 2
      src/Masuit.MyBlogs.Core/Controllers/SearchController.cs
  16. 4 4
      src/Masuit.MyBlogs.Core/Controllers/SeminarController.cs
  17. 1 1
      src/Masuit.MyBlogs.Core/Controllers/UploadController.cs
  18. 3 3
      src/Masuit.MyBlogs.Core/Controllers/UserController.cs
  19. 1 1
      src/Masuit.MyBlogs.Core/Extensions/Hangfire/HangfireBackJob.cs
  20. 1 1
      src/Masuit.MyBlogs.Core/Extensions/Hangfire/IHangfireBackJob.cs
  21. 5 2
      src/Masuit.MyBlogs.Core/Extensions/MiddlewareExtension.cs
  22. 1 1
      src/Masuit.MyBlogs.Core/Extensions/MyAuthorizeAttribute.cs
  23. 1 1
      src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IPostService.cs
  24. 1 1
      src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IUserInfoService.cs
  25. 7 7
      src/Masuit.MyBlogs.Core/Infrastructure/Services/PostService.cs
  26. 5 7
      src/Masuit.MyBlogs.Core/Infrastructure/Services/UserInfoService.cs
  27. 4 4
      src/Masuit.MyBlogs.Core/Models/Command/BroadcastCommand.cs
  28. 4 4
      src/Masuit.MyBlogs.Core/Models/Command/CategoryCommand.cs
  29. 4 4
      src/Masuit.MyBlogs.Core/Models/Command/CommentCommand.cs
  30. 4 4
      src/Masuit.MyBlogs.Core/Models/Command/LeaveMessageCommand.cs
  31. 4 4
      src/Masuit.MyBlogs.Core/Models/Command/LinksCommand.cs
  32. 5 5
      src/Masuit.MyBlogs.Core/Models/Command/MenuCommand.cs
  33. 4 4
      src/Masuit.MyBlogs.Core/Models/Command/MiscCommand.cs
  34. 9 0
      src/Masuit.MyBlogs.Core/Models/Command/NoticeCommand.cs
  35. 3 3
      src/Masuit.MyBlogs.Core/Models/Command/PostMergeRequestCommand.cs
  36. 3 2
      src/Masuit.MyBlogs.Core/Models/Command/PostMergeRequestCommandBase.cs
  37. 3 3
      src/Masuit.MyBlogs.Core/Models/Command/SearchDetailsCommand.cs
  38. 3 2
      src/Masuit.MyBlogs.Core/Models/Command/SeminarCommand.cs
  39. 5 4
      src/Masuit.MyBlogs.Core/Models/Command/UserInfoCommand.cs
  40. 1 1
      src/Masuit.MyBlogs.Core/Models/DTO/BroadcastDto.cs
  41. 1 1
      src/Masuit.MyBlogs.Core/Models/DTO/CategoryDto.cs
  42. 1 1
      src/Masuit.MyBlogs.Core/Models/DTO/CommentDto.cs
  43. 1 1
      src/Masuit.MyBlogs.Core/Models/DTO/LeaveMessageDto.cs
  44. 1 1
      src/Masuit.MyBlogs.Core/Models/DTO/LinksDto.cs
  45. 1 1
      src/Masuit.MyBlogs.Core/Models/DTO/MenuDto.cs
  46. 1 1
      src/Masuit.MyBlogs.Core/Models/DTO/MiscDto.cs
  47. 1 1
      src/Masuit.MyBlogs.Core/Models/DTO/NoticeDto.cs
  48. 0 9
      src/Masuit.MyBlogs.Core/Models/DTO/NoticeInputDto.cs
  49. 2 2
      src/Masuit.MyBlogs.Core/Models/DTO/PostCommand.cs
  50. 2 2
      src/Masuit.MyBlogs.Core/Models/DTO/PostDto.cs
  51. 1 1
      src/Masuit.MyBlogs.Core/Models/DTO/PostMergeRequestDto.cs
  52. 1 1
      src/Masuit.MyBlogs.Core/Models/DTO/PostMergeRequestDtoBase.cs
  53. 1 1
      src/Masuit.MyBlogs.Core/Models/DTO/SearchDetailsDto.cs
  54. 1 1
      src/Masuit.MyBlogs.Core/Models/DTO/SeminarDto.cs
  55. 1 1
      src/Masuit.MyBlogs.Core/Models/DTO/UserInfoDto.cs
  56. 5 5
      src/Masuit.MyBlogs.Core/Models/ViewModel/IndexPageViewModel.cs
  57. 1 1
      src/Masuit.MyBlogs.Core/Models/ViewModel/PageFootViewModel.cs
  58. 2 2
      src/Masuit.MyBlogs.Core/Startup.cs
  59. 1 1
      src/Masuit.MyBlogs.Core/Views/Home/Author.cshtml
  60. 1 1
      src/Masuit.MyBlogs.Core/Views/Home/Category.cshtml
  61. 1 1
      src/Masuit.MyBlogs.Core/Views/Home/Index.cshtml
  62. 1 1
      src/Masuit.MyBlogs.Core/Views/Home/Post.cshtml
  63. 1 1
      src/Masuit.MyBlogs.Core/Views/Home/Tag.cshtml
  64. 2 2
      src/Masuit.MyBlogs.Core/Views/Links/Index.cshtml
  65. 2 2
      src/Masuit.MyBlogs.Core/Views/Links/Index_Admin.cshtml
  66. 1 1
      src/Masuit.MyBlogs.Core/Views/Msg/Index_Admin.cshtml
  67. 1 1
      src/Masuit.MyBlogs.Core/Views/Notice/Details.cshtml
  68. 1 1
      src/Masuit.MyBlogs.Core/Views/Notice/Index.cshtml
  69. 1 1
      src/Masuit.MyBlogs.Core/Views/Notice/Index_Admin.cshtml
  70. 1 1
      src/Masuit.MyBlogs.Core/Views/Post/Details_Admin.cshtml
  71. 2 2
      src/Masuit.MyBlogs.Core/Views/Search/Search.cshtml
  72. 2 2
      src/Masuit.MyBlogs.Core/Views/Seminar/Index.cshtml
  73. 1 1
      src/Masuit.MyBlogs.Core/Views/Shared/_ArticleListItem.cshtml
  74. 1 1
      src/Masuit.MyBlogs.Core/Views/Shared/_ArticleListItem_Admin.cshtml
  75. 1 1
      src/Masuit.MyBlogs.Core/Views/Shared/_ArticleListPartial.cshtml
  76. 1 1
      src/Masuit.MyBlogs.Core/Views/Shared/_ArticleListPartial_Admin.cshtml
  77. 3 3
      src/Masuit.MyBlogs.Core/Views/Shared/_Aside.cshtml
  78. 6 6
      src/Masuit.MyBlogs.Core/Views/Shared/_Layout.cshtml

+ 44 - 43
src/Masuit.MyBlogs.Core/Configs/MappingProfile.cs

@@ -6,6 +6,7 @@ using Masuit.MyBlogs.Core.Models.ViewModel;
 using Masuit.Tools.Systems;
 using System;
 using System.Linq;
+using Masuit.MyBlogs.Core.Models.Command;
 
 namespace Masuit.MyBlogs.Core.Configs
 {
@@ -16,74 +17,74 @@ namespace Masuit.MyBlogs.Core.Configs
     {
         public MappingProfile()
         {
-            CreateMap<Broadcast, BroadcastInputDto>().ReverseMap();
-            CreateMap<Broadcast, BroadcastOutputDto>().ReverseMap();
-            CreateMap<BroadcastOutputDto, BroadcastInputDto>().ReverseMap();
+            CreateMap<Broadcast, BroadcastCommand>().ReverseMap();
+            CreateMap<Broadcast, BroadcastDto>().ReverseMap();
+            CreateMap<BroadcastDto, BroadcastCommand>().ReverseMap();
 
-            CreateMap<Category, CategoryInputDto>().ReverseMap();
-            CreateMap<Category, CategoryOutputDto>().ForMember(c => c.TotalPostCount, e => e.MapFrom(c => c.Post.Count)).ForMember(c => c.PendedPostCount, e => e.MapFrom(c => c.Post.Count())).ReverseMap();
-            CreateMap<CategoryInputDto, CategoryOutputDto>().ReverseMap();
+            CreateMap<Category, CategoryCommand>().ReverseMap();
+            CreateMap<Category, CategoryDto>().ForMember(c => c.TotalPostCount, e => e.MapFrom(c => c.Post.Count)).ForMember(c => c.PendedPostCount, e => e.MapFrom(c => c.Post.Count())).ReverseMap();
+            CreateMap<CategoryCommand, CategoryDto>().ReverseMap();
 
-            CreateMap<CommentInputDto, Comment>().ForMember(c => c.Status, e => e.MapFrom(c => Status.Pending)).ReverseMap();
-            CreateMap<Comment, CommentOutputDto>().ReverseMap();
-            CreateMap<CommentInputDto, CommentOutputDto>().ReverseMap();
+            CreateMap<CommentCommand, Comment>().ForMember(c => c.Status, e => e.MapFrom(c => Status.Pending)).ReverseMap();
+            CreateMap<Comment, CommentDto>().ReverseMap();
+            CreateMap<CommentCommand, CommentDto>().ReverseMap();
             CreateMap<Comment, CommentViewModel>().ForMember(c => c.CommentDate, e => e.MapFrom(c => c.CommentDate.ToString("yyyy-MM-dd HH:mm:ss"))).ReverseMap();
 
-            CreateMap<LeaveMessageInputDto, LeaveMessage>().ForMember(c => c.Status, e => e.MapFrom(c => Status.Pending)).ReverseMap();
-            CreateMap<LeaveMessage, LeaveMessageOutputDto>().ReverseMap();
-            CreateMap<LeaveMessageInputDto, LeaveMessageOutputDto>().ReverseMap();
+            CreateMap<LeaveMessageCommand, LeaveMessage>().ForMember(c => c.Status, e => e.MapFrom(c => Status.Pending)).ReverseMap();
+            CreateMap<LeaveMessage, LeaveMessageDto>().ReverseMap();
+            CreateMap<LeaveMessageCommand, LeaveMessageDto>().ReverseMap();
             CreateMap<LeaveMessage, LeaveMessageViewModel>().ForMember(l => l.PostDate, e => e.MapFrom(l => l.PostDate.ToString("yyyy-MM-dd HH:mm:ss"))).ReverseMap();
 
-            CreateMap<Links, LinksInputDto>().ReverseMap();
-            CreateMap<Links, LinksOutputDto>().ReverseMap();
-            CreateMap<LinksInputDto, LinksOutputDto>().ReverseMap();
+            CreateMap<Links, LinksCommand>().ReverseMap();
+            CreateMap<Links, LinksDto>().ReverseMap();
+            CreateMap<LinksCommand, LinksDto>().ReverseMap();
 
-            CreateMap<Menu, MenuInputDto>().ReverseMap();
-            CreateMap<Menu, MenuOutputDto>().ReverseMap();
-            CreateMap<MenuInputDto, MenuOutputDto>().ReverseMap();
+            CreateMap<Menu, MenuCommand>().ReverseMap();
+            CreateMap<Menu, MenuDto>().ReverseMap();
+            CreateMap<MenuCommand, MenuDto>().ReverseMap();
 
-            CreateMap<Misc, MiscInputDto>().ReverseMap();
-            CreateMap<Misc, MiscOutputDto>().ReverseMap();
-            CreateMap<MiscInputDto, MiscOutputDto>().ReverseMap();
+            CreateMap<Misc, MiscCommand>().ReverseMap();
+            CreateMap<Misc, MiscDto>().ReverseMap();
+            CreateMap<MiscCommand, MiscDto>().ReverseMap();
             CreateMap<Misc, MiscViewModel>().ForMember(c => c.PostDate, e => e.MapFrom(c => c.PostDate.ToString("yyyy-MM-dd HH:mm:ss"))).ForMember(c => c.ModifyDate, e => e.MapFrom(c => c.ModifyDate.ToString("yyyy-MM-dd HH:mm:ss"))).ReverseMap();
 
-            CreateMap<Notice, NoticeInputDto>().ReverseMap();
-            CreateMap<Notice, NoticeOutputDto>().ReverseMap();
-            CreateMap<NoticeInputDto, NoticeOutputDto>().ReverseMap();
+            CreateMap<Notice, NoticeCommand>().ReverseMap();
+            CreateMap<Notice, NoticeDto>().ReverseMap();
+            CreateMap<NoticeCommand, NoticeDto>().ReverseMap();
             CreateMap<Notice, NoticeViewModel>().ForMember(c => c.PostDate, e => e.MapFrom(c => c.PostDate.ToString("yyyy-MM-dd HH:mm:ss"))).ForMember(c => c.ModifyDate, e => e.MapFrom(c => c.ModifyDate.ToString("yyyy-MM-dd HH:mm:ss"))).ReverseMap();
 
-            CreateMap<Post, PostInputDto>().ReverseMap();
+            CreateMap<Post, PostCommand>().ReverseMap();
             CreateMap<Post, PostModelBase>();
             CreateMap<Post, PostHistoryVersion>().ForMember(p => p.Id, e => e.Ignore()).ForMember(v => v.PostId, e => e.MapFrom(p => p.Id));
-            CreateMap<Post, PostOutputDto>().ForMember(p => p.CategoryName, e => e.MapFrom(p => p.Category.Name)).ForMember(p => p.CommentCount, e => e.MapFrom(p => p.Comment.Count(c => c.Status == Status.Pended))).ReverseMap();
-            CreateMap<PostInputDto, PostOutputDto>().ReverseMap();
-            CreateMap<PostHistoryVersion, PostOutputDto>().ForMember(p => p.CategoryName, e => e.MapFrom(p => p.Category.Name)).ReverseMap();
+            CreateMap<Post, PostDto>().ForMember(p => p.CategoryName, e => e.MapFrom(p => p.Category.Name)).ForMember(p => p.CommentCount, e => e.MapFrom(p => p.Comment.Count(c => c.Status == Status.Pended))).ReverseMap();
+            CreateMap<PostCommand, PostDto>().ReverseMap();
+            CreateMap<PostHistoryVersion, PostDto>().ForMember(p => p.CategoryName, e => e.MapFrom(p => p.Category.Name)).ReverseMap();
             CreateMap<Post, PostViewModel>().ForMember(p => p.CategoryName, e => e.MapFrom(p => p.Category.Name)).ForMember(p => p.PostDate, e => e.MapFrom(p => p.PostDate.ToString("yyyy-MM-dd HH:mm:ss"))).ForMember(p => p.ModifyDate, e => e.MapFrom(p => p.ModifyDate.ToString("yyyy-MM-dd HH:mm:ss"))).ReverseMap();
             CreateMap<Post, PostDataModel>().ForMember(p => p.ModifyDate, e => e.MapFrom(p => p.ModifyDate.ToString("yyyy-MM-dd HH:mm"))).ForMember(p => p.PostDate, e => e.MapFrom(p => p.PostDate.ToString("yyyy-MM-dd HH:mm"))).ForMember(p => p.Status, e => e.MapFrom(p => p.Status.GetDisplay())).ForMember(p => p.ModifyCount, e => e.MapFrom(p => p.PostHistoryVersion.Count)).ForMember(p => p.ViewCount, e => e.MapFrom(p => p.TotalViewCount));
 
-            CreateMap<SearchDetails, SearchDetailsInputDto>().ReverseMap();
-            CreateMap<SearchDetails, SearchDetailsOutputDto>().ReverseMap();
-            CreateMap<SearchDetailsInputDto, SearchDetailsOutputDto>().ReverseMap();
+            CreateMap<SearchDetails, SearchDetailsCommand>().ReverseMap();
+            CreateMap<SearchDetails, SearchDetailsDto>().ReverseMap();
+            CreateMap<SearchDetailsCommand, SearchDetailsDto>().ReverseMap();
 
-            CreateMap<UserInfo, UserInfoInputDto>().ReverseMap();
-            CreateMap<UserInfo, UserInfoOutputDto>().ReverseMap();
-            CreateMap<UserInfoInputDto, UserInfoOutputDto>().ReverseMap();
+            CreateMap<UserInfo, UserInfoCommand>().ReverseMap();
+            CreateMap<UserInfo, UserInfoDto>().ReverseMap();
+            CreateMap<UserInfoCommand, UserInfoDto>().ReverseMap();
 
             CreateMap<LoginRecord, LoginRecordViewModel>().ReverseMap();
 
-            CreateMap<Seminar, SeminarInputDto>().ReverseMap();
-            CreateMap<Seminar, SeminarOutputDto>().ReverseMap();
-            CreateMap<SeminarInputDto, SeminarOutputDto>().ReverseMap();
+            CreateMap<Seminar, SeminarCommand>().ReverseMap();
+            CreateMap<Seminar, SeminarDto>().ReverseMap();
+            CreateMap<SeminarCommand, SeminarDto>().ReverseMap();
 
             CreateMap<SeminarPost, SeminarPostHistoryVersion>().ForMember(s => s.PostHistoryVersionId, e => e.MapFrom(s => s.PostId)).ReverseMap();
 
-            CreateMap<PostMergeRequestInputDtoBase, PostMergeRequest>().ForMember(p => p.Id, e => e.Ignore()).ForMember(p => p.MergeState, e => e.Ignore()).ReverseMap();
-            CreateMap<PostMergeRequestInputDto, PostMergeRequest>().ForMember(p => p.Id, e => e.Ignore()).ForMember(p => p.MergeState, e => e.Ignore()).ReverseMap();
-            CreateMap<PostMergeRequestInputDto, Post>().ForMember(p => p.Id, e => e.Ignore()).ForMember(p => p.Status, e => e.Ignore()).ReverseMap();
-            CreateMap<PostMergeRequest, PostMergeRequestOutputDtoBase>().ForMember(p => p.PostTitle, e => e.MapFrom(r => r.Post.Title));
-            CreateMap<PostMergeRequest, PostMergeRequestOutputDto>().ForMember(p => p.PostTitle, e => e.MapFrom(r => r.Post.Title));
+            CreateMap<PostMergeRequestCommandBase, PostMergeRequest>().ForMember(p => p.Id, e => e.Ignore()).ForMember(p => p.MergeState, e => e.Ignore()).ReverseMap();
+            CreateMap<PostMergeRequestCommand, PostMergeRequest>().ForMember(p => p.Id, e => e.Ignore()).ForMember(p => p.MergeState, e => e.Ignore()).ReverseMap();
+            CreateMap<PostMergeRequestCommand, Post>().ForMember(p => p.Id, e => e.Ignore()).ForMember(p => p.Status, e => e.Ignore()).ReverseMap();
+            CreateMap<PostMergeRequest, PostMergeRequestDtoBase>().ForMember(p => p.PostTitle, e => e.MapFrom(r => r.Post.Title));
+            CreateMap<PostMergeRequest, PostMergeRequestDto>().ForMember(p => p.PostTitle, e => e.MapFrom(r => r.Post.Title));
             CreateMap<PostMergeRequest, Post>().ForMember(p => p.Id, e => e.Ignore()).ForMember(p => p.Status, e => e.Ignore()).ReverseMap();
-            CreateMap<Post, PostMergeRequestOutputDto>().ReverseMap();
+            CreateMap<Post, PostMergeRequestDto>().ReverseMap();
 
             CreateMap<Advertisement, AdvertisementViewModel>().ForMember(a => a.CategoryName, e => e.MapFrom(a => a.Category.Name));
             CreateMap<AdvertisementDto, Advertisement>().ForMember(a => a.CategoryId, e => e.MapFrom(d => string.IsNullOrEmpty(d.CategoryId) ? null : d.CategoryId)).ForMember(a => a.Status, e => e.Ignore()).ForMember(a => a.UpdateTime, e => e.MapFrom(a => DateTime.Now));

+ 2 - 2
src/Masuit.MyBlogs.Core/Controllers/AdminController.cs

@@ -64,9 +64,9 @@ namespace Masuit.MyBlogs.Core.Controllers
         public override void OnActionExecuting(ActionExecutingContext filterContext)
         {
             base.OnActionExecuting(filterContext);
-            var user = filterContext.HttpContext.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo);
+            var user = filterContext.HttpContext.Session.Get<UserInfoDto>(SessionKey.UserInfo);
 #if DEBUG
-            user = UserInfoService.GetByUsername("masuit").Mapper<UserInfoOutputDto>();
+            user = UserInfoService.GetByUsername("masuit").Mapper<UserInfoDto>();
             filterContext.HttpContext.Session.Set(SessionKey.UserInfo, user);
 #endif
             if (user == null && Request.Cookies.Any(x => x.Key == "username" || x.Key == "password")) //执行自动登录

+ 5 - 5
src/Masuit.MyBlogs.Core/Controllers/BaseController.cs

@@ -44,7 +44,7 @@ namespace Masuit.MyBlogs.Core.Controllers
 
         public IAdvertisementService AdsService { get; set; }
 
-        public UserInfoOutputDto CurrentUser => HttpContext.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo) ?? new UserInfoOutputDto();
+        public UserInfoDto CurrentUser => HttpContext.Session.Get<UserInfoDto>(SessionKey.UserInfo) ?? new UserInfoDto();
 
         /// <summary>
         /// 客户端的真实IP
@@ -94,9 +94,9 @@ namespace Masuit.MyBlogs.Core.Controllers
         {
             Stopwatch.Start();
             base.OnActionExecuting(filterContext);
-            var user = filterContext.HttpContext.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo);
+            var user = filterContext.HttpContext.Session.Get<UserInfoDto>(SessionKey.UserInfo);
 #if DEBUG
-            user = UserInfoService.GetByUsername("masuit").Mapper<UserInfoOutputDto>();
+            user = UserInfoService.GetByUsername("masuit").Mapper<UserInfoDto>();
             filterContext.HttpContext.Session.Set(SessionKey.UserInfo, user);
 #endif
             if (CommonHelper.SystemSettings.GetOrAdd("CloseSite", "false") == "true" && user?.IsAdmin != true)
@@ -157,10 +157,10 @@ namespace Masuit.MyBlogs.Core.Controllers
 
             #region 准备页面数据模型
 
-            ViewBag.menus = MenuService.GetQueryFromCache<MenuOutputDto>(m => m.Status == Status.Available).OrderBy(m => m.Sort).ToList(); //菜单
+            ViewBag.menus = MenuService.GetQueryFromCache<MenuDto>(m => m.Status == Status.Available).OrderBy(m => m.Sort).ToList(); //菜单
             var model = new PageFootViewModel //页脚
             {
-                Links = LinksService.GetQueryFromCache<LinksOutputDto>(l => l.Status == Status.Available).OrderByDescending(l => l.Recommend).ThenByDescending(l => l.Weight).ThenByDescending(l => new Random().Next()).Take(40).ToList()
+                Links = LinksService.GetQueryFromCache<LinksDto>(l => l.Status == Status.Available).OrderByDescending(l => l.Recommend).ThenByDescending(l => l.Weight).ThenByDescending(l => new Random().Next()).Take(40).ToList()
             };
             ViewBag.Footer = model;
 

+ 4 - 3
src/Masuit.MyBlogs.Core/Controllers/CategoryController.cs

@@ -8,6 +8,7 @@ using Masuit.MyBlogs.Core.Models.Enum;
 using Microsoft.AspNetCore.Mvc;
 using System.Linq;
 using System.Threading.Tasks;
+using Masuit.MyBlogs.Core.Models.Command;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {
@@ -28,7 +29,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         [ResponseCache(Duration = 600)]
         public ActionResult GetCategories()
         {
-            var list = CategoryService.GetQuery<string, CategoryOutputDto>(c => c.Status == Status.Available, c => c.Name).Cacheable().ToList();
+            var list = CategoryService.GetQuery<string, CategoryDto>(c => c.Status == Status.Available, c => c.Name).Cacheable().ToList();
             return ResultData(list);
         }
 
@@ -41,7 +42,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         public async Task<ActionResult> Get(int id)
         {
             var model = await CategoryService.GetByIdAsync(id) ?? throw new NotFoundException("分类不存在!");
-            return ResultData(model.Mapper<CategoryOutputDto>());
+            return ResultData(model.Mapper<CategoryDto>());
         }
 
         /// <summary>
@@ -70,7 +71,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
-        public async Task<ActionResult> Edit(CategoryInputDto dto)
+        public async Task<ActionResult> Edit(CategoryCommand dto)
         {
             Category cat = await CategoryService.GetByIdAsync(dto.Id) ?? throw new NotFoundException("分类不存在!");
             cat.Name = dto.Name;

+ 4 - 3
src/Masuit.MyBlogs.Core/Controllers/CommentController.cs

@@ -20,6 +20,7 @@ using System.IO;
 using System.Linq;
 using System.Text.RegularExpressions;
 using System.Threading.Tasks;
+using Masuit.MyBlogs.Core.Models.Command;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {
@@ -39,7 +40,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost, ValidateAntiForgeryToken]
-        public async Task<ActionResult> Put(CommentInputDto dto)
+        public async Task<ActionResult> Put(CommentCommand dto)
         {
             if (Regex.Match(dto.Content, CommonHelper.BanRegex).Length > 0)
             {
@@ -65,7 +66,7 @@ namespace Masuit.MyBlogs.Core.Controllers
             }
 
             comment.CommentDate = DateTime.Now;
-            var user = HttpContext.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo);
+            var user = HttpContext.Session.Get<UserInfoDto>(SessionKey.UserInfo);
             if (user != null)
             {
                 comment.NickName = user.NickName;
@@ -273,7 +274,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         [MyAuthorize]
         public ActionResult GetPendingComments(int page = 1, int size = 10)
         {
-            var list = CommentService.GetPages<DateTime, CommentOutputDto>(page, size, out int total, c => c.Status == Status.Pending, c => c.CommentDate, false).ToList();
+            var list = CommentService.GetPages<DateTime, CommentDto>(page, size, out int total, c => c.Status == Status.Pending, c => c.CommentDate, false).ToList();
             var pageCount = Math.Ceiling(total * 1.0 / size).ToInt32();
             return PageResult(list, pageCount, total);
         }

+ 11 - 11
src/Masuit.MyBlogs.Core/Controllers/HomeController.cs

@@ -55,7 +55,7 @@ namespace Masuit.MyBlogs.Core.Controllers
             ViewBag.Total = PostService.Count(p => p.Status == Status.Pended || CurrentUser.IsAdmin);
             var banners = AdsService.GetsByWeightedPrice(8, AdvertiseType.Banner).OrderBy(a => Guid.NewGuid()).ToList();
             var fastShares = FastShareService.GetAllFromCache(s => s.Sort).ToList();
-            var postsQuery = PostService.GetQuery<PostOutputDto>(p => (p.Status == Status.Pended || CurrentUser.IsAdmin)); //准备文章的查询
+            var postsQuery = PostService.GetQuery<PostDto>(p => (p.Status == Status.Pended || CurrentUser.IsAdmin)); //准备文章的查询
             var posts = postsQuery.Where(p => !p.IsFixedTop).OrderBy(OrderBy.ModifyDate.GetDisplay() + " desc").Take(15).Cacheable().ToList();
             var viewModel = GetIndexPageViewModel();
             viewModel.Banner = banners;
@@ -77,7 +77,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         {
             ViewBag.Total = PostService.Count(p => p.Status == Status.Pended || CurrentUser.IsAdmin && !p.IsFixedTop);
             var viewModel = GetIndexPageViewModel();
-            var postsQuery = PostService.GetQuery<PostOutputDto>(p => (p.Status == Status.Pended || CurrentUser.IsAdmin)); //准备文章的查询
+            var postsQuery = PostService.GetQuery<PostDto>(p => (p.Status == Status.Pended || CurrentUser.IsAdmin)); //准备文章的查询
             var posts = postsQuery.Where(p => !p.IsFixedTop).OrderBy((orderBy ?? OrderBy.ModifyDate).GetDisplay() + " desc").Skip(size * (page - 1)).Take(size).Cacheable().ToList();
             if (page == 1)
             {
@@ -100,8 +100,8 @@ namespace Masuit.MyBlogs.Core.Controllers
         [Route("tag/{id}/{page:int?}/{size:int?}/{orderBy:int?}"), ResponseCache(Duration = 600, VaryByQueryKeys = new[] { "id", "page", "size", "orderBy" }, VaryByHeader = "Cookie")]
         public ActionResult Tag(string id, [Optional]OrderBy? orderBy, [Range(1, int.MaxValue, ErrorMessage = "页码必须大于0")]int page = 1, [Range(1, int.MaxValue, ErrorMessage = "页大小必须大于0")]int size = 15)
         {
-            var temp = PostService.GetQuery<PostOutputDto>(p => p.Label.Contains(id) && (p.Status == Status.Pended || CurrentUser.IsAdmin));
-            var posts = temp.OrderBy($"{nameof(PostOutputDto.IsFixedTop)} desc,{(orderBy ?? OrderBy.ModifyDate).GetDisplay()} desc").Skip(size * (page - 1)).Take(size).Cacheable().ToList();
+            var temp = PostService.GetQuery<PostDto>(p => p.Label.Contains(id) && (p.Status == Status.Pended || CurrentUser.IsAdmin));
+            var posts = temp.OrderBy($"{nameof(PostDto.IsFixedTop)} desc,{(orderBy ?? OrderBy.ModifyDate).GetDisplay()} desc").Skip(size * (page - 1)).Take(size).Cacheable().ToList();
             var viewModel = GetIndexPageViewModel();
             ViewBag.Total = temp.Count();
             ViewBag.Tag = id;
@@ -123,8 +123,8 @@ namespace Masuit.MyBlogs.Core.Controllers
         {
             Expression<Func<Post, bool>> where = p => p.Author.Equals(author) || p.Modifier.Equals(author) || p.Email.Equals(author) || p.PostHistoryVersion.Any(v => v.Modifier.Equals(author) || v.ModifierEmail.Equals(author));
             where = where.And(p => p.Status == Status.Pended || CurrentUser.IsAdmin);
-            var temp = PostService.GetQuery<PostOutputDto>(where);
-            var posts = temp.OrderBy($"{nameof(PostOutputDto.IsFixedTop)} desc,{(orderBy ?? OrderBy.ModifyDate).GetDisplay()} desc").Skip(size * (page - 1)).Take(size).Cacheable().ToList();
+            var temp = PostService.GetQuery<PostDto>(where);
+            var posts = temp.OrderBy($"{nameof(PostDto.IsFixedTop)} desc,{(orderBy ?? OrderBy.ModifyDate).GetDisplay()} desc").Skip(size * (page - 1)).Take(size).Cacheable().ToList();
             var viewModel = GetIndexPageViewModel();
             ViewBag.Total = temp.Count();
             ViewBag.Author = author;
@@ -146,10 +146,10 @@ namespace Masuit.MyBlogs.Core.Controllers
         public async Task<ActionResult> Category(int id, [Optional]OrderBy? orderBy, [Range(1, int.MaxValue, ErrorMessage = "页码必须大于0")]int page = 1, [Range(1, int.MaxValue, ErrorMessage = "页大小必须大于0")]int size = 15)
         {
             var cat = await CategoryService.GetByIdAsync(id) ?? throw new NotFoundException("文章分类未找到");
-            var posts = PostService.GetQuery<PostOutputDto>(p => p.CategoryId == cat.Id && (p.Status == Status.Pended || CurrentUser.IsAdmin));
+            var posts = PostService.GetQuery<PostDto>(p => p.CategoryId == cat.Id && (p.Status == Status.Pended || CurrentUser.IsAdmin));
             ViewBag.Total = posts.Count();
             var viewModel = GetIndexPageViewModel();
-            viewModel.Posts = posts.OrderBy($"{nameof(PostOutputDto.IsFixedTop)} desc,{(orderBy ?? OrderBy.ModifyDate).GetDisplay()} desc").Skip(size * (page - 1)).Take(size).Cacheable().ToList();
+            viewModel.Posts = posts.OrderBy($"{nameof(PostDto.IsFixedTop)} desc,{(orderBy ?? OrderBy.ModifyDate).GetDisplay()} desc").Skip(size * (page - 1)).Take(size).Cacheable().ToList();
             ViewBag.CategoryName = cat.Name;
             ViewBag.Desc = cat.Description;
             ViewData["page"] = new Pagination(page, size, orderBy);
@@ -162,9 +162,9 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// <returns></returns>
         private IndexPageViewModel GetIndexPageViewModel()
         {
-            var postsQuery = PostService.GetQuery<PostOutputDto>(p => (p.Status == Status.Pended || CurrentUser.IsAdmin)); //准备文章的查询
-            var notices = NoticeService.GetPagesFromCache<DateTime, NoticeOutputDto>(1, 5, out _, n => (n.Status == Status.Display || CurrentUser.IsAdmin), n => n.ModifyDate, false).ToList(); //加载前5条公告
-            var cats = CategoryService.GetQueryFromCache<string, CategoryOutputDto>(c => c.Status == Status.Available, c => c.Name).ToList(); //加载分类目录
+            var postsQuery = PostService.GetQuery<PostDto>(p => (p.Status == Status.Pended || CurrentUser.IsAdmin)); //准备文章的查询
+            var notices = NoticeService.GetPagesFromCache<DateTime, NoticeDto>(1, 5, out _, n => (n.Status == Status.Display || CurrentUser.IsAdmin), n => n.ModifyDate, false).ToList(); //加载前5条公告
+            var cats = CategoryService.GetQueryFromCache<string, CategoryDto>(c => c.Status == Status.Available, c => c.Name).ToList(); //加载分类目录
             var hotSearches = RedisHelper.Get<List<KeywordsRank>>("SearchRank:Week").Take(10).ToList(); //热词统计
             var hot6Post = postsQuery.OrderBy((new Random().Next() % 3) switch
             {

+ 1 - 1
src/Masuit.MyBlogs.Core/Controllers/LinksController.cs

@@ -28,7 +28,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         [Route("links"), ResponseCache(Duration = 600, VaryByHeader = "Cookie")]
         public ActionResult Index()
         {
-            var list = LinksService.GetQueryFromCache<bool, LinksOutputDto>(l => l.Status == Status.Available, l => l.Recommend, false).ToList();
+            var list = LinksService.GetQueryFromCache<bool, LinksDto>(l => l.Status == Status.Available, l => l.Recommend, false).ToList();
             return CurrentUser.IsAdmin ? View("Index_Admin", list) : View(list);
         }
 

+ 2 - 1
src/Masuit.MyBlogs.Core/Controllers/MenuController.cs

@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Mvc;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using Masuit.MyBlogs.Core.Models.Command;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {
@@ -67,7 +68,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// </summary>
         /// <param name="model"></param>
         /// <returns></returns>
-        public ActionResult Save(MenuInputDto model)
+        public ActionResult Save(MenuCommand model)
         {
             if (string.IsNullOrEmpty(model.Icon) || !model.Icon.Contains("/"))
             {

+ 5 - 4
src/Masuit.MyBlogs.Core/Controllers/MergeController.cs

@@ -15,6 +15,7 @@ using System;
 using System.Linq;
 using System.Linq.Expressions;
 using System.Text.RegularExpressions;
+using Masuit.MyBlogs.Core.Models.Command;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {
@@ -33,7 +34,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         [HttpGet("{id}")]
         public ActionResult Get(int id)
         {
-            return ResultData(Mapper.Map<PostMergeRequestOutputDto>(PostMergeRequestService.GetById(id)));
+            return ResultData(Mapper.Map<PostMergeRequestDto>(PostMergeRequestService.GetById(id)));
         }
 
         /// <summary>
@@ -52,7 +53,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                 where = where.And(r => r.Title.Contains(kw) || r.Content.Contains(kw) || r.Modifier.Contains(kw) || r.ModifierEmail.Contains(kw));
             }
 
-            var list = PostMergeRequestService.GetQuery(where).OrderByDescending(d => d.MergeState == MergeStatus.Pending).ThenByDescending(r => r.Id).Skip((page - 1) * size).Take(size).ProjectTo<PostMergeRequestOutputDtoBase>(MapperConfig).ToList();
+            var list = PostMergeRequestService.GetQuery(where).OrderByDescending(d => d.MergeState == MergeStatus.Pending).ThenByDescending(r => r.Id).Skip((page - 1) * size).Take(size).ProjectTo<PostMergeRequestDtoBase>(MapperConfig).ToList();
             var count = PostMergeRequestService.Count(where);
             var pageCount = Math.Ceiling(count * 1.0 / size).ToInt32();
             return PageResult(list, pageCount, count);
@@ -72,7 +73,7 @@ namespace Masuit.MyBlogs.Core.Controllers
             string diffOutput = diffHelper.Build();
             old.Content = Regex.Replace(Regex.Replace(diffOutput, "<ins.+?</ins>", string.Empty), @"<\w+></\w+>", string.Empty);
             newer.Content = Regex.Replace(Regex.Replace(diffOutput, "<del.+?</del>", string.Empty), @"<\w+></\w+>", string.Empty);
-            return ResultData(new { old = old.Mapper<PostMergeRequestOutputDto>(), newer = newer.Mapper<PostMergeRequestOutputDto>() });
+            return ResultData(new { old = old.Mapper<PostMergeRequestDto>(), newer = newer.Mapper<PostMergeRequestDto>() });
         }
 
         /// <summary>
@@ -109,7 +110,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
-        public IActionResult Merge([FromForm]PostMergeRequestInputDtoBase dto)
+        public IActionResult Merge([FromForm]PostMergeRequestCommandBase dto)
         {
             var merge = PostMergeRequestService.GetById(dto.Id) ?? throw new NotFoundException("待合并文章未找到");
             Mapper.Map(dto, merge);

+ 1 - 1
src/Masuit.MyBlogs.Core/Controllers/MiscController.cs

@@ -190,7 +190,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         public ActionResult Get(int id)
         {
             var notice = MiscService.GetById(id);
-            return ResultData(notice.MapTo<MiscOutputDto>());
+            return ResultData(notice.MapTo<MiscDto>());
         }
     }
 }

+ 4 - 3
src/Masuit.MyBlogs.Core/Controllers/MsgController.cs

@@ -18,6 +18,7 @@ using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using System.Text.RegularExpressions;
+using Masuit.MyBlogs.Core.Models.Command;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {
@@ -104,7 +105,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost, ValidateAntiForgeryToken]
-        public ActionResult Put(LeaveMessageInputDto dto)
+        public ActionResult Put(LeaveMessageCommand dto)
         {
             if (Regex.Match(dto.Content, CommonHelper.BanRegex).Length > 0)
             {
@@ -124,7 +125,7 @@ namespace Masuit.MyBlogs.Core.Controllers
             }
 
             msg.PostDate = DateTime.Now;
-            var user = HttpContext.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo);
+            var user = HttpContext.Session.Get<UserInfoDto>(SessionKey.UserInfo);
             if (user != null)
             {
                 msg.NickName = user.NickName;
@@ -232,7 +233,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         [MyAuthorize]
         public ActionResult GetPendingMsgs(int page = 1, int size = 10)
         {
-            var list = LeaveMessageService.GetPages<DateTime, LeaveMessageOutputDto>(page, size, out int total, m => m.Status == Status.Pending, l => l.PostDate, false).ToList();
+            var list = LeaveMessageService.GetPages<DateTime, LeaveMessageDto>(page, size, out int total, m => m.Status == Status.Pending, l => l.PostDate, false).ToList();
             var pageCount = Math.Ceiling(total * 1.0 / size).ToInt32();
             return PageResult(list, pageCount, total);
         }

+ 4 - 4
src/Masuit.MyBlogs.Core/Controllers/NoticeController.cs

@@ -41,7 +41,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         [Route("notice"), ResponseCache(Duration = 600, VaryByQueryKeys = new[] { "page", "size" }, VaryByHeader = "Cookie")]
         public ActionResult Index(int page = 1, int size = 10)
         {
-            var list = NoticeService.GetPages<DateTime, NoticeOutputDto>(page, size, out var total, n => n.Status == Status.Display, n => n.ModifyDate, false).ToList();
+            var list = NoticeService.GetPages<DateTime, NoticeDto>(page, size, out var total, n => n.Status == Status.Display, n => n.ModifyDate, false).ToList();
             ViewBag.Total = total;
             ViewData["page"] = new Pagination(page, size);
             return CurrentUser.IsAdmin ? View("Index_Admin", list) : View(list);
@@ -141,7 +141,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         [MyAuthorize]
         public ActionResult Get(int id)
         {
-            return ResultData(NoticeService.Get<NoticeOutputDto>(n => n.Id == id));
+            return ResultData(NoticeService.Get<NoticeDto>(n => n.Id == id));
         }
 
         /// <summary>
@@ -159,7 +159,7 @@ namespace Masuit.MyBlogs.Core.Controllers
 
             if (Request.Cookies.TryGetValue("last-notice", out var json))
             {
-                var data = JsonConvert.DeserializeObject<NoticeOutputDto>(json);
+                var data = JsonConvert.DeserializeObject<NoticeDto>(json);
                 if (notice.Id == data.Id)
                 {
                     return ResultData(data);
@@ -168,7 +168,7 @@ namespace Masuit.MyBlogs.Core.Controllers
 
             notice.ViewCount += 1;
             NoticeService.SaveChanges();
-            var dto = notice.Mapper<NoticeOutputDto>();
+            var dto = notice.Mapper<NoticeDto>();
             Response.Cookies.Append("last-notice", dto.ToJsonString(), new CookieOptions()
             {
                 Expires = DateTime.Now.AddMonths(1)

+ 3 - 3
src/Masuit.MyBlogs.Core/Controllers/PassportController.cs

@@ -62,7 +62,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                 from = HttpUtility.UrlDecode(from);
                 Response.Cookies.Append("refer", from);
             }
-            if (HttpContext.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo) != null)
+            if (HttpContext.Session.Get<UserInfoDto>(SessionKey.UserInfo) != null)
             {
                 if (string.IsNullOrEmpty(from))
                 {
@@ -166,9 +166,9 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// <returns></returns>
         public ActionResult GetUserInfo()
         {
-            var user = HttpContext.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo);
+            var user = HttpContext.Session.Get<UserInfoDto>(SessionKey.UserInfo);
 #if DEBUG
-            user = UserInfoService.GetByUsername("masuit").Mapper<UserInfoOutputDto>();
+            user = UserInfoService.GetByUsername("masuit").Mapper<UserInfoDto>();
 #endif
 
             return ResultData(user);

+ 11 - 10
src/Masuit.MyBlogs.Core/Controllers/PostController.cs

@@ -34,6 +34,7 @@ using System.Linq.Dynamic.Core;
 using System.Linq.Expressions;
 using System.Text.RegularExpressions;
 using System.Threading.Tasks;
+using Masuit.MyBlogs.Core.Models.Command;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {
@@ -210,7 +211,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// <param name="code"></param>
         /// <returns></returns>
         [HttpPost, ValidateAntiForgeryToken]
-        public async Task<ActionResult> Publish(PostInputDto post, [Required(ErrorMessage = "验证码不能为空")]string code)
+        public async Task<ActionResult> Publish(PostCommand post, [Required(ErrorMessage = "验证码不能为空")]string code)
         {
             if (await RedisHelper.GetAsync("code:" + post.Email) != code)
             {
@@ -247,7 +248,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                 .Replace("{{time}}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
                 .Replace("{{title}}", p.Title);
             BackgroundJob.Enqueue(() => CommonHelper.SendMail(CommonHelper.SystemSettings["Title"] + "有访客投稿:", content, CommonHelper.SystemSettings["ReceiveEmail"]));
-            return ResultData(p.Mapper<PostOutputDto>(), message: "文章发表成功,待站长审核通过以后将显示到列表中!");
+            return ResultData(p.Mapper<PostDto>(), message: "文章发表成功,待站长审核通过以后将显示到列表中!");
         }
 
         /// <summary>
@@ -381,7 +382,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost("{id}/pushmerge")]
-        public ActionResult PushMerge(PostMergeRequestInputDto dto)
+        public ActionResult PushMerge(PostMergeRequestCommand dto)
         {
             if (RedisHelper.Get("code:" + dto.ModifierEmail) != dto.Code)
             {
@@ -582,7 +583,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         public ActionResult Get(int id)
         {
             Post post = PostService.GetById(id) ?? throw new NotFoundException("文章未找到");
-            PostOutputDto model = post.Mapper<PostOutputDto>();
+            PostDto model = post.Mapper<PostDto>();
             model.Seminars = post.Seminar.Select(s => s.Seminar.Title).Join(",");
             return ResultData(model);
         }
@@ -593,7 +594,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// <param name="id"></param>
         /// <returns></returns>
         [MyAuthorize]
-        public ActionResult Read(int id) => ResultData(PostService.GetById(id).Mapper<PostOutputDto>());
+        public ActionResult Read(int id) => ResultData(PostService.GetById(id).Mapper<PostDto>());
 
         /// <summary>
         /// 获取文章分页
@@ -650,7 +651,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// <param name="reserve"></param>
         /// <returns></returns>
         [HttpPost, MyAuthorize]
-        public async Task<ActionResult> Edit(PostInputDto post, bool notify = true, bool reserve = true)
+        public async Task<ActionResult> Edit(PostCommand post, bool notify = true, bool reserve = true)
         {
             post.Content = await ImagebedClient.ReplaceImgSrc(post.Content.Trim().ClearImgAttributes());
             if (!CategoryService.Any(c => c.Id == post.CategoryId && c.Status == Status.Available))
@@ -683,7 +684,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                 var history = p.Mapper<PostHistoryVersion>();
                 p.PostHistoryVersion.Add(history);
                 p.ModifyDate = DateTime.Now;
-                var user = HttpContext.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo);
+                var user = HttpContext.Session.Get<UserInfoDto>(SessionKey.UserInfo);
                 p.Modifier = user.NickName;
                 p.ModifierEmail = user.Email;
             }
@@ -742,7 +743,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                 });
             }
 #endif
-            return ResultData(p.Mapper<PostOutputDto>(), message: "文章修改成功!");
+            return ResultData(p.Mapper<PostDto>(), message: "文章修改成功!");
         }
 
         /// <summary>
@@ -753,7 +754,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         /// <param name="schedule"></param>
         /// <returns></returns>
         [MyAuthorize, HttpPost]
-        public async Task<ActionResult> Write(PostInputDto post, DateTime? timespan, bool schedule = false)
+        public async Task<ActionResult> Write(PostCommand post, DateTime? timespan, bool schedule = false)
         {
             post.Content = await ImagebedClient.ReplaceImgSrc(post.Content.Trim().ClearImgAttributes());
             if (!CategoryService.Any(c => c.Id == post.CategoryId && c.Status == Status.Available))
@@ -813,7 +814,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                 p.PostDate = timespan.Value;
                 p.ModifyDate = timespan.Value;
                 HangfireHelper.CreateJob(typeof(IHangfireBackJob), nameof(HangfireBackJob.PublishPost), args: p);
-                return ResultData(p.Mapper<PostOutputDto>(), message: $"文章于{timespan.Value:yyyy-MM-dd HH:mm:ss}将会自动发表!");
+                return ResultData(p.Mapper<PostDto>(), message: $"文章于{timespan.Value:yyyy-MM-dd HH:mm:ss}将会自动发表!");
             }
 
             PostService.AddEntity(p);

+ 2 - 2
src/Masuit.MyBlogs.Core/Controllers/SearchController.cs

@@ -39,7 +39,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         [Route("s/{wd?}/{page:int?}/{size:int?}")]
         public ActionResult Search(string wd = "", int page = 1, int size = 15)
         {
-            var nul = new List<PostOutputDto>();
+            var nul = new List<PostDto>();
             ViewBag.Elapsed = 0;
             ViewBag.Total = 0;
             ViewBag.PageSize = size;
@@ -99,7 +99,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         public ActionResult SearchList(int page = 1, int size = 10, string search = "")
         {
             var where = string.IsNullOrEmpty(search) ? (Expression<Func<SearchDetails, bool>>)(s => true) : s => s.KeyWords.Contains(search);
-            var list = SearchDetailsService.GetPages<DateTime, SearchDetailsOutputDto>(page, size, out int total, where, s => s.SearchTime, false).ToList();
+            var list = SearchDetailsService.GetPages<DateTime, SearchDetailsDto>(page, size, out int total, where, s => s.SearchTime, false).ToList();
             var pageCount = Math.Ceiling(total * 1.0 / size).ToInt32();
             return PageResult(list, pageCount, total);
         }

+ 4 - 4
src/Masuit.MyBlogs.Core/Controllers/SeminarController.cs

@@ -45,7 +45,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         public ActionResult Index(int id, [Optional]OrderBy? orderBy, int page = 1, int size = 15)
         {
             var s = SeminarService.GetById(id) ?? throw new NotFoundException("文章未找到");
-            var temp = PostService.GetQuery<PostOutputDto>(p => p.Seminar.Any(x => x.SeminarId == id) && (p.Status == Status.Pended || CurrentUser.IsAdmin));
+            var temp = PostService.GetQuery<PostDto>(p => p.Seminar.Any(x => x.SeminarId == id) && (p.Status == Status.Pended || CurrentUser.IsAdmin));
             var posts = temp.OrderBy($"{nameof(Post.IsFixedTop)} desc,{(orderBy ?? OrderBy.ModifyDate).GetDisplay()} desc").Skip(size * (page - 1)).Take(size).ToList();
             ViewBag.Total = temp.Count();
             ViewBag.Title = s.Title;
@@ -123,7 +123,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         public ActionResult Get(int id)
         {
             Seminar seminar = SeminarService.GetById(id);
-            return ResultData(seminar.Mapper<SeminarOutputDto>());
+            return ResultData(seminar.Mapper<SeminarDto>());
         }
 
         /// <summary>
@@ -135,7 +135,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         [MyAuthorize]
         public ActionResult GetPageData(int page, int size)
         {
-            var list = SeminarService.GetPages<int, SeminarOutputDto>(page, size, out int total, s => true, s => s.Id, false).ToList();
+            var list = SeminarService.GetPages<int, SeminarDto>(page, size, out int total, s => true, s => s.Id, false).ToList();
             var pageCount = Math.Ceiling(total * 1.0 / size).ToInt32();
             return PageResult(list, pageCount, total);
         }
@@ -147,7 +147,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         [MyAuthorize]
         public ActionResult GetAll()
         {
-            var list = SeminarService.GetAll<string, SeminarOutputDto>(s => s.Title).ToList();
+            var list = SeminarService.GetAll<string, SeminarDto>(s => s.Title).ToList();
             return ResultData(list);
         }
 

+ 1 - 1
src/Masuit.MyBlogs.Core/Controllers/UploadController.cs

@@ -169,7 +169,7 @@ namespace Masuit.MyBlogs.Core.Controllers
         [Route("fileuploader")]
         public ActionResult UeditorFileUploader()
         {
-            UserInfoOutputDto user = HttpContext.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo) ?? new UserInfoOutputDto();
+            UserInfoDto user = HttpContext.Session.Get<UserInfoDto>(SessionKey.UserInfo) ?? new UserInfoDto();
             var action = Request.Query["action"].ToString() switch //通用
             {
                 "config" => (Handler)new ConfigHandler(HttpContext),

+ 3 - 3
src/Masuit.MyBlogs.Core/Controllers/UserController.cs

@@ -25,7 +25,7 @@ namespace Masuit.MyBlogs.Core.Controllers
 
             userInfo.Username = username;
             bool b = UserInfoService.SaveChanges() > 0;
-            return ResultData(Mapper.Map<UserInfoOutputDto>(userInfo), b, b ? $"用户名修改成功,新用户名为{username}。" : "用户名修改失败!");
+            return ResultData(Mapper.Map<UserInfoDto>(userInfo), b, b ? $"用户名修改成功,新用户名为{username}。" : "用户名修改失败!");
         }
 
         /// <summary>
@@ -39,7 +39,7 @@ namespace Masuit.MyBlogs.Core.Controllers
             UserInfo userInfo = UserInfoService.GetById(id);
             userInfo.NickName = username;
             bool b = UserInfoService.SaveChanges() > 0;
-            return ResultData(Mapper.Map<UserInfoOutputDto>(userInfo), b, b ? $"昵称修改成功,新昵称为{username}。" : "昵称修改失败!");
+            return ResultData(Mapper.Map<UserInfoDto>(userInfo), b, b ? $"昵称修改成功,新昵称为{username}。" : "昵称修改失败!");
         }
 
         /// <summary>
@@ -72,7 +72,7 @@ namespace Masuit.MyBlogs.Core.Controllers
             UserInfo userInfo = UserInfoService.GetById(id);
             userInfo.Avatar = path;
             bool b = UserInfoService.SaveChanges() > 0;
-            return ResultData(Mapper.Map<UserInfoOutputDto>(userInfo), b, b ? $"头像修改成功。" : "头像修改失败!");
+            return ResultData(Mapper.Map<UserInfoDto>(userInfo), b, b ? $"头像修改成功。" : "头像修改失败!");
         }
     }
 }

+ 1 - 1
src/Masuit.MyBlogs.Core/Extensions/Hangfire/HangfireBackJob.cs

@@ -62,7 +62,7 @@ namespace Masuit.MyBlogs.Core.Extensions.Hangfire
         /// <param name="userInfo"></param>
         /// <param name="ip"></param>
         /// <param name="type"></param>
-        public void LoginRecord(UserInfoOutputDto userInfo, string ip, LoginType type)
+        public void LoginRecord(UserInfoDto userInfo, string ip, LoginType type)
         {
             var result = ip.GetPhysicsAddressInfo().Result;
             if (result?.Status != 0)

+ 1 - 1
src/Masuit.MyBlogs.Core/Extensions/Hangfire/IHangfireBackJob.cs

@@ -15,7 +15,7 @@ namespace Masuit.MyBlogs.Core.Extensions.Hangfire
         /// <param name="userInfo"></param>
         /// <param name="ip"></param>
         /// <param name="type"></param>
-        void LoginRecord(UserInfoOutputDto userInfo, string ip, LoginType type);
+        void LoginRecord(UserInfoDto userInfo, string ip, LoginType type);
 
         /// <summary>
         /// 文章定时发表

+ 5 - 2
src/Masuit.MyBlogs.Core/Extensions/MiddlewareExtension.cs

@@ -55,11 +55,14 @@ namespace Masuit.MyBlogs.Core.Extensions
         /// <returns></returns>
         public static IServiceCollection AddMyMvc(this IServiceCollection services)
         {
-            services.AddMvc().AddNewtonsoftJson(options =>
+            services.AddMvc(options =>
+            {
+                options.ReturnHttpNotAcceptable = true;
+            }).AddNewtonsoftJson(options =>
             {
                 options.SerializerSettings.ContractResolver = new DefaultContractResolver();
                 options.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Local; // 设置时区为 UTC
-            }).AddControllersAsServices().AddViewComponentsAsServices().AddTagHelpersAsServices(); // MVC
+            }).AddXmlDataContractSerializerFormatters().AddControllersAsServices().AddViewComponentsAsServices().AddTagHelpersAsServices(); // MVC
             services.Configure<WebEncoderOptions>(options =>
             {
                 options.TextEncoderSettings = new TextEncoderSettings(UnicodeRanges.All);

+ 1 - 1
src/Masuit.MyBlogs.Core/Extensions/MyAuthorizeAttribute.cs

@@ -29,7 +29,7 @@ namespace Masuit.MyBlogs.Core.Extensions
                 return;
             }
 #if !DEBUG
-            UserInfoOutputDto user = filterContext.HttpContext.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo);
+            UserInfoDto user = filterContext.HttpContext.Session.Get<UserInfoDto>(SessionKey.UserInfo);
             if (user != null && user.IsAdmin)
             {
                 return;

+ 1 - 1
src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IPostService.cs

@@ -7,7 +7,7 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Services.Interface
 {
     public partial interface IPostService : IBaseService<Post>
     {
-        SearchResult<PostOutputDto> SearchPage(int page, int size, string keyword);
+        SearchResult<PostDto> SearchPage(int page, int size, string keyword);
 
         /// <summary>
         /// 统一保存的方法

+ 1 - 1
src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IUserInfoService.cs

@@ -18,7 +18,7 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Services.Interface
         /// <param name="username"></param>
         /// <param name="password"></param>
         /// <returns></returns>
-        UserInfoOutputDto Login(string username, string password);
+        UserInfoDto Login(string username, string password);
 
         /// <summary>
         /// 注册

+ 7 - 7
src/Masuit.MyBlogs.Core/Infrastructure/Services/PostService.cs

@@ -22,14 +22,14 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Services
 {
     public partial class PostService : BaseService<Post>, IPostService
     {
-        private readonly ICacheManager<SearchResult<PostOutputDto>> _cacheManager;
+        private readonly ICacheManager<SearchResult<PostDto>> _cacheManager;
 
-        public PostService(IPostRepository repository, ISearchEngine<DataContext> searchEngine, ILuceneIndexSearcher searcher, ICacheManager<SearchResult<PostOutputDto>> cacheManager) : base(repository, searchEngine, searcher)
+        public PostService(IPostRepository repository, ISearchEngine<DataContext> searchEngine, ILuceneIndexSearcher searcher, ICacheManager<SearchResult<PostDto>> cacheManager) : base(repository, searchEngine, searcher)
         {
             _cacheManager = cacheManager;
         }
 
-        public SearchResult<PostOutputDto> SearchPage(int page, int size, string keyword)
+        public SearchResult<PostDto> SearchPage(int page, int size, string keyword)
         {
             var cacheKey = $"search:{keyword}:{page}:{size}";
             if (_cacheManager.Exists(cacheKey))
@@ -40,10 +40,10 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Services
             var searchResult = _searchEngine.ScoredSearch<Post>(BuildSearchOptions(page, size, keyword));
             var entities = searchResult.Results.Where(s => s.Entity.Status == Status.Pended).ToList();
             var ids = entities.Select(s => s.Entity.Id).ToArray();
-            var dic = GetQuery<PostOutputDto>(p => ids.Contains(p.Id)).ToDictionary(p => p.Id);
+            var dic = GetQuery<PostDto>(p => ids.Contains(p.Id)).ToDictionary(p => p.Id);
             var posts = entities.Select(s =>
             {
-                var item = s.Entity.Mapper<PostOutputDto>();
+                var item = s.Entity.Mapper<PostDto>();
                 if (dic.ContainsKey(item.Id))
                 {
                     item.CategoryName = dic[item.Id].CategoryName;
@@ -60,7 +60,7 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Services
             var keywords = _searcher.CutKeywords(keyword);
             HighlightSegment(posts, keywords, highlighter);
 
-            var result = new SearchResult<PostOutputDto>()
+            var result = new SearchResult<PostDto>()
             {
                 Results = posts,
                 Elapsed = searchResult.Elapsed,
@@ -78,7 +78,7 @@ namespace Masuit.MyBlogs.Core.Infrastructure.Services
         /// <param name="posts"></param>
         /// <param name="keywords"></param>
         /// <param name="highlighter"></param>
-        private static void HighlightSegment(List<PostOutputDto> posts, List<string> keywords, Highlighter highlighter)
+        private static void HighlightSegment(List<PostDto> posts, List<string> keywords, Highlighter highlighter)
         {
             foreach (var p in posts)
             {

+ 5 - 7
src/Masuit.MyBlogs.Core/Infrastructure/Services/UserInfoService.cs

@@ -1,17 +1,15 @@
-using Masuit.LuceneEFCore.SearchEngine.Interfaces;
+using System;
+using Masuit.LuceneEFCore.SearchEngine.Interfaces;
 using Masuit.MyBlogs.Core.Common;
-using Masuit.MyBlogs.Core.Infrastructure;
 using Masuit.MyBlogs.Core.Infrastructure.Repository.Interface;
-using Masuit.MyBlogs.Core.Infrastructure.Services;
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.Tools;
 using Masuit.Tools.DateTimeExt;
 using Masuit.Tools.Security;
-using System;
 
-namespace Service
+namespace Masuit.MyBlogs.Core.Infrastructure.Services
 {
     public partial class UserInfoService : BaseService<UserInfo>, IUserInfoService
     {
@@ -31,12 +29,12 @@ namespace Service
         /// <param name="username"></param>
         /// <param name="password"></param>
         /// <returns></returns>
-        public UserInfoOutputDto Login(string username, string password)
+        public UserInfoDto Login(string username, string password)
         {
             UserInfo userInfo = GetByUsername(username);
             if (userInfo != null)
             {
-                UserInfoOutputDto user = userInfo.Mapper<UserInfoOutputDto>();
+                UserInfoDto user = userInfo.Mapper<UserInfoDto>();
                 string key = userInfo.SaltKey;
                 string pwd = userInfo.Password;
                 password = password.MDString3(key);

+ 4 - 4
src/Masuit.MyBlogs.Core/Models/DTO/BroadcastInputDto.cs → src/Masuit.MyBlogs.Core/Models/Command/BroadcastCommand.cs

@@ -1,16 +1,16 @@
+using System;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
 using Masuit.Tools.Core.Validator;
-using System;
 
-namespace Masuit.MyBlogs.Core.Models.DTO
+namespace Masuit.MyBlogs.Core.Models.Command
 {
     /// <summary>
     /// ·Ã¿Í¶©Ôıí
     /// </summary>
-    public class BroadcastInputDto : BaseEntity
+    public class BroadcastCommand : BaseEntity
     {
-        public BroadcastInputDto()
+        public BroadcastCommand()
         {
             Status = Status.Subscribing;
             UpdateTime = DateTime.Now;

+ 4 - 4
src/Masuit.MyBlogs.Core/Models/DTO/CategoryInputDto.cs → src/Masuit.MyBlogs.Core/Models/Command/CategoryCommand.cs

@@ -1,15 +1,15 @@
+using System.ComponentModel.DataAnnotations;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
-using System.ComponentModel.DataAnnotations;
 
-namespace Masuit.MyBlogs.Core.Models.DTO
+namespace Masuit.MyBlogs.Core.Models.Command
 {
     /// <summary>
     /// ÎÄÕ·ÖÀàÊäÈëÄ£ÐÍ
     /// </summary>
-    public class CategoryInputDto : BaseEntity
+    public class CategoryCommand : BaseEntity
     {
-        public CategoryInputDto()
+        public CategoryCommand()
         {
             Status = Status.Available;
         }

+ 4 - 4
src/Masuit.MyBlogs.Core/Models/DTO/CommentInputDto.cs → src/Masuit.MyBlogs.Core/Models/Command/CommentCommand.cs

@@ -1,17 +1,17 @@
+using System.ComponentModel.DataAnnotations;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
 using Masuit.MyBlogs.Core.Models.Validation;
 using Masuit.Tools.Core.Validator;
-using System.ComponentModel.DataAnnotations;
 
-namespace Masuit.MyBlogs.Core.Models.DTO
+namespace Masuit.MyBlogs.Core.Models.Command
 {
     /// <summary>
     /// ÆÀÂÛ±íÊäÈëÄ£ÐÍ
     /// </summary>
-    public class CommentInputDto : BaseEntity
+    public class CommentCommand : BaseEntity
     {
-        public CommentInputDto()
+        public CommentCommand()
         {
             Status = Status.Pending;
         }

+ 4 - 4
src/Masuit.MyBlogs.Core/Models/DTO/LeaveMessageInputDto.cs → src/Masuit.MyBlogs.Core/Models/Command/LeaveMessageCommand.cs

@@ -1,17 +1,17 @@
+using System.ComponentModel.DataAnnotations;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
 using Masuit.MyBlogs.Core.Models.Validation;
 using Masuit.Tools.Core.Validator;
-using System.ComponentModel.DataAnnotations;
 
-namespace Masuit.MyBlogs.Core.Models.DTO
+namespace Masuit.MyBlogs.Core.Models.Command
 {
     /// <summary>
     /// ÁôÑÔ°åÊäÈëÄ£ÐÍ
     /// </summary>
-    public class LeaveMessageInputDto : BaseEntity
+    public class LeaveMessageCommand : BaseEntity
     {
-        public LeaveMessageInputDto()
+        public LeaveMessageCommand()
         {
             Status = Status.Pending;
         }

+ 4 - 4
src/Masuit.MyBlogs.Core/Models/DTO/LinksInputDto.cs → src/Masuit.MyBlogs.Core/Models/Command/LinksCommand.cs

@@ -1,15 +1,15 @@
+using System.ComponentModel.DataAnnotations;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
-using System.ComponentModel.DataAnnotations;
 
-namespace Masuit.MyBlogs.Core.Models.DTO
+namespace Masuit.MyBlogs.Core.Models.Command
 {
     /// <summary>
     /// ÓÑÇéÁ´½Ó
     /// </summary>
-    public class LinksInputDto : BaseEntity
+    public class LinksCommand : BaseEntity
     {
-        public LinksInputDto()
+        public LinksCommand()
         {
             Status = Status.Available;
             Except = false;

+ 5 - 5
src/Masuit.MyBlogs.Core/Models/DTO/MenuInputDto.cs → src/Masuit.MyBlogs.Core/Models/Command/MenuCommand.cs

@@ -1,16 +1,16 @@
-using Masuit.MyBlogs.Core.Models.Entity;
-using Masuit.MyBlogs.Core.Models.Enum;
 using System.ComponentModel;
 using System.ComponentModel.DataAnnotations;
+using Masuit.MyBlogs.Core.Models.Entity;
+using Masuit.MyBlogs.Core.Models.Enum;
 
-namespace Masuit.MyBlogs.Core.Models.DTO
+namespace Masuit.MyBlogs.Core.Models.Command
 {
     /// <summary>
     /// µ¼º½²Ëµ¥ÊäÈëÄ£ÐÍ
     /// </summary>
-    public class MenuInputDto : BaseEntity
+    public class MenuCommand : BaseEntity
     {
-        public MenuInputDto()
+        public MenuCommand()
         {
             ParentId = 0;
             Status = Status.Available;

+ 4 - 4
src/Masuit.MyBlogs.Core/Models/DTO/MiscInputDto.cs → src/Masuit.MyBlogs.Core/Models/Command/MiscCommand.cs

@@ -1,16 +1,16 @@
+using System.ComponentModel.DataAnnotations;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
 using Masuit.MyBlogs.Core.Models.Validation;
-using System.ComponentModel.DataAnnotations;
 
-namespace Masuit.MyBlogs.Core.Models.DTO
+namespace Masuit.MyBlogs.Core.Models.Command
 {
     /// <summary>
     /// ÔÓÏîÒ³ÊäÈëÄ£ÐÍ
     /// </summary>
-    public class MiscInputDto : BaseEntity
+    public class MiscCommand : BaseEntity
     {
-        public MiscInputDto()
+        public MiscCommand()
         {
             Status = Status.Display;
         }

+ 9 - 0
src/Masuit.MyBlogs.Core/Models/Command/NoticeCommand.cs

@@ -0,0 +1,9 @@
+namespace Masuit.MyBlogs.Core.Models.Command
+{
+    /// <summary>
+    /// ÍøÕ¾¹«¸æÊäÈëÄ£ÐÍ
+    /// </summary>
+    public class NoticeCommand : MiscCommand
+    {
+    }
+}

+ 3 - 3
src/Masuit.MyBlogs.Core/Models/DTO/PostMergeRequestInputDto.cs → src/Masuit.MyBlogs.Core/Models/Command/PostMergeRequestCommand.cs

@@ -1,12 +1,12 @@
-using Masuit.Tools.Core.Validator;
 using System.ComponentModel.DataAnnotations;
+using Masuit.Tools.Core.Validator;
 
-namespace Masuit.MyBlogs.Core.Models.DTO
+namespace Masuit.MyBlogs.Core.Models.Command
 {
     /// <summary>
     /// ÎÄÕÂÐÞ¸ÄÇëÇó
     /// </summary>
-    public class PostMergeRequestInputDto : PostMergeRequestInputDtoBase
+    public class PostMergeRequestCommand : PostMergeRequestCommandBase
     {
         /// <summary>
         /// ÎÄÕÂid

+ 3 - 2
src/Masuit.MyBlogs.Core/Models/DTO/PostMergeRequestInputDtoBase.cs → src/Masuit.MyBlogs.Core/Models/Command/PostMergeRequestCommandBase.cs

@@ -1,12 +1,13 @@
 using System.ComponentModel.DataAnnotations;
+using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Validation;
 
-namespace Masuit.MyBlogs.Core.Models.DTO
+namespace Masuit.MyBlogs.Core.Models.Command
 {
     /// <summary>
     /// ÎÄÕÂÐÞ¸ÄÇëÇó
     /// </summary>
-    public class PostMergeRequestInputDtoBase : BaseDto
+    public class PostMergeRequestCommandBase : BaseDto
     {
         /// <summary>
         /// ±êÌâ

+ 3 - 3
src/Masuit.MyBlogs.Core/Models/DTO/SearchDetailsInputDto.cs → src/Masuit.MyBlogs.Core/Models/Command/SearchDetailsCommand.cs

@@ -1,14 +1,14 @@
 using System;
 using System.ComponentModel.DataAnnotations;
 
-namespace Masuit.MyBlogs.Core.Models.DTO
+namespace Masuit.MyBlogs.Core.Models.Command
 {
     /// <summary>
     /// ËÑË÷Ïêϸ¼Ç¼ÊäÈëÄ£ÐÍ
     /// </summary>
-    public class SearchDetailsInputDto
+    public class SearchDetailsCommand
     {
-        public SearchDetailsInputDto()
+        public SearchDetailsCommand()
         {
             SearchTime = DateTime.Now;
         }

+ 3 - 2
src/Masuit.MyBlogs.Core/Models/DTO/SeminarInputDto.cs → src/Masuit.MyBlogs.Core/Models/Command/SeminarCommand.cs

@@ -1,11 +1,12 @@
 using System.ComponentModel.DataAnnotations;
+using Masuit.MyBlogs.Core.Models.DTO;
 
-namespace Masuit.MyBlogs.Core.Models.DTO
+namespace Masuit.MyBlogs.Core.Models.Command
 {
     /// <summary>
     /// 文章专题输入模型
     /// </summary>
-    public partial class SeminarInputDto : BaseDto
+    public partial class SeminarCommand : BaseDto
     {
         /// <summary>
         /// 专题名称

+ 5 - 4
src/Masuit.MyBlogs.Core/Models/DTO/UserInfoInputDto.cs → src/Masuit.MyBlogs.Core/Models/Command/UserInfoCommand.cs

@@ -1,15 +1,16 @@
-using Masuit.Tools.Core.Validator;
 using System.ComponentModel;
 using System.ComponentModel.DataAnnotations;
+using Masuit.MyBlogs.Core.Models.DTO;
+using Masuit.Tools.Core.Validator;
 
-namespace Masuit.MyBlogs.Core.Models.DTO
+namespace Masuit.MyBlogs.Core.Models.Command
 {
     /// <summary>
     /// Óû§ÐÅÏ¢ÊäÈëÄ£ÐÍ
     /// </summary>
-    public class UserInfoInputDto : BaseDto
+    public class UserInfoCommand : BaseDto
     {
-        public UserInfoInputDto()
+        public UserInfoCommand()
         {
             IsAdmin = false;
         }

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/DTO/BroadcastOutputDto.cs → src/Masuit.MyBlogs.Core/Models/DTO/BroadcastDto.cs

@@ -3,7 +3,7 @@ using System;
 
 namespace Masuit.MyBlogs.Core.Models.DTO
 {
-    public class BroadcastOutputDto : BaseDto
+    public class BroadcastDto : BaseDto
     {
         /// <summary>
         /// 订阅接收邮箱

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/DTO/CategoryOutputDto.cs → src/Masuit.MyBlogs.Core/Models/DTO/CategoryDto.cs

@@ -3,7 +3,7 @@
     /// <summary>
     /// 文章分类输出模型
     /// </summary>
-    public class CategoryOutputDto : BaseDto
+    public class CategoryDto : BaseDto
     {
         /// <summary>
         /// 分类名

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/DTO/CommentOutputDto.cs → src/Masuit.MyBlogs.Core/Models/DTO/CommentDto.cs

@@ -5,7 +5,7 @@ namespace Masuit.MyBlogs.Core.Models.DTO
     /// <summary>
     /// 文章评论输出模型
     /// </summary>
-    public class CommentOutputDto : BaseDto
+    public class CommentDto : BaseDto
     {
         /// <summary>
         /// 昵称

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/DTO/LeaveMessageOutputDto.cs → src/Masuit.MyBlogs.Core/Models/DTO/LeaveMessageDto.cs

@@ -5,7 +5,7 @@ namespace Masuit.MyBlogs.Core.Models.DTO
     /// <summary>
     /// 留言板输出模型
     /// </summary>
-    public class LeaveMessageOutputDto : BaseDto
+    public class LeaveMessageDto : BaseDto
     {
         /// <summary>
         /// 昵称

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/DTO/LinksOutputDto.cs → src/Masuit.MyBlogs.Core/Models/DTO/LinksDto.cs

@@ -3,7 +3,7 @@
     /// <summary>
     /// 友情链接输出模型
     /// </summary>
-    public class LinksOutputDto : BaseDto
+    public class LinksDto : BaseDto
     {
         /// <summary>
         /// 名字

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/DTO/MenuOutputDto.cs → src/Masuit.MyBlogs.Core/Models/DTO/MenuDto.cs

@@ -5,7 +5,7 @@ namespace Masuit.MyBlogs.Core.Models.DTO
     /// <summary>
     /// 导航菜单输出模型
     /// </summary>
-    public class MenuOutputDto : BaseDto
+    public class MenuDto : BaseDto
     {
         /// <summary>
         /// 名字

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/DTO/MiscOutputDto.cs → src/Masuit.MyBlogs.Core/Models/DTO/MiscDto.cs

@@ -5,7 +5,7 @@ namespace Masuit.MyBlogs.Core.Models.DTO
     /// <summary>
     /// 杂项页输出模型
     /// </summary>
-    public class MiscOutputDto : BaseDto
+    public class MiscDto : BaseDto
     {
         /// <summary>
         /// 标题

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/DTO/NoticeOutputDto.cs → src/Masuit.MyBlogs.Core/Models/DTO/NoticeDto.cs

@@ -5,7 +5,7 @@ namespace Masuit.MyBlogs.Core.Models.DTO
     /// <summary>
     /// 网站公告输出模型
     /// </summary>
-    public class NoticeOutputDto : BaseDto
+    public class NoticeDto : BaseDto
     {
         /// <summary>
         /// 标题

+ 0 - 9
src/Masuit.MyBlogs.Core/Models/DTO/NoticeInputDto.cs

@@ -1,9 +0,0 @@
-namespace Masuit.MyBlogs.Core.Models.DTO
-{
-    /// <summary>
-    /// ÍøÕ¾¹«¸æÊäÈëÄ£ÐÍ
-    /// </summary>
-    public class NoticeInputDto : MiscInputDto
-    {
-    }
-}

+ 2 - 2
src/Masuit.MyBlogs.Core/Models/DTO/PostInputDto.cs → src/Masuit.MyBlogs.Core/Models/DTO/PostCommand.cs

@@ -9,9 +9,9 @@ namespace Masuit.MyBlogs.Core.Models.DTO
     /// <summary>
     /// ÎÄŐÂĘäČëÄŁĐÍ
     /// </summary>
-    public class PostInputDto : BaseEntity
+    public class PostCommand : BaseEntity
     {
-        public PostInputDto()
+        public PostCommand()
         {
             Status = Status.Pending;
         }

+ 2 - 2
src/Masuit.MyBlogs.Core/Models/DTO/PostOutputDto.cs → src/Masuit.MyBlogs.Core/Models/DTO/PostDto.cs

@@ -5,7 +5,7 @@ namespace Masuit.MyBlogs.Core.Models.DTO
     /// <summary>
     /// 文章实体输出模型
     /// </summary>
-    public class PostOutputDto : BaseDto
+    public class PostDto : BaseDto
     {
         /// <summary>
         /// 标题
@@ -90,7 +90,7 @@ namespace Masuit.MyBlogs.Core.Models.DTO
         ///// <summary>
         ///// 评论
         ///// </summary>
-        //public virtual ICollection<CommentOutputDto> Comment { get; set; }
+        //public virtual ICollection<CommentDto> Comment { get; set; }
 
         /// <summary>
         /// 评论数

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/DTO/PostMergeRequestOutputDto.cs → src/Masuit.MyBlogs.Core/Models/DTO/PostMergeRequestDto.cs

@@ -3,7 +3,7 @@ namespace Masuit.MyBlogs.Core.Models.DTO
     /// <summary>
     /// ÎÄÕÂÐÞ¸ÄÇëÇó
     /// </summary>
-    public class PostMergeRequestOutputDto : PostMergeRequestOutputDtoBase
+    public class PostMergeRequestDto : PostMergeRequestDtoBase
     {
         /// <summary>
         /// ÎÄÕÂÄÚÈÝ

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/DTO/PostMergeRequestOutputDtoBase.cs → src/Masuit.MyBlogs.Core/Models/DTO/PostMergeRequestDtoBase.cs

@@ -6,7 +6,7 @@ namespace Masuit.MyBlogs.Core.Models.DTO
     /// <summary>
     /// ÎÄÕÂÐÞ¸ÄÇëÇó
     /// </summary>
-    public class PostMergeRequestOutputDtoBase : BaseDto
+    public class PostMergeRequestDtoBase : BaseDto
     {
         /// <summary>
         /// Ô­ÎÄid

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/DTO/SearchDetailsOutputDto.cs → src/Masuit.MyBlogs.Core/Models/DTO/SearchDetailsDto.cs

@@ -5,7 +5,7 @@ namespace Masuit.MyBlogs.Core.Models.DTO
     /// <summary>
     /// 搜索详情输出模型
     /// </summary>
-    public class SearchDetailsOutputDto
+    public class SearchDetailsDto
     {
         /// <summary>
         /// ID

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/DTO/SeminarOutputDto.cs → src/Masuit.MyBlogs.Core/Models/DTO/SeminarDto.cs

@@ -3,7 +3,7 @@
     /// <summary>
     /// 文章专题输出模型
     /// </summary>
-    public partial class SeminarOutputDto : BaseDto
+    public partial class SeminarDto : BaseDto
     {
         /// <summary>
         /// 专题名称

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/DTO/UserInfoOutputDto.cs → src/Masuit.MyBlogs.Core/Models/DTO/UserInfoDto.cs

@@ -5,7 +5,7 @@ namespace Masuit.MyBlogs.Core.Models.DTO
     /// <summary>
     /// 用户信息输出模型
     /// </summary>
-    public class UserInfoOutputDto : BaseDto
+    public class UserInfoDto : BaseDto
     {
         /// <summary>
         /// 用户名

+ 5 - 5
src/Masuit.MyBlogs.Core/Models/ViewModel/IndexPageViewModel.cs

@@ -13,17 +13,17 @@ namespace Masuit.MyBlogs.Core.Models.ViewModel
         /// <summary>
         /// 文章列表
         /// </summary>
-        public IList<PostOutputDto> Posts { get; set; }
+        public IList<PostDto> Posts { get; set; }
 
         /// <summary>
         /// 网站公告列表
         /// </summary>
-        public IList<NoticeOutputDto> Notices { get; set; }
+        public IList<NoticeDto> Notices { get; set; }
 
         /// <summary>
         /// 分类列表
         /// </summary>
-        public IList<CategoryOutputDto> Categories { get; set; }
+        public IList<CategoryDto> Categories { get; set; }
 
         /// <summary>
         /// 标签列表
@@ -38,12 +38,12 @@ namespace Masuit.MyBlogs.Core.Models.ViewModel
         /// <summary>
         /// 热门文章
         /// </summary>
-        public List<PostOutputDto> Top6Post { get; set; }
+        public List<PostDto> Top6Post { get; set; }
 
         /// <summary>
         /// 文章列表查询
         /// </summary>
-        public IQueryable<PostOutputDto> PostsQueryable { get; set; }
+        public IQueryable<PostDto> PostsQueryable { get; set; }
 
         /// <summary>
         /// banner文章

+ 1 - 1
src/Masuit.MyBlogs.Core/Models/ViewModel/PageFootViewModel.cs

@@ -11,6 +11,6 @@ namespace Masuit.MyBlogs.Core.Models.ViewModel
         /// <summary>
         /// 友情链接
         /// </summary>
-        public IList<LinksOutputDto> Links { get; set; }
+        public IList<LinksDto> Links { get; set; }
     }
 }

+ 2 - 2
src/Masuit.MyBlogs.Core/Startup.cs

@@ -125,7 +125,7 @@ namespace Masuit.MyBlogs.Core
             {
                 options.RouteBasePath = "/profiler";
                 options.EnableServerTimingHeader = true;
-                options.ResultsAuthorize = req => req.HttpContext.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo)?.IsAdmin ?? false;
+                options.ResultsAuthorize = req => req.HttpContext.Session.Get<UserInfoDto>(SessionKey.UserInfo)?.IsAdmin ?? false;
                 options.ResultsListAuthorize = options.ResultsAuthorize;
                 options.IgnoredPaths.AddRange("/Assets/", "/Content/", "/fonts/", "/images/", "/ng-views/", "/Scripts/", "/static/", "/template/", "/cloud10.png", "/favicon.ico");
                 options.PopupRenderPosition = RenderPosition.BottomLeft;
@@ -247,7 +247,7 @@ namespace Masuit.MyBlogs.Core
 #if DEBUG
             return true;
 #endif
-            var user = context.GetHttpContext().Session.Get<UserInfoOutputDto>(SessionKey.UserInfo) ?? new UserInfoOutputDto();
+            var user = context.GetHttpContext().Session.Get<UserInfoDto>(SessionKey.UserInfo) ?? new UserInfoDto();
             return user.IsAdmin;
         }
     }

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Home/Author.cshtml

@@ -45,6 +45,6 @@
     </div>
 </div>
 @{
-    var user = Context.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo) ?? new UserInfoOutputDto();
+    var user = Context.Session.Get<UserInfoDto>(SessionKey.UserInfo) ?? new UserInfoDto();
     await Html.RenderPartialAsync(user.IsAdmin ? "_MainContainer_Admin" : "_MainContainer", Model);
 }

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Home/Category.cshtml

@@ -48,6 +48,6 @@
     </div>
 </div>
 @{
-    UserInfoOutputDto user = Context.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo) ?? new UserInfoOutputDto();
+    UserInfoDto user = Context.Session.Get<UserInfoDto>(SessionKey.UserInfo) ?? new UserInfoDto();
     await Html.RenderPartialAsync(user.IsAdmin ? "_MainContainer_Admin" : "_MainContainer", Model);
 }

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Home/Index.cshtml

@@ -115,7 +115,7 @@
     </div>
 }
 @{
-    var user = Context.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo) ?? new UserInfoOutputDto();
+    var user = Context.Session.Get<UserInfoDto>(SessionKey.UserInfo) ?? new UserInfoDto();
     await Html.RenderPartialAsync(user.IsAdmin ? "_MainContainer_Admin" : "_MainContainer", Model);
 }
 <script type="text/javascript">

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Home/Post.cshtml

@@ -14,6 +14,6 @@
     </ol>
 </div>
 @{
-    UserInfoOutputDto user = Context.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo) ?? new UserInfoOutputDto();
+    UserInfoDto user = Context.Session.Get<UserInfoDto>(SessionKey.UserInfo) ?? new UserInfoDto();
     await Html.RenderPartialAsync(user.IsAdmin ? "_MainContainer_Admin" : "_MainContainer", Model);
 }

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Home/Tag.cshtml

@@ -13,6 +13,6 @@
     </ol>
 </div>
 @{
-    UserInfoOutputDto user = Context.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo) ?? new UserInfoOutputDto();
+    UserInfoDto user = Context.Session.Get<UserInfoDto>(SessionKey.UserInfo) ?? new UserInfoDto();
     await Html.RenderPartialAsync(user.IsAdmin ? "_MainContainer_Admin" : "_MainContainer", Model);
 }

+ 2 - 2
src/Masuit.MyBlogs.Core/Views/Links/Index.cshtml

@@ -1,6 +1,6 @@
 @using AngleSharp.Network.Default
 @using Masuit.MyBlogs.Core.Models.DTO
-@model IList<Masuit.MyBlogs.Core.Models.DTO.LinksOutputDto>
+@model IList<Masuit.MyBlogs.Core.Models.DTO.LinksDto>
 
 @{
     ViewBag.Title = "友情链接大全";
@@ -44,7 +44,7 @@
     </article>
     <section>
         <div class="button-effect">
-            @foreach (LinksOutputDto link in Model)
+            @foreach (LinksDto link in Model)
             {
                 <a class="effect effect-5" href="@link.Url" title="@link.Name" target="_blank">@link.Name</a>
             }

+ 2 - 2
src/Masuit.MyBlogs.Core/Views/Links/Index_Admin.cshtml

@@ -1,6 +1,6 @@
 @using AngleSharp.Network.Default
 @using Masuit.MyBlogs.Core.Models.DTO
-@model IList<Masuit.MyBlogs.Core.Models.DTO.LinksOutputDto>
+@model IList<Masuit.MyBlogs.Core.Models.DTO.LinksDto>
 
 @{
     ViewBag.Title = "友情链接大全";
@@ -43,7 +43,7 @@
     </article>
     <section>
         <div class="button-effect">
-            @foreach (LinksOutputDto link in Model)
+            @foreach (LinksDto link in Model)
             {
                 <a class="effect effect-5" href="@link.Url" title="@link.Name" target="_blank">@link.Name</a>
             }

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Msg/Index_Admin.cshtml

@@ -4,7 +4,7 @@
 @{
     ViewBag.Title = "留言板";
     Layout = "~/Views/Shared/_Layout.cshtml";
-    UserInfoOutputDto user = Context.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo);
+    UserInfoDto user = Context.Session.Get<UserInfoDto>(SessionKey.UserInfo);
     string cid = string.IsNullOrEmpty(Context.Request.Query["cid"]) ? "0" : Context.Request.Query["cid"].ToString();
 }
 <link href="~/Assets/layui/css/layui.min.css" rel="stylesheet" />

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Notice/Details.cshtml

@@ -53,7 +53,7 @@
                     <div class="btn-group">
                         @Html.ActionLink("<<返回公告列表页", "Index", "Notice", null, new { @class = "btn btn-info" })
                         @{
-                            var user = Context.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo) ?? new UserInfoOutputDto();
+                            var user = Context.Session.Get<UserInfoDto>(SessionKey.UserInfo) ?? new UserInfoDto();
                             if (user.IsAdmin)
                             {
                                 <a class="btn btn-primary" asp-controller="Dashboard" asp-action="Index" asp-fragment="/notice/[email protected]" target="_blank">修改</a>

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Notice/Index.cshtml

@@ -1,4 +1,4 @@
-@model IList<Masuit.MyBlogs.Core.Models.DTO.NoticeOutputDto>
+@model IList<Masuit.MyBlogs.Core.Models.DTO.NoticeDto>
 @{
     ViewBag.Title = "网站公告栏";
     Layout = "~/Views/Shared/_Layout.cshtml";

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Notice/Index_Admin.cshtml

@@ -1,4 +1,4 @@
-@model IList<Masuit.MyBlogs.Core.Models.DTO.NoticeOutputDto>
+@model IList<Masuit.MyBlogs.Core.Models.DTO.NoticeDto>
 @{
     ViewBag.Title = "网站公告栏";
     Layout = "~/Views/Shared/_Layout.cshtml";

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Post/Details_Admin.cshtml

@@ -11,7 +11,7 @@
     ViewBag.Title = Model.Title;
     Layout = "~/Views/Shared/_Layout.cshtml";
     string[] colors = { "success", "info", "primary", "warning", "danger", "default", "primary" };
-    UserInfoOutputDto user = Context.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo);
+    UserInfoDto user = Context.Session.Get<UserInfoDto>(SessionKey.UserInfo);
     string cid = string.IsNullOrEmpty(Context.Request.Query["cid"]) ? "0" : Context.Request.Query["cid"].ToString();
     Advertisement ad = ViewBag.Ads;
 }

+ 2 - 2
src/Masuit.MyBlogs.Core/Views/Search/Search.cshtml

@@ -4,7 +4,7 @@
 @using Masuit.MyBlogs.Core.Models.ViewModel
 @using Masuit.Tools
 @using Microsoft.AspNetCore.Mvc.Rendering
-@model IList<Masuit.MyBlogs.Core.Models.DTO.PostOutputDto>
+@model IList<Masuit.MyBlogs.Core.Models.DTO.PostDto>
 @{
     ViewBag.Title = "站内搜索:" + ViewBag.Keyword;
     Layout = "~/Views/Shared/_Layout.cshtml";
@@ -59,7 +59,7 @@
                                     <div class="hr-line-dashed"></div>
                                 }
 
-                                PostOutputDto p = Model[i];
+                                PostDto p = Model[i];
                                 <div class="border padding-10 padding-bot5">
                                     <div class="search-result">
                                         <h2 class="size20">

+ 2 - 2
src/Masuit.MyBlogs.Core/Views/Seminar/Index.cshtml

@@ -2,11 +2,11 @@
 @using Masuit.MyBlogs.Core.Models.Entity
 @using Masuit.MyBlogs.Core.Models.ViewModel
 @using Masuit.Tools.Core.Net
-@model IList<Masuit.MyBlogs.Core.Models.DTO.PostOutputDto>
+@model IList<Masuit.MyBlogs.Core.Models.DTO.PostDto>
 @{
     Layout = "~/Views/Shared/_Layout.cshtml";
     Random r = new Random();
-    UserInfoOutputDto user = Context.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo) ?? new UserInfoOutputDto();
+    UserInfoDto user = Context.Session.Get<UserInfoDto>(SessionKey.UserInfo) ?? new UserInfoDto();
     Advertisement ad = ViewBag.Ads;
 }
 <style>

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Shared/_ArticleListItem.cshtml

@@ -3,7 +3,7 @@
 @{
     string[] colors = { "success", "info", "primary", "warning", "danger", "default", "primary" };
 }
-@model Masuit.MyBlogs.Core.Models.DTO.PostOutputDto
+@model Masuit.MyBlogs.Core.Models.DTO.PostDto
 <div class="ibox wow fadeIn">
     <div class="ibox-content">
         <a asp-controller="Post" asp-action="Details" asp-route-id="@Model.Id" target="_blank">

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Shared/_ArticleListItem_Admin.cshtml

@@ -4,7 +4,7 @@
 @{
     string[] colors = { "success", "info", "primary", "warning", "danger", "default", "primary" };
 }
-@model Masuit.MyBlogs.Core.Models.DTO.PostOutputDto
+@model Masuit.MyBlogs.Core.Models.DTO.PostDto
 <div class="ibox wow fadeIn">
     <div class="ibox-content">
         <a asp-controller="Post" asp-action="Details" asp-route-id="@Model.Id" target="_blank">

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Shared/_ArticleListPartial.cshtml

@@ -60,7 +60,7 @@
                 <div class="page-header">
                     <h3>Oops!抱歉~没有找到相关的文章或资源!如果您有相关的结果,您可以 @Html.ActionLink("点击这里", "Publish", "Post", null, new { @class = "btn btn-info btn-lg" }) 投稿哦!以下是一些随机推荐:</h3>
                 </div>
-                foreach (PostOutputDto post in list)
+                foreach (PostDto post in list)
                 {
                     await Html.RenderPartialAsync("_ArticleListItem", post);
                 }

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Shared/_ArticleListPartial_Admin.cshtml

@@ -64,7 +64,7 @@
                 <div class="page-header">
                     <h3>Oops!抱歉~没有找到相关的文章或资源!如果您有相关的结果,您可以 @Html.ActionLink("点击这里", "Publish", "Post", null, new { @class = "btn btn-info btn-lg" }) 投稿哦!以下是一些随机推荐:</h3>
                 </div>
-                foreach (PostOutputDto post in list)
+                foreach (PostDto post in list)
                 {
                     await Html.RenderPartialAsync("_ArticleListItem_Admin", post);
                 }

+ 3 - 3
src/Masuit.MyBlogs.Core/Views/Shared/_Aside.cshtml

@@ -38,7 +38,7 @@
                     <div class="row">
                         <div class="col-xs-12">
                             <ul class="notices">
-                                @foreach (NoticeOutputDto notice in Model.Notices)
+                                @foreach (NoticeDto notice in Model.Notices)
                                 {
                                     <li class="news-item">
                                         @Html.ActionLink(notice.Content.GetSummary(45, 2), "Details", "Notice", new { id = notice.Id }, new { @class = "tippy-scale", title = "查看详情" })
@@ -58,7 +58,7 @@
             </div>
             <div class="panel-body">
                 <ul class="list-group text-center">
-                    @foreach (CategoryOutputDto cat in Model.Categories)
+                    @foreach (CategoryDto cat in Model.Categories)
                     {
                         if (cat.PendedPostCount > 0)
                         {
@@ -92,7 +92,7 @@
             <div class="leaderboard">
                 <h1>推荐文章</h1>
                 <ol>
-                    @foreach (PostOutputDto post in Model.Top6Post)
+                    @foreach (PostDto post in Model.Top6Post)
                     {
                         <li>
                             <a asp-controller="Post" asp-action="Details" asp-route-id="@post.Id">

+ 6 - 6
src/Masuit.MyBlogs.Core/Views/Shared/_Layout.cshtml

@@ -8,8 +8,8 @@
 @inject Stopwatch stop
 @{
     string[] colors = { "success", "info", "warning", "danger", "default" };
-    IList<MenuOutputDto> menus = ViewBag.menus;
-    UserInfoOutputDto user = Context.Session.Get<UserInfoOutputDto>(SessionKey.UserInfo) ?? new UserInfoOutputDto();
+    IList<MenuDto> menus = ViewBag.menus;
+    UserInfoDto user = Context.Session.Get<UserInfoDto>(SessionKey.UserInfo) ?? new UserInfoDto();
     PageFootViewModel footer = ViewBag.Footer;
 }
 
@@ -107,7 +107,7 @@
                                 <ul class="cd-secondary-nav is-hidden">
                                     <li class="go-back"><a href="#">上级菜单</a></li>
                                     <li class="see-all"><a asp-controller="Post" asp-action="All">所有 @m.Name</a></li>
-                                    @foreach (MenuOutputDto m2 in menus.Where(s => s.ParentId == m.Id).OrderBy(c => c.Sort))
+                                    @foreach (MenuDto m2 in menus.Where(s => s.ParentId == m.Id).OrderBy(c => c.Sort))
                                     {
                                         if (menus.Any(mm => mm.ParentId == m2.Id))
                                         {
@@ -115,7 +115,7 @@
                                                 <a href="#">@m2.Name</a>
                                                 <ul class="is-hidden">
                                                     <li class="go-back"><a href="#">上级菜单</a></li>
-                                                    @foreach (MenuOutputDto m3 in menus.Where(s => s.ParentId == m2.Id).OrderBy(c => c.Sort))
+                                                    @foreach (MenuDto m3 in menus.Where(s => s.ParentId == m2.Id).OrderBy(c => c.Sort))
                                                     {
                                                         if (menus.Any(mmm => mmm.ParentId == m3.Id))
                                                         {
@@ -123,7 +123,7 @@
                                                                 <a href="#">@m3.Name</a>
                                                                 <ul class="is-hidden">
                                                                     <li class="go-back"><a href="#">上级菜单</a></li>
-                                                                    @foreach (MenuOutputDto m4 in menus.Where(s => s.ParentId == m3.Id).OrderBy(c => c.Sort))
+                                                                    @foreach (MenuDto m4 in menus.Where(s => s.ParentId == m3.Id).OrderBy(c => c.Sort))
                                                                     {
                                                                         if (m4.NewTab)
                                                                         {
@@ -271,7 +271,7 @@
                                 <a href="/taskcenter" target="_blank">任务管理器</a>
                                 <span> | </span>
                             }
-                            foreach (LinksOutputDto link in footer.Links)
+                            foreach (LinksDto link in footer.Links)
                             {
                                 <a href="@link.Url" target="_blank">@link.Name</a>
                                 <span> | </span>