zmy07
parent
13779a763d
commit
b16905e43d
|
@ -12,6 +12,11 @@
|
|||
|
||||
<artifactId>doctor-health</artifactId>
|
||||
|
||||
<properties>
|
||||
<lombok.version>1.18.12</lombok.version>
|
||||
<mapstruct.version>1.4.2.Final</mapstruct.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- Oss上传 -->
|
||||
|
@ -96,9 +101,26 @@
|
|||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-jdk8</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
|
@ -116,4 +138,5 @@
|
|||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package doctor.convert;
|
||||
|
||||
import doctor.domain.entity.VideoEntity;
|
||||
import doctor.domain.vo.VideoVo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.w3c.dom.stylesheets.LinkStyle;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface VideoConvert {
|
||||
VideoConvert INSTANCE = Mappers.getMapper(VideoConvert.class);
|
||||
|
||||
VideoVo videoEntityToVideoVo(VideoEntity videoEntity);
|
||||
|
||||
VideoEntity videoVoToVideoEntity(VideoVo videoVo);
|
||||
|
||||
List<VideoEntity> videoVoListToVideoEntityList(List<VideoVo> videoVoList);
|
||||
|
||||
List<VideoVo> videoEntityListToVideoVoList(List<VideoEntity> videoEntityList);
|
||||
}
|
|
@ -3,6 +3,7 @@ package doctor.service.impl;
|
|||
|
||||
import doctor.common.security.service.TokenService;
|
||||
import doctor.common.security.utils.SecurityUtils;
|
||||
import doctor.convert.VideoConvert;
|
||||
import doctor.domain.entity.UserVideoBuyEntity;
|
||||
import doctor.domain.entity.UserVideoCollectionEntity;
|
||||
import doctor.domain.entity.VideoCategoryEntity;
|
||||
|
@ -37,7 +38,7 @@ public class HealthUserVideoServiceImpl implements HealthUserVideoService {
|
|||
@Override
|
||||
public List<VideoVo> findVideoVoList(Integer categoryId, Integer userId) {
|
||||
List<VideoEntity> videoVoList = healthUserVideoMapper.findVideoVoList(categoryId);
|
||||
List<VideoVo> videoVos = ConvertUtil.entityToVoList(videoVoList, VideoVo.class);
|
||||
List<VideoVo> videoVos = VideoConvert.INSTANCE.videoEntityListToVideoVoList(videoVoList);
|
||||
videoVos.forEach(video -> {
|
||||
UserVideoCollectionEntity userVideoCollection = healthUserVideoMapper.selectWhetherCollectionByUserIdAndVideoId(userId,video.getId());
|
||||
if(userVideoCollection!=null){
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9204
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: doctor-health
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 101.34.77.101:8848
|
||||
namespace: 7e34f104-f333-4828-b36a-02146e521c9a
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
mail:
|
||||
host: smtp.qq.com
|
||||
port: 587
|
||||
username: 3581044601@qq.com
|
||||
password: bwscqgqpkagjciih
|
||||
default-encoding: UTF8
|
||||
properties:
|
||||
mail:
|
||||
smtp:
|
||||
socketFactoryClass: javax.net.ssl.SSLSocketFactory
|
||||
debug: true
|
17
pom.xml
17
pom.xml
|
@ -35,6 +35,7 @@
|
|||
<minio.version>8.2.2</minio.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<transmittable-thread-local.version>2.14.4</transmittable-thread-local.version>
|
||||
<mapstruct.version>1.4.2.Final</mapstruct.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
|
@ -206,6 +207,22 @@
|
|||
<version>${doctor.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-jdk8</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
|
Loading…
Reference in New Issue