package com.smcic.api.epg.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.smcic.api.epg.dto.DisableDTO; import com.smcic.api.epg.entity.Channel; import com.smcic.api.epg.entity.KeywordDisableConfig; import com.smcic.api.epg.service.impl.ChannelService; import com.smcic.api.epg.service.impl.EpgDisableConfigService; import com.smcic.api.epg.service.impl.KeywordDisableConfigService; import com.smcic.api.epg.service.impl.ProgramService; import org.apache.ibatis.annotations.Param; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; import java.util.Map; @RestController @RequestMapping("epg") public class EpgController { @Resource private ChannelService channelService; @Resource private ProgramService programService; @Resource private EpgDisableConfigService epgDisableConfigService; @Resource private KeywordDisableConfigService keywordDisableConfigService; @GetMapping("check") public void check(){ } @RequestMapping("tv") public List tv(){ return channelService.tvList(); } @RequestMapping("fm") public List fm(){ return channelService.fmList(); } @RequestMapping("list") public List> list(@Param("channelId") Integer channelId){ return programService.cacheEpg(channelId); } @PostMapping("disable") public void disable(@RequestBody DisableDTO disableDTO){ epgDisableConfigService.disable(disableDTO); } @GetMapping("refreshCache/") public void refreshCache(@Param("channelId") Integer channelId){ programService.setCache(channelId); } @GetMapping("all") public List> all(@Param("channelId") Integer channelId){ return programService.getProgramList(channelId); } @GetMapping("keywords") public IPage keywordsList(@Param("channelId") Integer channelId, @Param("page") Integer pageNum, @Param("pageSize") Integer pageSize){ return keywordDisableConfigService.keywordConfigList(channelId, pageNum, pageSize); } }