瀏覽代碼

缩略图添加脚本调用

houweiyu 4 年之前
父節點
當前提交
36ff96b653

+ 8 - 6
fdkanfang-application/src/main/resources/application-dev.properties

@@ -78,21 +78,23 @@ spring.rabbitmq.port=5672
 spring.rabbitmq.username=guest
 spring.rabbitmq.password=guest
 
-#四维看看的登录域名
+#锟斤拷维锟斤拷锟斤拷锟侥碉拷录锟斤拷锟斤拷
 4dkankan.host=https://test.4dkankan.com/
 
 #queue
 verticle.queue=verticalQueue
 
 
-#垂直校验远程调用脚本路径
-verticle.remote.call.path=bash /home/algorithm/HorizonNet.sh 
+#锟斤拷直校锟斤拷远锟教碉拷锟矫脚憋拷路锟斤拷
+verticle.remote.call.path=bash /home/algorithm/HorizonNet.sh
+#鍥剧墖鍘嬬缉杩滅▼璋冪敤鎵ц�鎸囦护
+scale.image.remote.call.path=bash /home/algorithm/ScaleImage.sh 
 
-#房源制作完成短信模板id和签名
+#锟斤拷源锟斤拷锟斤拷锟斤拷啥锟斤拷锟侥o拷锟絠d锟斤拷签锟斤拷
 scene.finish.sms.template.id=SMS_201717882
-sms.common.sign=四维看看Sketch
+sms.common.sign=锟斤拷维锟斤拷锟斤拷Sketch
 
-#用户上传全景图通知的管理员的邮箱账号
+#锟矫伙拷锟较达拷全锟斤拷图通知锟侥癸拷锟斤拷员锟斤拷锟斤拷锟斤拷锟剿猴拷
 admin.email.account=service@4dage.com
 
 

+ 7 - 6
fdkanfang-application/src/main/resources/application-prod.properties

@@ -69,20 +69,21 @@ spring.rabbitmq.port=5672
 spring.rabbitmq.username=4dage 
 spring.rabbitmq.password=4dagecui2019$
 
-#四维看看的登录域名
+#锟斤拷维锟斤拷锟斤拷锟侥碉拷录锟斤拷锟斤拷
 4dkankan.host=https://4dkankan.com/
 
 #queue
 verticle.queue=verticalQueue
 
-#垂直校验远程调用脚本路径
+#锟斤拷直校锟斤拷远锟教碉拷锟矫脚憋拷路锟斤拷
 verticle.remote.call.path=bash /home/algorithm/HorizonNet.sh 
-
-#房源制作完成短信模板id和签名
+#鍥剧墖鍘嬬缉杩滅▼璋冪敤鎵ц�鎸囦护
+scale.image.remote.call.path=bash /home/algorithm/ScaleImage.sh 
+#锟斤拷源锟斤拷锟斤拷锟斤拷啥锟斤拷锟侥o拷锟絠d锟斤拷签锟斤拷
 scene.finish.sms.template.id=SMS_201717882
-sms.common.sign=四维看看Sketch
+sms.common.sign=锟斤拷维锟斤拷锟斤拷Sketch
 
-#用户上传全景图通知的管理员的邮箱账号
+#锟矫伙拷锟较达拷全锟斤拷图通知锟侥癸拷锟斤拷员锟斤拷锟斤拷锟斤拷锟剿猴拷
 admin.email.account=service@4dage.com
 
 

+ 10 - 9
fdkanfang-application/src/main/resources/application-test.properties

@@ -3,7 +3,7 @@
 # \u6570\u636E\u6E90\u914D\u7F6E
 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
-spring.datasource.druid.url=jdbc:mysql://120.25.146.52:3306/fdkanfang?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.url=jdbc:mysql://127.0.0.1:3306/fdkanfang?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
 spring.datasource.druid.username=root
 #spring.datasource.druid.password=4dkk2019%
 spring.datasource.druid.password=4dkk2020test%
@@ -52,7 +52,7 @@ spring.redis.jedis.pool.max-wait=-1ms
 
 # \u6587\u4EF6\u4FDD\u5B58\u8DEF\u5F84\uFF0C\u7B97\u6CD5\u751F\u6210\u6587\u4EF6\u5730\u5740
 #output.file.path=/data/kanfang/
-output.file.path=/root/data/kanfang/
+output.file.path=/mnt/data_sk/kanfang/
 
 #\u7F16\u8F91\u9875\u9762
 server.domain=http://test.4dkankan.com/spc.html
@@ -66,23 +66,24 @@ logging.level.com.fdkanfang=debug
 spring.rabbitmq.host=127.0.0.1
 #spring.rabbitmq.host=localhost
 spring.rabbitmq.port=5672
-spring.rabbitmq.username=guest 
+spring.rabbitmq.username=guest
 spring.rabbitmq.password=guest
 
-#四维看看的登录域名
+#锟斤拷维锟斤拷锟斤拷锟侥碉拷录锟斤拷锟斤拷
 4dkankan.host=https://test.4dkankan.com/
 
 #queue
 verticle.queue=verticalQueue
 
-#垂直校验远程调用脚本路径
+#锟斤拷直校锟斤拷远锟教碉拷锟矫脚憋拷路锟斤拷
 verticle.remote.call.path=bash /home/algorithm/HorizonNet.sh 
-
-#房源制作完成短信模板id和签名
+#鍥剧墖鍘嬬缉杩滅▼璋冪敤鎵ц�鎸囦护
+scale.image.remote.call.path=bash /home/algorithm/ScaleImage.sh 
+#锟斤拷源锟斤拷锟斤拷锟斤拷啥锟斤拷锟侥o拷锟絠d锟斤拷签锟斤拷
 scene.finish.sms.template.id=SMS_201717882
-sms.common.sign=四维看看Sketch
+sms.common.sign=锟斤拷维锟斤拷锟斤拷Sketch
 
-#用户上传全景图通知的管理员的邮箱账号
+#锟矫伙拷锟较达拷全锟斤拷图通知锟侥癸拷锟斤拷员锟斤拷锟斤拷锟斤拷锟剿猴拷
 admin.email.account=service@4dage.com
 
 oss.point=http://oss-cn-shenzhen-internal.aliyuncs.com

+ 3 - 3
fdkanfang-application/src/main/resources/application.properties

@@ -23,7 +23,7 @@ pagehelper.reasonable=false
 pagehelper.support-methods-arguments=true
 
 #\u7EBF\u7A0B\u6C60
-spring.task.pool.corePoolSize=10
-spring.task.pool.maxPoolSize=100
+spring.task.pool.corePoolSize=32
+spring.task.pool.maxPoolSize=64
 spring.task.pool.keepAliveSeconds=100
-spring.task.pool.queueCapacity=100
+spring.task.pool.queueCapacity=200

+ 0 - 42
fdkanfang-common/src/main/java/com/fdkanfang/common/config/TaskExecutePool.java

@@ -1,42 +0,0 @@
-package com.fdkanfang.common.config;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.annotation.EnableAsync;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-
-import java.util.concurrent.Executor;
-import java.util.concurrent.ThreadPoolExecutor;
-
-/**
- * Created by owen on 2017/8/29.
- */
-//@Configuration
-//@EnableAsync
-//public class TaskExecutePool {
-//
-//    @Value("${spring.task.pool.corePoolSize}")
-//    private int corePoolSize;
-//    @Value("${spring.task.pool.corePoolSize}")
-//    private int maxPoolSize;
-//    @Value("${spring.task.pool.keepAliveSeconds}")
-//    private int keepAliveSeconds;
-//    @Value("${spring.task.pool.queueCapacity}")
-//    private int queueCapacity;
-//
-//    @Bean
-//    public Executor taskExecutor() {
-//        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
-//        executor.setCorePoolSize(corePoolSize);
-//        executor.setMaxPoolSize(maxPoolSize);
-//        executor.setQueueCapacity(queueCapacity);
-//        executor.setKeepAliveSeconds(keepAliveSeconds);
-//        executor.setThreadNamePrefix("MyExecutor-");
-//        // rejection-policy:当pool已经达到max size的时候,如何处理新任务
-//        // CALLER_RUNS:不在新线程中执行任务,而是由调用者所在的线程来执行
-//        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
-//        executor.initialize();
-//        return executor;
-//    }
-//}

+ 43 - 0
fdkanfang-common/src/main/java/com/fdkanfang/common/config/TaskExecutorPool.java

@@ -0,0 +1,43 @@
+package com.fdkanfang.common.config;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.AsyncConfigurer;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.Executor;
+import java.util.concurrent.ThreadPoolExecutor;
+
+/**
+ * Created by owen on 2017/8/29.
+ */
+@Configuration
+@EnableAsync
+public class TaskExecutorPool implements AsyncConfigurer {
+
+    @Value("${spring.task.pool.corePoolSize}")
+    private int corePoolSize;
+    @Value("${spring.task.pool.maxPoolSize}")
+    private int maxPoolSize;
+    @Value("${spring.task.pool.keepAliveSeconds}")
+    private int keepAliveSeconds;
+    @Value("${spring.task.pool.queueCapacity}")
+    private int queueCapacity;
+
+    @Bean
+    public Executor taskExecutor() {
+        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+        executor.setCorePoolSize(corePoolSize);
+        executor.setMaxPoolSize(maxPoolSize);
+        executor.setQueueCapacity(queueCapacity);
+        executor.setKeepAliveSeconds(keepAliveSeconds);
+        executor.setThreadNamePrefix("MyTaskExecutor-");
+        // rejection-policy:当pool已经达到max size的时候,如何处理新任务
+        // CALLER_RUNS:不在新线程中执行任务,而是由调用者所在的线程来执行
+        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+        executor.initialize();
+        return executor;
+    }
+}

+ 36 - 0
fdkanfang-common/src/main/java/com/fdkanfang/common/util/ApplicationContextGetBeanHelper.java

@@ -0,0 +1,36 @@
+package com.fdkanfang.common.util;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+
+/**
+ * 2 * @Author: Abner
+ * 3 * @Date: 2020/12/3 11:25
+ * 4
+ */
+@Component
+public class ApplicationContextGetBeanHelper implements ApplicationContextAware {
+    private static ApplicationContext applicationContext;
+
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+        this.applicationContext = applicationContext;
+    }
+
+    public static Object getBean(String className) throws BeansException,IllegalArgumentException {
+        if(className==null || className.length()<=0) {
+            throw new IllegalArgumentException("className为空");
+        }
+
+        String beanName = null;
+        if(className.length() > 1) {
+            beanName = className.substring(0, 1).toLowerCase() + className.substring(1);
+        } else {
+            beanName = className.toLowerCase();
+        }
+        return applicationContext != null ? applicationContext.getBean(beanName) : null;
+    }
+
+}

+ 1 - 0
fdkanfang-common/src/main/java/com/fdkanfang/common/util/OssCheckPointUploadUtil.java

@@ -86,6 +86,7 @@ public class OssCheckPointUploadUtil {
             File file = new File(filePath);
             if (!file.exists()) {
                 log.error("要上传的文件不存在:" + filePath);
+                return;
             }
             ossClient.putObject(bucketName, key1, file);
         } catch (Exception e) {

文件差異過大導致無法顯示
+ 359 - 305
fdkanfang-web/src/main/java/com/fdkanfang/web/backend/HouseController.java