mirror of https://github.com/abpframework/abp.git
3 changed files with 150 additions and 0 deletions
@ -0,0 +1,48 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
using Volo.Abp.Auditing; |
|||
using Volo.Blogging.Comments; |
|||
using Volo.Blogging.Comments.Dtos; |
|||
|
|||
namespace Volo.Blogging |
|||
{ |
|||
[RemoteService] |
|||
[Area("blogging")] |
|||
[Controller] |
|||
[ControllerName("Comments")] |
|||
[Route("api/blogging/comments")] |
|||
[DisableAuditing] |
|||
public class CommentsController : AbpController, ICommentAppService |
|||
{ |
|||
[HttpGet] |
|||
[Route("{postId}")] |
|||
public Task<List<CommentWithRepliesDto>> GetHierarchicalListOfPostAsync(Guid postId) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
[HttpPost] |
|||
public Task<CommentWithDetailsDto> CreateAsync(CreateCommentDto input) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("{id}")] |
|||
public Task<CommentWithDetailsDto> UpdateAsync(Guid id, UpdateCommentDto input) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
[HttpDelete] |
|||
public Task DeleteAsync(Guid id) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,67 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
using Volo.Abp.Auditing; |
|||
using Volo.Blogging.Posts; |
|||
|
|||
namespace Volo.Blogging |
|||
{ |
|||
[RemoteService] |
|||
[Area("blogging")] |
|||
[Controller] |
|||
[ControllerName("Posts")] |
|||
[Route("api/blogging/posts")] |
|||
[DisableAuditing] |
|||
public class PostsController : AbpController, IPostAppService |
|||
{ |
|||
private readonly IPostAppService _postAppService; |
|||
|
|||
public PostsController(IPostAppService postAppService) |
|||
{ |
|||
_postAppService = postAppService; |
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("{blogId}/all")] |
|||
public Task<ListResultDto<PostWithDetailsDto>> GetListByBlogIdAndTagName(Guid blogId, string tagName) |
|||
{ |
|||
return _postAppService.GetListByBlogIdAndTagName(blogId, tagName); |
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("read/{id}")] |
|||
public Task<PostWithDetailsDto> GetForReadingAsync(GetPostInput input) |
|||
{ |
|||
return _postAppService.GetForReadingAsync(input); |
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
public Task<PostWithDetailsDto> GetAsync(Guid id) |
|||
{ |
|||
return _postAppService.GetAsync(id); |
|||
} |
|||
|
|||
[HttpDelete] |
|||
public Task DeleteAsync(Guid id) |
|||
{ |
|||
return _postAppService.DeleteAsync(id); |
|||
} |
|||
|
|||
[HttpPost] |
|||
public Task<PostWithDetailsDto> CreateAsync(CreatePostDto input) |
|||
{ |
|||
return _postAppService.CreateAsync(input); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("{id}")] |
|||
public Task<PostWithDetailsDto> UpdateAsync(Guid id, UpdatePostDto input) |
|||
{ |
|||
return _postAppService.UpdateAsync(id, input); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
using Volo.Abp.Auditing; |
|||
using Volo.Blogging.Tagging; |
|||
using Volo.Blogging.Tagging.Dtos; |
|||
|
|||
namespace Volo.Blogging |
|||
{ |
|||
[RemoteService] |
|||
[Area("blogging")] |
|||
[Controller] |
|||
[ControllerName("Tags")] |
|||
[Route("api/blogging/tags")] |
|||
[DisableAuditing] |
|||
public class TagsController : AbpController, ITagAppService |
|||
{ |
|||
private readonly ITagAppService _tagAppService; |
|||
|
|||
public TagsController(ITagAppService tagAppService) |
|||
{ |
|||
_tagAppService = tagAppService; |
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("popular/{blogId}")] |
|||
public Task<List<TagDto>> GetPopularTags(Guid blogId, GetPopularTagsInput input) |
|||
{ |
|||
return _tagAppService.GetPopularTags(blogId, input); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue