EpgController.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package com.smcic.api.epg.controller;
  2. import com.baomidou.mybatisplus.core.metadata.IPage;
  3. import com.smcic.api.epg.dto.DisableDTO;
  4. import com.smcic.api.epg.entity.Channel;
  5. import com.smcic.api.epg.entity.KeywordDisableConfig;
  6. import com.smcic.api.epg.service.impl.ChannelService;
  7. import com.smcic.api.epg.service.impl.EpgDisableConfigService;
  8. import com.smcic.api.epg.service.impl.KeywordDisableConfigService;
  9. import com.smcic.api.epg.service.impl.ProgramService;
  10. import org.apache.ibatis.annotations.Param;
  11. import org.springframework.web.bind.annotation.*;
  12. import javax.annotation.Resource;
  13. import java.util.List;
  14. import java.util.Map;
  15. @RestController
  16. @RequestMapping("epg")
  17. public class EpgController {
  18. @Resource
  19. private ChannelService channelService;
  20. @Resource
  21. private ProgramService programService;
  22. @Resource
  23. private EpgDisableConfigService epgDisableConfigService;
  24. @Resource
  25. private KeywordDisableConfigService keywordDisableConfigService;
  26. @GetMapping("check")
  27. public void check(){
  28. }
  29. @RequestMapping("tv")
  30. public List<Channel> tv(){
  31. return channelService.tvList();
  32. }
  33. @RequestMapping("fm")
  34. public List<Channel> fm(){
  35. return channelService.fmList();
  36. }
  37. @RequestMapping("list")
  38. public List<Map<String, Object>> list(@Param("channelId") Integer channelId){
  39. return programService.cacheEpg(channelId);
  40. }
  41. @PostMapping("disable")
  42. public void disable(@RequestBody DisableDTO disableDTO){
  43. epgDisableConfigService.disable(disableDTO);
  44. }
  45. @GetMapping("refreshCache/")
  46. public void refreshCache(@Param("channelId") Integer channelId){
  47. programService.setCache(channelId);
  48. }
  49. @GetMapping("all")
  50. public List<Map<String, Object>> all(@Param("channelId") Integer channelId){
  51. return programService.getProgramList(channelId);
  52. }
  53. @GetMapping("keywords")
  54. public IPage<KeywordDisableConfig> keywordsList(@Param("channelId") Integer channelId, @Param("page") Integer pageNum, @Param("pageSize") Integer pageSize){
  55. return keywordDisableConfigService.keywordConfigList(channelId, pageNum, pageSize);
  56. }
  57. }