Merge pull request #8660 from abpframework/auto-merge/rel-4-3/314

Merge branch dev with rel-4.3
pull/8662/head
İlkay İlknur 5 years ago committed by GitHub
commit f37d6a9b57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,10 +1,11 @@
using System;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Auditing;
namespace Volo.CmsKit.Admin.Blogs
{
[Serializable]
public class BlogPostDto : EntityDto<Guid>
public class BlogPostDto : EntityDto<Guid>, IHasCreationTime, IHasModificationTime
{
public Guid BlogId { get; set; }
@ -17,5 +18,9 @@ namespace Volo.CmsKit.Admin.Blogs
public string Content { get; set; }
public Guid? CoverImageMediaId { get; set; }
public DateTime CreationTime { get; set; }
public DateTime? LastModificationTime { get; set; }
}
}

@ -0,0 +1,28 @@
using System;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Auditing;
namespace Volo.CmsKit.Admin.Blogs
{
[Serializable]
public class BlogPostListDto : EntityDto<Guid>, IHasCreationTime, IHasModificationTime
{
public Guid BlogId { get; set; }
public string BlogName { get; set; }
public string Title { get; set; }
public string Slug { get; set; }
public string ShortDescription { get; set; }
public string Content { get; set; }
public Guid? CoverImageMediaId { get; set; }
public DateTime CreationTime { get; set; }
public DateTime? LastModificationTime { get; set; }
}
}

@ -6,6 +6,7 @@ namespace Volo.CmsKit.Admin.Blogs
public interface IBlogPostAdminAppService
: ICrudAppService<
BlogPostDto,
BlogPostListDto,
Guid,
BlogPostGetListInput,
CreateBlogPostDto,

@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.GlobalFeatures;
@ -83,15 +84,23 @@ namespace Volo.CmsKit.Admin.Blogs
}
[Authorize(CmsKitAdminPermissions.BlogPosts.Default)]
public virtual async Task<PagedResultDto<BlogPostDto>> GetListAsync(BlogPostGetListInput input)
public virtual async Task<PagedResultDto<BlogPostListDto>> GetListAsync(BlogPostGetListInput input)
{
var blogs = (await BlogRepository.GetListAsync()).ToDictionary(x => x.Id);
var blogPosts = await BlogPostRepository.GetListAsync(input.Filter, input.BlogId, input.MaxResultCount, input.SkipCount, input.Sorting);
var count = await BlogPostRepository.GetCountAsync(input.Filter);
var dtoList = ObjectMapper.Map<List<BlogPost>, List<BlogPostDto>>(blogPosts);
var dtoList = blogPosts.Select(x =>
{
var dto = ObjectMapper.Map<BlogPost, BlogPostListDto>(x);
dto.BlogName = blogs[x.BlogId].Name;
return dto;
}).ToList();
return new PagedResultDto<BlogPostDto>(count, dtoList);
return new PagedResultDto<BlogPostListDto>(count, dtoList);
}
[Authorize(CmsKitAdminPermissions.BlogPosts.Delete)]

@ -27,6 +27,8 @@ namespace Volo.CmsKit.Admin
CreateMap<Page, PageDto>();
CreateMap<BlogPost, BlogPostDto>(MemberList.Destination);
CreateMap<BlogPost, BlogPostListDto>()
.Ignore(d => d.BlogName);
CreateMap<CreateBlogPostDto, BlogPost>(MemberList.Source);
CreateMap<UpdateBlogPostDto, BlogPost>(MemberList.Source);

@ -49,7 +49,7 @@ namespace Volo.CmsKit.Admin.Blogs
[HttpGet]
[Authorize(CmsKitAdminPermissions.BlogPosts.Default)]
public virtual Task<PagedResultDto<BlogPostDto>> GetListAsync(BlogPostGetListInput input)
public virtual Task<PagedResultDto<BlogPostListDto>> GetListAsync(BlogPostGetListInput input)
{
return BlogPostAdminAppService.GetListAsync(input);
}

@ -18,7 +18,7 @@ $(function () {
scrollCollapse: true,
scrollX: true,
ordering: true,
order: [[1, "desc"]],
order: [[2, "desc"]],
ajax: abp.libs.datatables.createAjax(blogsService.getList, getFilter),
columnDefs: [
{
@ -50,6 +50,11 @@ $(function () {
]
}
},
{
title: l("Blog"),
orderable: false,
data: "blogName"
},
{
title: l("Title"),
orderable: true,
@ -59,6 +64,12 @@ $(function () {
title: l("Slug"),
orderable: true,
data: "slug"
},
{
title: l("CreationTime"),
orderable: true,
data: 'creationTime',
dataFormat: "datetime"
}
]
}));

@ -62,7 +62,14 @@
{
title: l("CreationTime"),
orderable: true,
data: 'creationTime'
data: 'creationTime',
dataFormat: "datetime"
},
{
title: l("LastModificationTime"),
orderable: true,
data: 'lastModificationTime',
dataFormat: "datetime"
}
]
}));

@ -129,6 +129,7 @@
"YourEmailAddress": "Your e-mail address",
"YourFullName": "Your full name",
"YourMessage": "Your Message",
"YourReply": "Your reply"
"YourReply": "Your reply",
"LastModificationTime": "Last Modification Time"
}
}

@ -120,6 +120,7 @@
"YourEmailAddress": "Email adresiniz",
"YourFullName": "Tam adınız",
"YourMessage": "Mesajınız",
"YourReply": "Cevabınız"
"YourReply": "Cevabınız",
"LastModificationTime": "Son Güncelleme Zamanı"
}
}

Loading…
Cancel
Save