Преглед изворни кода

修改场地列表页面展示bug

syh пре 4 година
родитељ
комит
04ac7f2dd5

+ 27 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/YardController.java

@@ -1,9 +1,8 @@
 package org.jeecg.modules.ctop.controller;
 
-import cn.com.ctop.manage.modules.actor.entity.Yard;
-import cn.com.ctop.manage.modules.actor.entity.YardComment;
-import cn.com.ctop.manage.modules.actor.entity.YardPhoto;
-import cn.com.ctop.manage.modules.actor.entity.YardVideo;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
+import cn.com.ctop.manage.modules.actor.entity.*;
 import cn.com.ctop.manage.modules.actor.service.IYardCommentService;
 import cn.com.ctop.manage.modules.actor.service.IYardPhotoService;
 import cn.com.ctop.manage.modules.actor.service.IYardService;
@@ -49,7 +48,31 @@ public class YardController {
     public Result<Yard> add(@RequestBody Yard yard) {
         Result<Yard> result = new Result<>();
         try {
+            String coverUrl = yard.getCoverUrl();
+            if (!Check.isNull(coverUrl) && !coverUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                yard.setCoverUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + coverUrl);
+            }
             yardService.save(yard);
+            if (null != yard.getImageUrl() && !yard.getImageUrl().isEmpty()) {
+                for (String url : yard.getImageUrl()) {
+                    YardPhoto photo = new YardPhoto();
+                    photo.setYardId(yard.getId());
+                    if (!Check.isNull(url) && !url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                        photo.setPhotoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + url);
+                    }
+                    yardPhotoService.save(photo);
+                }
+            }
+            if (yard.getVideoUrl() != null && !yard.getVideoUrl().isEmpty()) {
+                for (String url : yard.getVideoUrl()) {
+                    YardVideo video = new YardVideo();
+                    video.setYardId(yard.getId());
+                    if (!Check.isNull(url) && !url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                        video.setVideoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + url);
+                    }
+                    yardVideoService.save(video);
+                }
+            }
             result.success("添加成功!");
         } catch (Exception e) {
             log.error(e.getMessage(), e);

+ 6 - 12
jeecg-boot-module-system/src/main/resources/application-wps.yml

@@ -56,12 +56,9 @@ spring:
   autoconfigure:
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   datasource:
-#    url: jdbc:mysql://139.186.27.96:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-#    username: hcst
-#    password: test@20190531
-    url: jdbc:mysql://139.186.31.213:3316/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-    username: root
-    password: hcst@2020
+    url: jdbc:mysql://139.186.27.96:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+    username: hcst
+    password: test@20190531
     driver-class-name: com.mysql.jdbc.Driver
     druid:
       stat-view-servlet:
@@ -99,12 +96,9 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-#          url: jdbc:mysql://139.186.27.96:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-#          username: hcst
-#          password: test@20190531
-          url: jdbc:mysql://139.186.31.213:3316/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-          username: root
-          password: hcst@2020
+          url: jdbc:mysql://139.186.27.96:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          username: hcst
+          password: test@20190531
           driver-class-name: com.mysql.jdbc.Driver
   #redis 配置
   redis: