RecommendController.java 1006 B

123456789101112131415161718192021222324252627282930
  1. package com.seecoder.dataanalysis.controller;
  2. import com.seecoder.dataanalysis.analysis.RecommendService;
  3. import com.seecoder.dataanalysis.vo.ResponseVO;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.GetMapping;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7. import org.springframework.web.bind.annotation.RequestParam;
  8. import org.springframework.web.bind.annotation.RestController;
  9. /**
  10. * @author Peng Yiyan
  11. * @since 2022/04/19
  12. */
  13. @RestController
  14. @RequestMapping("/recommend")
  15. public class RecommendController {
  16. private final RecommendService recommendService;
  17. @Autowired
  18. public RecommendController(RecommendService recommendService){
  19. this.recommendService = recommendService;
  20. }
  21. @GetMapping("/getRecommendById")
  22. public ResponseVO getRecommendById(@RequestParam(value = "user_id") int user_id){
  23. return ResponseVO.buildSuccess(recommendService.getRecommendById(user_id));
  24. }
  25. }