diff --git a/doctor-modules/doctor-health/pom.xml b/doctor-modules/doctor-health/pom.xml index bad8103..b2017f8 100644 --- a/doctor-modules/doctor-health/pom.xml +++ b/doctor-modules/doctor-health/pom.xml @@ -12,6 +12,11 @@ doctor-health + + 1.18.12 + 1.4.2.Final + + @@ -96,9 +101,26 @@ spring-boot-starter-mail - + + org.mapstruct + mapstruct + ${mapstruct.version} + + + org.mapstruct + mapstruct-jdk8 + ${mapstruct.version} + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + + + + ${project.artifactId} @@ -116,4 +138,5 @@ + diff --git a/doctor-modules/doctor-health/src/main/java/doctor/convert/VideoConvert.java b/doctor-modules/doctor-health/src/main/java/doctor/convert/VideoConvert.java new file mode 100644 index 0000000..517085e --- /dev/null +++ b/doctor-modules/doctor-health/src/main/java/doctor/convert/VideoConvert.java @@ -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 videoVoListToVideoEntityList(List videoVoList); + + List videoEntityListToVideoVoList(List videoEntityList); +} 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 index bd32a87..ab0c1ce 100644 --- 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 @@ -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 findVideoVoList(Integer categoryId, Integer userId) { List videoVoList = healthUserVideoMapper.findVideoVoList(categoryId); - List videoVos = ConvertUtil.entityToVoList(videoVoList, VideoVo.class); + List videoVos = VideoConvert.INSTANCE.videoEntityListToVideoVoList(videoVoList); videoVos.forEach(video -> { UserVideoCollectionEntity userVideoCollection = healthUserVideoMapper.selectWhetherCollectionByUserIdAndVideoId(userId,video.getId()); if(userVideoCollection!=null){ diff --git a/doctor-modules/doctor-health/src/main/resources/bootstrap.yml b/doctor-modules/doctor-health/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..185a3ce --- /dev/null +++ b/doctor-modules/doctor-health/src/main/resources/bootstrap.yml @@ -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 diff --git a/pom.xml b/pom.xml index 94655ec..1a1be07 100644 --- a/pom.xml +++ b/pom.xml @@ -35,6 +35,7 @@ 8.2.2 4.1.2 2.14.4 + 1.4.2.Final @@ -206,6 +207,22 @@ ${doctor.version} + + org.mapstruct + mapstruct + ${mapstruct.version} + + + org.mapstruct + mapstruct-jdk8 + ${mapstruct.version} + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + +