jpz
zmyYYDS 2024-01-12 21:40:26 +08:00
parent 16030f8df7
commit bc77718110
5 changed files with 8 additions and 12 deletions

View File

@ -2,15 +2,10 @@ package doctor.controller;
import doctor.common.core.domain.HealthR; import doctor.common.core.domain.HealthR;
import doctor.common.core.web.controller.BaseController;
import doctor.common.core.web.page.TableDataInfo;
import doctor.domain.dto.VideoDto; import doctor.domain.dto.VideoDto;
import doctor.domain.entity.VideoCategoryEntity;
import doctor.domain.entity.VideoEntity;
import doctor.domain.vo.VideoCategoryVo; import doctor.domain.vo.VideoCategoryVo;
import doctor.domain.vo.VideoVo; import doctor.domain.vo.VideoVo;
import doctor.service.HealthUserVideoService; import doctor.service.HealthUserVideoService;
import doctor.util.ConvertUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -31,9 +26,9 @@ public class HealthUserVideoController{
} }
@GetMapping("/findVideoVoList") @GetMapping("/findVideoVoList")
public HealthR<List<VideoVo>> findVideoVoList(@RequestBody VideoDto videoDto){ public HealthR<List<VideoVo>> findVideoVoList(@RequestParam Integer categoryId,@RequestParam Integer page,@RequestParam Integer count){
startPage(videoDto.getPage(), videoDto.getCount()); startPage(page,count);
List<VideoVo> List = healthUserVideoService.findVideoVoList(videoDto); List<VideoVo> List = healthUserVideoService.findVideoVoList(categoryId);
return HealthR.ok(List); return HealthR.ok(List);
} }

View File

@ -12,5 +12,5 @@ import java.util.List;
public interface HealthUserVideoMapper { public interface HealthUserVideoMapper {
List<VideoCategoryEntity> findVideoCategoryList(); List<VideoCategoryEntity> findVideoCategoryList();
List<VideoEntity> findVideoVoList(VideoDto videoDto); List<VideoEntity> findVideoVoList(@Param("categoryId") Integer categoryId);
} }

View File

@ -13,5 +13,5 @@ import java.util.List;
public interface HealthUserVideoService { public interface HealthUserVideoService {
List<VideoCategoryVo> findVideoCategoryList(); List<VideoCategoryVo> findVideoCategoryList();
List<VideoVo> findVideoVoList(VideoDto videoDto); List<VideoVo> findVideoVoList(Integer categoryId);
} }

View File

@ -29,8 +29,8 @@ public class HealthUserVideoServiceImpl implements HealthUserVideoService {
} }
@Override @Override
public List<VideoVo> findVideoVoList(VideoDto videoDto) { public List<VideoVo> findVideoVoList(Integer categoryId) {
List<VideoEntity> videoVoList = healthUserVideoMapper.findVideoVoList(videoDto); List<VideoEntity> videoVoList = healthUserVideoMapper.findVideoVoList(categoryId);
List<VideoVo> videoVos = ConvertUtil.entityToVoList(videoVoList, VideoVo.class); List<VideoVo> videoVos = ConvertUtil.entityToVoList(videoVoList, VideoVo.class);
return videoVos; return videoVos;
} }

View File

@ -11,4 +11,5 @@
<select id="findVideoVoList" resultType="doctor.domain.entity.VideoEntity"> <select id="findVideoVoList" resultType="doctor.domain.entity.VideoEntity">
select * from video where category_id=#{categoryId} select * from video where category_id=#{categoryId}
</select> </select>
</mapper> </mapper>