PostsController.java 1018 B

1234567891011121314151617181920212223242526272829303132
  1. package com.nosum.deliver.posts.controller;
  2. import com.nosum.common.annotation.Explain;
  3. import com.nosum.common.base.domain.Result;
  4. import com.nosum.deliver.posts.domain.vo.PostsVO;
  5. import com.nosum.deliver.posts.service.PostsService;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.GetMapping;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RestController;
  10. @RestController
  11. @RequestMapping("/posts")
  12. public class PostsController {
  13. @Autowired
  14. private PostsService postsService;
  15. @Explain("按照时间归档文章数量")
  16. @GetMapping("/archive/v1/list")
  17. public Result<PostsVO> getArchiveTotalByDateList(PostsVO postsVO) {
  18. return postsService.getArchiveTotalByDateList(postsVO);
  19. }
  20. @Explain("查询文章统计")
  21. @GetMapping("/posts/v1/statistics")
  22. public Result getPostStatistics(){
  23. return this.postsService.getPostStatistics();
  24. }
  25. }