ArticleController.java 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. package com.webchat.client.mall.controller;
  2. import com.webchat.client.mall.service.ArticleService;
  3. import com.webchat.common.bean.APIResponseBean;
  4. import com.webchat.common.bean.APIResponseBeanUtil;
  5. import com.webchat.common.helper.SessionHelper;
  6. import com.webchat.domain.vo.response.publicaccount.ArticleBaseResponseVO;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.GetMapping;
  9. import org.springframework.web.bind.annotation.PathVariable;
  10. import org.springframework.web.bind.annotation.RequestMapping;
  11. import org.springframework.web.bind.annotation.RestController;
  12. @RestController
  13. @RequestMapping("/client-service/chat/article")
  14. public class ArticleController {
  15. @Autowired
  16. private ArticleService articleService;
  17. /**
  18. * 文章详情查询
  19. *
  20. * @param id
  21. * @return
  22. */
  23. @GetMapping("/detail/{id}")
  24. public APIResponseBean<ArticleBaseResponseVO> detail(@PathVariable Long id) {
  25. String userId = SessionHelper.getCurrentUserId();
  26. return APIResponseBeanUtil.success(articleService.detail(id, userId));
  27. }
  28. }