CoinYoutubeController.java 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package top.lvzhiqiang.controller;
  2. import org.springframework.web.bind.annotation.PostMapping;
  3. import org.springframework.web.bind.annotation.RequestMapping;
  4. import org.springframework.web.bind.annotation.RestController;
  5. import top.lvzhiqiang.dto.R;
  6. import top.lvzhiqiang.exception.ParameterException;
  7. import top.lvzhiqiang.service.CoinYoutubeService;
  8. import top.lvzhiqiang.util.StringUtils;
  9. import javax.annotation.Resource;
  10. /**
  11. * youtube Controller
  12. *
  13. * @author lvzhiqiang
  14. * 2024/9/25 10:47
  15. */
  16. @RestController
  17. @RequestMapping("/coinYoutube")
  18. public class CoinYoutubeController {
  19. @Resource
  20. private CoinYoutubeService coinYoutubeService;
  21. @PostMapping("/liveChapterUpdate")
  22. public Object liveChapterUpdate(String id, String remark) {
  23. if (StringUtils.isEmpty(id)) {
  24. throw new ParameterException("id不能为空!");
  25. }
  26. if (StringUtils.isEmpty(remark)) {
  27. remark = "--";
  28. }
  29. return R.ok().data(coinYoutubeService.liveChapterUpdate(id, remark));
  30. }
  31. }