diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Members/IMemberAppService.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Members/IMemberAppService.cs index 0cf992a467..5e06d20956 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Members/IMemberAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Members/IMemberAppService.cs @@ -6,5 +6,5 @@ namespace Volo.Blogging.Members; public interface IMemberAppService : IApplicationService { - Task GetAsync(string username); + Task FindAsync(string username); } \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Members/MemberAppService.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Members/MemberAppService.cs index 936a0ae0ef..eab4f43009 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Members/MemberAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Members/MemberAppService.cs @@ -15,9 +15,9 @@ public class MemberAppService : BloggingAppServiceBase, IMemberAppService _userRepository = userRepository; } - public async Task GetAsync(string username) + public async Task FindAsync(string username) { - var user = await _userRepository.GetAsync(x => x.UserName == username); + var user = await _userRepository.FindAsync(x => x.UserName == username); return ObjectMapper.Map(user); } diff --git a/modules/blogging/src/Volo.Blogging.HttpApi.Client/ClientProxies/MembersClientProxy.Generated.cs b/modules/blogging/src/Volo.Blogging.HttpApi.Client/ClientProxies/MembersClientProxy.Generated.cs new file mode 100644 index 0000000000..dfabaed346 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.HttpApi.Client/ClientProxies/MembersClientProxy.Generated.cs @@ -0,0 +1,28 @@ +// This file is automatically generated by ABP framework to use MVC Controllers from CSharp +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Modeling; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Http.Client.ClientProxying; +using Volo.Blogging.Blogs; +using Volo.Blogging.Blogs.Dtos; +using Volo.Blogging.Members; +using Volo.Blogging.Posts; + +// ReSharper disable once CheckNamespace +namespace Volo.Blogging.ClientProxies; + +[Dependency(ReplaceServices = true)] +[ExposeServices(typeof(IMemberAppService), typeof(MembersClientProxy))] +public partial class MembersClientProxy : ClientProxyBase, IMemberAppService +{ + public Task FindAsync(string username) + { + return RequestAsync(nameof(FindAsync), new ClientProxyRequestTypeValue + { + { typeof(string), username } + }); + } +} diff --git a/modules/blogging/src/Volo.Blogging.HttpApi.Client/ClientProxies/MembersClientProxy.cs b/modules/blogging/src/Volo.Blogging.HttpApi.Client/ClientProxies/MembersClientProxy.cs new file mode 100644 index 0000000000..61e4f3df1e --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.HttpApi.Client/ClientProxies/MembersClientProxy.cs @@ -0,0 +1,7 @@ +// This file is part of MembersClientProxy, you can customize it here +// ReSharper disable once CheckNamespace +namespace Volo.Blogging.ClientProxies; + +public partial class MembersClientProxy +{ +} diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs index 7c64cd79e9..be6942eac2 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs @@ -62,7 +62,7 @@ namespace Volo.Blogging.Posts public async Task> GetListByUserIdAsync(Guid userId, CancellationToken cancellationToken = default) { var query = (await GetMongoQueryableAsync(cancellationToken)).Where(x => x.CreatorId == userId) - .OrderBy(x => x.CreationTime); + .OrderByDescending(x => x.CreationTime); return await query.ToListAsync(GetCancellationToken(cancellationToken)); } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml index 471eb765ab..62841ae158 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml @@ -66,7 +66,7 @@

- @(post.Description.Length >= 150 ? post.Description.Substring(0, 150) + "..." : post.Description) + @post.Description.TruncateWithPostfix(150) @L["ReadMore"]

diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml.cs index b8a215c923..8018ea23e8 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml.cs @@ -32,7 +32,7 @@ public class IndexModel : AbpPageModel public async Task OnGetAsync(string userName) { - User = await _memberAppService.GetAsync(userName); + User = await _memberAppService.FindAsync(userName); if (User is null) {