diff --git a/doctor-modules/doctor-health/src/main/java/doctor/controller/HealthUserVideoController.java b/doctor-modules/doctor-health/src/main/java/doctor/controller/HealthUserVideoController.java new file mode 100644 index 0000000..d43d6c8 --- /dev/null +++ b/doctor-modules/doctor-health/src/main/java/doctor/controller/HealthUserVideoController.java @@ -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 List = healthUserVideoService.findVideoCategoryList(entity); + return getDataTable(List); + } + + @GetMapping("/findVideoVoList") + public TableDataInfo findVideoVoList(@RequestParam("categoryId") Integer categoryId){ + startPage(); + List List = healthUserVideoService.findVideoVoList(categoryId); + return getDataTable(List); + } + +} diff --git a/doctor-modules/doctor-health/src/main/java/doctor/entity/VideoCategoryEntity.java b/doctor-modules/doctor-health/src/main/java/doctor/entity/VideoCategoryEntity.java new file mode 100644 index 0000000..ba2e6c8 --- /dev/null +++ b/doctor-modules/doctor-health/src/main/java/doctor/entity/VideoCategoryEntity.java @@ -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; +} diff --git a/doctor-modules/doctor-health/src/main/java/doctor/entity/VideoCommentEntity.java b/doctor-modules/doctor-health/src/main/java/doctor/entity/VideoCommentEntity.java new file mode 100644 index 0000000..952ce05 --- /dev/null +++ b/doctor-modules/doctor-health/src/main/java/doctor/entity/VideoCommentEntity.java @@ -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; +} diff --git a/doctor-modules/doctor-health/src/main/java/doctor/entity/VideoCountEntity.java b/doctor-modules/doctor-health/src/main/java/doctor/entity/VideoCountEntity.java new file mode 100644 index 0000000..9965c9f --- /dev/null +++ b/doctor-modules/doctor-health/src/main/java/doctor/entity/VideoCountEntity.java @@ -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; +} diff --git a/doctor-modules/doctor-health/src/main/java/doctor/entity/VideoEntity.java b/doctor-modules/doctor-health/src/main/java/doctor/entity/VideoEntity.java new file mode 100644 index 0000000..c7daafd --- /dev/null +++ b/doctor-modules/doctor-health/src/main/java/doctor/entity/VideoEntity.java @@ -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; +} diff --git a/doctor-modules/doctor-health/src/main/java/doctor/mapper/HealthUserVideoMapper.java b/doctor-modules/doctor-health/src/main/java/doctor/mapper/HealthUserVideoMapper.java new file mode 100644 index 0000000..23b8b24 --- /dev/null +++ b/doctor-modules/doctor-health/src/main/java/doctor/mapper/HealthUserVideoMapper.java @@ -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 findVideoCategoryList(VideoCategoryEntity entity); + + List findVideoVoList(@Param("categoryId") Integer categoryId); +} diff --git a/doctor-modules/doctor-health/src/main/java/doctor/service/HealthUserVideoService.java b/doctor-modules/doctor-health/src/main/java/doctor/service/HealthUserVideoService.java new file mode 100644 index 0000000..f90a472 --- /dev/null +++ b/doctor-modules/doctor-health/src/main/java/doctor/service/HealthUserVideoService.java @@ -0,0 +1,14 @@ +package doctor.service; + + + +import doctor.entity.VideoCategoryEntity; +import doctor.entity.VideoEntity; + +import java.util.List; + +public interface HealthUserVideoService { + List findVideoCategoryList(VideoCategoryEntity entity); + + List findVideoVoList(Integer categoryId); +} diff --git a/doctor-modules/doctor-health/src/main/java/doctor/service/impl/HealthUserVideoServiceImpl.java b/doctor-modules/doctor-health/src/main/java/doctor/service/impl/HealthUserVideoServiceImpl.java new file mode 100644 index 0000000..6ed7e09 --- /dev/null +++ b/doctor-modules/doctor-health/src/main/java/doctor/service/impl/HealthUserVideoServiceImpl.java @@ -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 findVideoCategoryList(VideoCategoryEntity entity) { + return healthUserVideoMapper.findVideoCategoryList(entity); + } + + @Override + public List findVideoVoList(Integer categoryId) { + return healthUserVideoMapper.findVideoVoList(categoryId); + } +} diff --git a/doctor-modules/doctor-health/src/main/resources/mapper/HealthUserVideoMapper.xml b/doctor-modules/doctor-health/src/main/resources/mapper/HealthUserVideoMapper.xml new file mode 100644 index 0000000..3efe450 --- /dev/null +++ b/doctor-modules/doctor-health/src/main/resources/mapper/HealthUserVideoMapper.xml @@ -0,0 +1,14 @@ + + + + + + + +