zmy01
parent
26301f6fa9
commit
08c2dacb77
|
@ -0,0 +1,38 @@
|
|||
package doctor.controller;
|
||||
|
||||
|
||||
import doctor.common.core.web.controller.BaseController;
|
||||
import doctor.common.core.web.page.TableDataInfo;
|
||||
import doctor.entity.VideoCategoryEntity;
|
||||
import doctor.entity.VideoEntity;
|
||||
import doctor.service.HealthUserVideoService;
|
||||
import doctor.system.api.domain.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/user/video/v1")
|
||||
public class HealthUserVideoController extends BaseController {
|
||||
@Autowired
|
||||
private HealthUserVideoService healthUserVideoService;
|
||||
|
||||
@GetMapping("/findVideoCategoryList")
|
||||
public TableDataInfo findVideoCategoryList(VideoCategoryEntity entity){
|
||||
startPage();
|
||||
List<VideoCategoryEntity> List = healthUserVideoService.findVideoCategoryList(entity);
|
||||
return getDataTable(List);
|
||||
}
|
||||
|
||||
@GetMapping("/findVideoVoList")
|
||||
public TableDataInfo findVideoVoList(@RequestParam("categoryId") Integer categoryId){
|
||||
startPage();
|
||||
List<VideoEntity> List = healthUserVideoService.findVideoVoList(categoryId);
|
||||
return getDataTable(List);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package doctor.entity;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class VideoCategoryEntity {
|
||||
private Integer id;
|
||||
private String name;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package doctor.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class VideoCommentEntity {
|
||||
private Integer id;
|
||||
private Integer userId;
|
||||
private Integer videoId;
|
||||
private String content;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package doctor.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class VideoCountEntity {
|
||||
private Integer id;
|
||||
private Integer videoId;
|
||||
private Integer buyNum;
|
||||
private Integer collectionNum;
|
||||
private Integer commentNum;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package doctor.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class VideoEntity {
|
||||
private Integer id;
|
||||
private String title;
|
||||
private Integer categoryId;
|
||||
private String shearUrl;
|
||||
private String abstracts;
|
||||
private String originalUrl;
|
||||
private Integer duration;
|
||||
private Integer price;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package doctor.mapper;
|
||||
|
||||
|
||||
import doctor.entity.VideoCategoryEntity;
|
||||
import doctor.entity.VideoEntity;
|
||||
import doctor.system.api.domain.SysUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface HealthUserVideoMapper {
|
||||
List<VideoCategoryEntity> findVideoCategoryList(VideoCategoryEntity entity);
|
||||
|
||||
List<VideoEntity> findVideoVoList(@Param("categoryId") Integer categoryId);
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package doctor.service;
|
||||
|
||||
|
||||
|
||||
import doctor.entity.VideoCategoryEntity;
|
||||
import doctor.entity.VideoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface HealthUserVideoService {
|
||||
List<VideoCategoryEntity> findVideoCategoryList(VideoCategoryEntity entity);
|
||||
|
||||
List<VideoEntity> findVideoVoList(Integer categoryId);
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package doctor.service.impl;
|
||||
|
||||
|
||||
import doctor.entity.VideoCategoryEntity;
|
||||
import doctor.entity.VideoEntity;
|
||||
import doctor.mapper.HealthUserVideoMapper;
|
||||
import doctor.service.HealthUserVideoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class HealthUserVideoServiceImpl implements HealthUserVideoService {
|
||||
@Autowired
|
||||
private HealthUserVideoMapper healthUserVideoMapper;
|
||||
|
||||
@Override
|
||||
public List<VideoCategoryEntity> findVideoCategoryList(VideoCategoryEntity entity) {
|
||||
return healthUserVideoMapper.findVideoCategoryList(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VideoEntity> findVideoVoList(Integer categoryId) {
|
||||
return healthUserVideoMapper.findVideoVoList(categoryId);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="doctor.mapper.HealthUserVideoMapper">
|
||||
|
||||
|
||||
<select id="findVideoCategoryList" resultType="doctor.entity.VideoCategoryEntity">
|
||||
select * from video_category
|
||||
</select>
|
||||
<select id="findVideoVoList" resultType="doctor.entity.VideoEntity">
|
||||
select * from video where category_id=#{categoryId}
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue