From 5d194d832d373e65ec7c3dfd9beefab9bac7b340 Mon Sep 17 00:00:00 2001 From: chen <1251790704@qq.com> Date: Wed, 28 Apr 2021 15:39:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=8C=E7=AB=99=E6=AD=A3=E5=BC=8F=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../liuwanr/controller/PetController.java | 20 ++---- .../resources/application-prod.properties | 38 +++++++++++ .../resources/application-test.properties | 41 ++++-------- src/main/resources/application.properties | 65 +------------------ 5 files changed, 60 insertions(+), 106 deletions(-) create mode 100644 src/main/resources/application-prod.properties diff --git a/pom.xml b/pom.xml index 5d82d82..1b0714e 100644 --- a/pom.xml +++ b/pom.xml @@ -273,7 +273,7 @@ - ROOT + root org.apache.maven.plugins diff --git a/src/main/java/com/yipin/liuwanr/controller/PetController.java b/src/main/java/com/yipin/liuwanr/controller/PetController.java index 8f1b804..18b58f7 100644 --- a/src/main/java/com/yipin/liuwanr/controller/PetController.java +++ b/src/main/java/com/yipin/liuwanr/controller/PetController.java @@ -1,20 +1,12 @@ package com.yipin.liuwanr.controller; -import java.util.HashMap; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - import com.yipin.liuwanr.entity.Pet; import com.yipin.liuwanr.entity.Response; import com.yipin.liuwanr.service.PetService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; @RestController @RequestMapping("/pet") @@ -26,7 +18,7 @@ public class PetController { @PostMapping("/create") Response createPet(@RequestHeader("X-UUID") String uuid, @RequestBody Pet pet) { Response resp = new Response(); - HashMap ret = petService.create(uuid, pet); + HashMap ret = petService.create(uuid, pet); int status = (int) ret.get("retcode"); if(200 == status){ resp.setStatus(status); @@ -82,7 +74,7 @@ public class PetController { } else{ resp.setStatus(status); - resp.setErrmessage(ret.get("retvalue").toString()); + resp.setErrmessage(ret.get("retvalue").toString() ); } return resp; } diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties new file mode 100644 index 0000000..6427289 --- /dev/null +++ b/src/main/resources/application-prod.properties @@ -0,0 +1,38 @@ +server.port=8090 +server.servlet.context-path=/liuwanr + +#\u6B63\u5F0F\u6570\u636E\u5E93\u8FDE\u63A5 +spring.datasource.url=jdbc:mysql://rm-wz90d92p0pf083nxzno.mysql.rds.aliyuncs.com:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai +spring.datasource.username=root +spring.datasource.password=HuoRan@2021 +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +#redis\u914D\u7F6E +spring.redis.database=0 +spring.redis.host=127.0.0.1 +spring.redis.password= +spring.redis.port=6379 +spring.redis.timeout=3000 +spring.redis.jedis.pool.max-idle=500 +spring.redis.jedis.pool.min-idle=50 +spring.redis.jedis.pool.max-active=2000 +spring.redis.jedis.pool.max-wait=1000 + +#\u65E5\u5FD7\u7EA7\u522B +logging.level.jdbc=OFF +logging.level.jdbc.sqltiming=DEBUG +logging.level.jdbc.resultsettable=DEBUG +logging.level.com.yipin.liuwar.mapper=DEBUG +logging.level.com.yipin.liuwanr.mapper=DEBUG + +spring.elasticsearch.rest.uris=http://es-cn-v641e944a0006xtwy.elasticsearch.aliyuncs.com:9200 +spring.elasticsearch.rest.username=elastic +spring.elasticsearch.rest.password=1qaz@WSX + +# maxFileSize \u5355\u4E2A\u6570\u636E\u5927\u5C0F +spring.servlet.multipart.maxFileSize = 1024MB +# maxRequestSize \u662F\u603B\u6570\u636E\u5927\u5C0F +spring.servlet.multipart.maxRequestSize=10240MB + +pagehelper.reasonable=false + diff --git a/src/main/resources/application-test.properties b/src/main/resources/application-test.properties index 192779a..4924092 100644 --- a/src/main/resources/application-test.properties +++ b/src/main/resources/application-test.properties @@ -1,21 +1,13 @@ -# See http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html -spring.thymeleaf.cache=false -spring.main.show-banner=false - -logging.level.jdbc=OFF -logging.level.jdbc.sqltiming=DEBUG -logging.level.jdbc.resultsettable=DEBUG -logging.level.com.yipin.liuwar.mapper=DEBUG +server.port=8090 +server.servlet.context-path=/liuwanr -spring.datasource.url=jdbc:mysql://rm-wz9y13wf7u8q8610fwo.mysql.rds.aliyuncs.com:3306/keda?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai +#\u6D4B\u8BD5\u6570\u636E\u5E93\u8FDE\u63A5 +spring.datasource.url=jdbc:mysql://rm-wz9y13wf7u8q8610fwo.mysql.rds.aliyuncs.com:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai spring.datasource.username=super spring.datasource.password=huoran888 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.mina.port=9123 -spring.mina.buffersize=2048 -spring.mina.idletime=15 - +#redis\u914D\u7F6E spring.redis.database=0 spring.redis.host=127.0.0.1 spring.redis.password=msdw@2021 @@ -25,29 +17,22 @@ spring.redis.jedis.pool.max-idle=500 spring.redis.jedis.pool.min-idle=50 spring.redis.jedis.pool.max-active=2000 spring.redis.jedis.pool.max-wait=1000 -#spring.redis.pool.max-idle=500 -#spring.redis.pool.min-idle=50 -#spring.redis.pool.max-active=2000 -#spring.redis.pool.max-wait=1000 + +#\u65E5\u5FD7\u7EA7\u522B +logging.level.jdbc=OFF +logging.level.jdbc.sqltiming=DEBUG +logging.level.jdbc.resultsettable=DEBUG +logging.level.com.yipin.liuwar.mapper=DEBUG +logging.level.com.yipin.liuwanr.mapper=DEBUG spring.elasticsearch.rest.uris=http://es-cn-v641e944a0006xtwy.elasticsearch.aliyuncs.com:9200 spring.elasticsearch.rest.username=elastic spring.elasticsearch.rest.password=1qaz@WSX -pagehelper.reasonable=false - # maxFileSize \u5355\u4E2A\u6570\u636E\u5927\u5C0F spring.servlet.multipart.maxFileSize = 1024MB # maxRequestSize \u662F\u603B\u6570\u636E\u5927\u5C0F spring.servlet.multipart.maxRequestSize=10240MB -logging.level.com.yipin.liuwanr.mapper=debug - -#redis-cluster -redis.cluster.maxTotal=200 -redis.cluster.maxIdle=8 -redis.cluster.minIdle=3 -redis.cluster.nodes=192.168.136.191:8000,192.168.136.191:8001,192.168.136.191:8002 +pagehelper.reasonable=false -server.port=8090 -server.servlet.context-path= /liuwanr \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 63313e8..bab924b 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,63 +1,2 @@ -# See http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html -spring.thymeleaf.cache=false -spring.main.show-banner=false - -logging.level.jdbc=OFF -logging.level.jdbc.sqltiming=DEBUG -logging.level.jdbc.resultsettable=DEBUG -logging.level.com.yipin.liuwar.mapper=DEBUG - -#易品测试liuwanr服务器 -职站项目 -#spring.datasource.url=jdbc:mysql://rm-wz9y13wf7u8q8610fwo.mysql.rds.aliyuncs.com:3306/huoran?useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true -#spring.datasource.username=super -#spring.datasource.password=huoran888 -#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver - -#或然正式服务器 -科大项目 -spring.datasource.url=jdbc:mysql://rm-wz9y13wf7u8q8610fwo.mysql.rds.aliyuncs.com:3306/keda?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai -spring.datasource.username=super -spring.datasource.password=huoran888 -spring.datasource.driver-class-name=com.mysql.jdbc.Driver - - - - -spring.mina.port=9123 -spring.mina.buffersize=2048 -spring.mina.idletime=15 - -spring.redis.database=0 -spring.redis.host=127.0.0.1 -spring.redis.password= -spring.redis.port=6379 -spring.redis.timeout=3000 -spring.redis.jedis.pool.max-idle=500 -spring.redis.jedis.pool.min-idle=50 -spring.redis.jedis.pool.max-active=2000 -spring.redis.jedis.pool.max-wait=1000 -#spring.redis.pool.max-idle=500 -#spring.redis.pool.min-idle=50 -#spring.redis.pool.max-active=2000 -#spring.redis.pool.max-wait=1000 - -spring.elasticsearch.rest.uris=http://es-cn-v641e944a0006xtwy.elasticsearch.aliyuncs.com:9200 -spring.elasticsearch.rest.username=elastic -spring.elasticsearch.rest.password=1qaz@WSX - -pagehelper.reasonable=false - -# maxFileSize \u5355\u4E2A\u6570\u636E\u5927\u5C0F -spring.servlet.multipart.maxFileSize = 1024MB -# maxRequestSize \u662F\u603B\u6570\u636E\u5927\u5C0F -spring.servlet.multipart.maxRequestSize=10240MB - -logging.level.com.yipin.liuwanr.mapper=debug - -#redis-cluster -redis.cluster.maxTotal=200 -redis.cluster.maxIdle=8 -redis.cluster.minIdle=3 -redis.cluster.nodes=192.168.136.191:8000,192.168.136.191:8001,192.168.136.191:8002 - -server.port=8090 -server.servlet.context-path= /liuwanr \ No newline at end of file +#\u9009\u62E9\u6307\u5B9A\u73AF\u5883,\u76EE\u524D\u53EA\u6709\u6D4B\u8BD5\u548C\u6B63\u5F0F\u73AF\u5883 +spring.profiles.active=prod \ No newline at end of file