diff --git a/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_5_23.xml b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_5_23.xml
deleted file mode 100644
index 99e8c9e..0000000
--- a/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_5_23.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_23.xml b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_23.xml
deleted file mode 100644
index 6a989bb..0000000
--- a/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_23.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_apache_tomcat_tomcat_annotations_api_8_5_23.xml b/.idea/libraries/Maven__org_apache_tomcat_tomcat_annotations_api_8_5_23.xml
deleted file mode 100644
index 4aba27a..0000000
--- a/.idea/libraries/Maven__org_apache_tomcat_tomcat_annotations_api_8_5_23.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_1_5_8_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_1_5_8_RELEASE.xml
deleted file mode 100644
index d4fd605..0000000
--- a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_1_5_8_RELEASE.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index d30d09e..40d5ffa 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -7,7 +7,7 @@
-
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index a571675..999326f 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,34 +2,46 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
@@ -192,35 +204,141 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
+
-
-
-
-
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -237,7 +355,6 @@
m
- getByToken
商品已经秒杀完毕
refreshVerifyCode
path
@@ -257,6 +374,10 @@
joda
expire
redssionProperties
+ redisson
+ getBy
+ addC
+ getByToken
@@ -266,10 +387,6 @@
@@ -354,10 +475,10 @@
-
-
-
-
+
+
+
+
@@ -589,8 +710,7 @@
-
-
+
@@ -622,15 +742,6 @@
-
-
-
-
-
-
-
-
-
@@ -639,7 +750,15 @@
-
+
+
+
+
+
+
+
+
+
@@ -649,7 +768,24 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -659,19 +795,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -680,11 +805,15 @@
+
+
+
+
-
+
@@ -696,8 +825,8 @@
-
-
+
+
@@ -887,11 +1016,20 @@
+
+
+
+
+
+
+
+
+
-
+
@@ -903,9 +1041,10 @@
-
+
+
-
+
@@ -915,15 +1054,15 @@
-
-
+
+
-
+
-
+
@@ -1030,12 +1169,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/access/AccessInterceptor.java
- 31
-
-
-
file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/service/MiaoShaUserService.java
94
@@ -1079,11 +1212,17 @@
- file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/timeTask/OrderCloseTask.java
- 81
+ file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/controller/MiaoshaController.java
+ 148
+
+ file://$PROJECT_DIR$/src/main/java/com/geekq/miaosha/access/AccessInterceptor.java
+ 31
+
+
+
@@ -1129,182 +1268,16 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -1330,21 +1303,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1355,88 +1313,12 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
@@ -1447,26 +1329,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -1474,25 +1337,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1500,72 +1344,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1573,23 +1351,244 @@
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
index c1b0d9c..8a03647 100644
--- a/README.md
+++ b/README.md
@@ -52,7 +52,7 @@
监控工具:1.nginx_status并发统计,Ngxtop缓存统计
### nginx负载均衡
-![整体流程](http://i2.bvimg.com/601558/23f54a389b2b23e8.png)
+![整体流程](https://raw.githubusercontent.com/qiurunze123/imageall/master/miaosha2.png)
### 8.服务降级--服务熔断(过载保护)
@@ -97,7 +97,7 @@ redis的数量不是库存,他的作用仅仅只是为了阻挡多余的请求
### 15.为什么threadlocal存储user对象,原理??
-![整体流程](http://i2.bvimg.com/601558/3293e36cc2c7e303.png)
+![整体流程](https://raw.githubusercontent.com/qiurunze123/imageall/master/miaosha1.png)
1.并发编程中重要的问题就是数据共享,当你在一个线程中改变任意属性时,所有的线程都会因此受到影响,同时会看到第一个线程修改后的值
有时我们希望如此,比如:多个线程增大或减小同一个计数器变量
diff --git a/miaosha.iml b/miaosha.iml
index e612dd1..615e47e 100644
--- a/miaosha.iml
+++ b/miaosha.iml
@@ -40,23 +40,25 @@
-
-
-
-
-
+
+
+
+
+
+
+
@@ -81,7 +83,6 @@
-
@@ -93,25 +94,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index af795bc..44878d0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,10 +46,26 @@
+
org.springframework.boot
spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+
+ provided
+
+
com.google.guava
guava
@@ -123,11 +139,11 @@
2.3
-
- org.redisson
- redisson
- 2.14.0
-
+
+
+
+
+
org.springframework.boot
diff --git a/src/main/java/com/geekq/miaosha/config/UserArgumentResolver.java b/src/main/java/com/geekq/miaosha/config/UserArgumentResolver.java
index 0e192fb..5c9517e 100644
--- a/src/main/java/com/geekq/miaosha/config/UserArgumentResolver.java
+++ b/src/main/java/com/geekq/miaosha/config/UserArgumentResolver.java
@@ -11,9 +11,6 @@ import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-
@Service
public class UserArgumentResolver implements HandlerMethodArgumentResolver {
@@ -41,13 +38,4 @@ public class UserArgumentResolver implements HandlerMethodArgumentResolver {
return UserContext.getUser();
}
- private String getCookieValue(HttpServletRequest request, String cookiName) {
- Cookie[] cookies = request.getCookies();
- for(Cookie cookie : cookies) {
- if(cookie.getName().equals(cookiName)) {
- return cookie.getValue();
- }
- }
- return null;
- }
}
diff --git a/src/main/java/com/geekq/miaosha/controller/MiaoshaController.java b/src/main/java/com/geekq/miaosha/controller/MiaoshaController.java
index 9b8db4a..24239b4 100644
--- a/src/main/java/com/geekq/miaosha/controller/MiaoshaController.java
+++ b/src/main/java/com/geekq/miaosha/controller/MiaoshaController.java
@@ -93,7 +93,7 @@ public class MiaoshaController implements InitializingBean {
return Result.error(CodeMsg.MIAO_SHA_OVER);
}
//预见库存
- long stock = redisService.decr(GoodsKey.getMiaoshaGoodsStock,""+goodsId) ;
+ Long stock = redisService.decr(GoodsKey.getMiaoshaGoodsStock,""+goodsId) ;
if(stock <0){
localOverMap.put(goodsId, true);
return Result.error(CodeMsg.MIAO_SHA_OVER);
@@ -162,6 +162,10 @@ public class MiaoshaController implements InitializingBean {
}
}
+ /**
+ * 系统初始化
+ * @throws Exception
+ */
@Override
public void afterPropertiesSet() throws Exception {
List goodsList= goodsService.listGoodsVo();
diff --git a/src/main/java/com/geekq/miaosha/redis/RedissonAutoConfiguration.java b/src/main/java/com/geekq/miaosha/redis/RedissonAutoConfiguration.java
index b26fb69..b025159 100644
--- a/src/main/java/com/geekq/miaosha/redis/RedissonAutoConfiguration.java
+++ b/src/main/java/com/geekq/miaosha/redis/RedissonAutoConfiguration.java
@@ -1,76 +1,76 @@
-package com.geekq.miaosha.redis;
-
-import org.apache.commons.lang3.StringUtils;
-import org.redisson.Redisson;
-import org.redisson.api.RedissonClient;
-import org.redisson.config.Config;
-import org.redisson.config.SentinelServersConfig;
-import org.redisson.config.SingleServerConfig;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-@Configuration
-@ConditionalOnClass(Config.class)
-@EnableConfigurationProperties(RedissonProperties.class)
-public class RedissonAutoConfiguration {
-
- @Autowired
- private RedissonProperties redssionProperties;
-
- /**
- * 哨兵模式自动装配
- * @return
- */
- @Bean
- @ConditionalOnProperty(name="redisson.master-name")
- RedissonClient redissonSentinel() {
- Config config = new Config();
- SentinelServersConfig serverConfig = config.useSentinelServers().addSentinelAddress(redssionProperties.getSentinelAddresses())
- .setMasterName(redssionProperties.getMasterName())
- .setTimeout(redssionProperties.getTimeout())
- .setMasterConnectionPoolSize(redssionProperties.getMasterConnectionPoolSize())
- .setSlaveConnectionPoolSize(redssionProperties.getSlaveConnectionPoolSize());
-
- if(StringUtils.isNotBlank(redssionProperties.getPassword())) {
- serverConfig.setPassword(redssionProperties.getPassword());
- }
- return Redisson.create(config);
- }
-
- /**
- * 单机模式自动装配
- * @return
- */
- @Bean
- @ConditionalOnProperty(name="redisson.address")
- RedissonClient redissonSingle() {
- Config config = new Config();
- SingleServerConfig serverConfig = config.useSingleServer()
- .setAddress(redssionProperties.getAddress())
- .setTimeout(redssionProperties.getTimeout())
- .setConnectionPoolSize(redssionProperties.getConnectionPoolSize())
- .setConnectionMinimumIdleSize(redssionProperties.getConnectionMinimumIdleSize());
-
- if(StringUtils.isNotBlank(redssionProperties.getPassword())) {
- serverConfig.setPassword(redssionProperties.getPassword());
- }
-
- return Redisson.create(config);
- }
-
- /**
- * 装配locker类,并将实例注入到RedissLockUtil中
- * @return
- */
- @Bean
- DistributedLocker distributedLocker(RedissonClient redissonSingle) {
- RedissonDistributedLocker locker = new RedissonDistributedLocker();
- locker.setRedissonClient(redissonSingle);
- RedissLockUtil.setLocker(locker);
- return locker;
- }
-}
+//package com.geekq.miaosha.redis;
+//
+//import org.apache.commons.lang3.StringUtils;
+//import org.redisson.Redisson;
+//import org.redisson.api.RedissonClient;
+//import org.redisson.config.Config;
+//import org.redisson.config.SentinelServersConfig;
+//import org.redisson.config.SingleServerConfig;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+//import org.springframework.boot.context.properties.EnableConfigurationProperties;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//
+//@Configuration
+//@ConditionalOnClass(Config.class)
+//@EnableConfigurationProperties(RedissonProperties.class)
+//public class RedissonAutoConfiguration {
+//
+// @Autowired
+// private RedissonProperties redssionProperties;
+//
+// /**
+// * 哨兵模式自动装配
+// * @return
+// */
+// @Bean
+// @ConditionalOnProperty(name="redisson.master-name")
+// RedissonClient redissonSentinel() {
+// Config config = new Config();
+// SentinelServersConfig serverConfig = config.useSentinelServers().addSentinelAddress(redssionProperties.getSentinelAddresses())
+// .setMasterName(redssionProperties.getMasterName())
+// .setTimeout(redssionProperties.getTimeout())
+// .setMasterConnectionPoolSize(redssionProperties.getMasterConnectionPoolSize())
+// .setSlaveConnectionPoolSize(redssionProperties.getSlaveConnectionPoolSize());
+//
+// if(StringUtils.isNotBlank(redssionProperties.getPassword())) {
+// serverConfig.setPassword(redssionProperties.getPassword());
+// }
+// return Redisson.create(config);
+// }
+//
+// /**
+// * 单机模式自动装配
+// * @return
+// */
+// @Bean
+// @ConditionalOnProperty(name="redisson.address")
+// RedissonClient redissonSingle() {
+// Config config = new Config();
+// SingleServerConfig serverConfig = config.useSingleServer()
+// .setAddress(redssionProperties.getAddress())
+// .setTimeout(redssionProperties.getTimeout())
+// .setConnectionPoolSize(redssionProperties.getConnectionPoolSize())
+// .setConnectionMinimumIdleSize(redssionProperties.getConnectionMinimumIdleSize());
+//
+// if(StringUtils.isNotBlank(redssionProperties.getPassword())) {
+// serverConfig.setPassword(redssionProperties.getPassword());
+// }
+//
+// return Redisson.create(config);
+// }
+//
+// /**
+// * 装配locker类,并将实例注入到RedissLockUtil中
+// * @return
+// */
+// @Bean
+// DistributedLocker distributedLocker(RedissonClient redissonSingle) {
+// RedissonDistributedLocker locker = new RedissonDistributedLocker();
+// locker.setRedissonClient(redissonSingle);
+// RedissLockUtil.setLocker(locker);
+// return locker;
+// }
+//}
diff --git a/src/main/java/com/geekq/miaosha/redis/RedissonDistributedLocker.java b/src/main/java/com/geekq/miaosha/redis/RedissonDistributedLocker.java
index dd99253..4ffd72f 100644
--- a/src/main/java/com/geekq/miaosha/redis/RedissonDistributedLocker.java
+++ b/src/main/java/com/geekq/miaosha/redis/RedissonDistributedLocker.java
@@ -1,39 +1,39 @@
-package com.geekq.miaosha.redis;
-
-import org.redisson.api.RLock;
-import org.redisson.api.RedissonClient;
-
-import java.util.concurrent.TimeUnit;
-
-public class RedissonDistributedLocker implements DistributedLocker {
-
- private RedissonClient redissonClient;
-
- @Override
- public void lock(String lockKey) {
- RLock lock = redissonClient.getLock(lockKey);
- lock.lock();
- }
-
- @Override
- public void unlock(String lockKey) {
- RLock lock = redissonClient.getLock(lockKey);
- lock.unlock();
- }
-
- @Override
- public void lock(String lockKey, int leaseTime) {
- RLock lock = redissonClient.getLock(lockKey);
- lock.lock(leaseTime, TimeUnit.SECONDS);
- }
-
- @Override
- public void lock(String lockKey, TimeUnit unit ,int timeout) {
- RLock lock = redissonClient.getLock(lockKey);
- lock.lock(timeout, unit);
- }
-
- public void setRedissonClient(RedissonClient redissonClient) {
- this.redissonClient = redissonClient;
- }
-}
\ No newline at end of file
+//package com.geekq.miaosha.redis;
+//
+//import org.redisson.api.RLock;
+//import org.redisson.api.RedissonClient;
+//
+//import java.util.concurrent.TimeUnit;
+//
+//public class RedissonDistributedLocker implements DistributedLocker {
+//
+// private RedissonClient redissonClient;
+//
+// @Override
+// public void lock(String lockKey) {
+// RLock lock = redissonClient.getLock(lockKey);
+// lock.lock();
+// }
+//
+// @Override
+// public void unlock(String lockKey) {
+// RLock lock = redissonClient.getLock(lockKey);
+// lock.unlock();
+// }
+//
+// @Override
+// public void lock(String lockKey, int leaseTime) {
+// RLock lock = redissonClient.getLock(lockKey);
+// lock.lock(leaseTime, TimeUnit.SECONDS);
+// }
+//
+// @Override
+// public void lock(String lockKey, TimeUnit unit ,int timeout) {
+// RLock lock = redissonClient.getLock(lockKey);
+// lock.lock(timeout, unit);
+// }
+//
+// public void setRedissonClient(RedissonClient redissonClient) {
+// this.redissonClient = redissonClient;
+// }
+//}
\ No newline at end of file
diff --git a/src/main/java/com/geekq/miaosha/redis/RedissonProperties.java b/src/main/java/com/geekq/miaosha/redis/RedissonProperties.java
index b2e2ec8..150ae3d 100644
--- a/src/main/java/com/geekq/miaosha/redis/RedissonProperties.java
+++ b/src/main/java/com/geekq/miaosha/redis/RedissonProperties.java
@@ -1,98 +1,98 @@
-package com.geekq.miaosha.redis;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-@ConfigurationProperties(prefix = "redisson")
-public class RedissonProperties {
-
- private int timeout = 3000;
-
- private String address;
-
- private String password;
-
- private int connectionPoolSize = 64;
-
- private int connectionMinimumIdleSize=10;
-
- private int slaveConnectionPoolSize = 250;
-
- private int masterConnectionPoolSize = 250;
-
- private String[] sentinelAddresses;
-
- private String masterName;
-
- public int getTimeout() {
- return timeout;
- }
-
- public void setTimeout(int timeout) {
- this.timeout = timeout;
- }
-
- public int getSlaveConnectionPoolSize() {
- return slaveConnectionPoolSize;
- }
-
- public void setSlaveConnectionPoolSize(int slaveConnectionPoolSize) {
- this.slaveConnectionPoolSize = slaveConnectionPoolSize;
- }
-
- public int getMasterConnectionPoolSize() {
- return masterConnectionPoolSize;
- }
-
- public void setMasterConnectionPoolSize(int masterConnectionPoolSize) {
- this.masterConnectionPoolSize = masterConnectionPoolSize;
- }
-
- public String[] getSentinelAddresses() {
- return sentinelAddresses;
- }
-
- public void setSentinelAddresses(String sentinelAddresses) {
- this.sentinelAddresses = sentinelAddresses.split(",");
- }
-
- public String getMasterName() {
- return masterName;
- }
-
- public void setMasterName(String masterName) {
- this.masterName = masterName;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public String getAddress() {
- return address;
- }
-
- public void setAddress(String address) {
- this.address = address;
- }
-
- public int getConnectionPoolSize() {
- return connectionPoolSize;
- }
-
- public void setConnectionPoolSize(int connectionPoolSize) {
- this.connectionPoolSize = connectionPoolSize;
- }
-
- public int getConnectionMinimumIdleSize() {
- return connectionMinimumIdleSize;
- }
-
- public void setConnectionMinimumIdleSize(int connectionMinimumIdleSize) {
- this.connectionMinimumIdleSize = connectionMinimumIdleSize;
- }
-}
-
+//package com.geekq.miaosha.redis;
+//
+//import org.springframework.boot.context.properties.ConfigurationProperties;
+//
+//@ConfigurationProperties(prefix = "redisson")
+//public class RedissonProperties {
+//
+// private int timeout = 3000;
+//
+// private String address;
+//
+// private String password;
+//
+// private int connectionPoolSize = 64;
+//
+// private int connectionMinimumIdleSize=10;
+//
+// private int slaveConnectionPoolSize = 250;
+//
+// private int masterConnectionPoolSize = 250;
+//
+// private String[] sentinelAddresses;
+//
+// private String masterName;
+//
+// public int getTimeout() {
+// return timeout;
+// }
+//
+// public void setTimeout(int timeout) {
+// this.timeout = timeout;
+// }
+//
+// public int getSlaveConnectionPoolSize() {
+// return slaveConnectionPoolSize;
+// }
+//
+// public void setSlaveConnectionPoolSize(int slaveConnectionPoolSize) {
+// this.slaveConnectionPoolSize = slaveConnectionPoolSize;
+// }
+//
+// public int getMasterConnectionPoolSize() {
+// return masterConnectionPoolSize;
+// }
+//
+// public void setMasterConnectionPoolSize(int masterConnectionPoolSize) {
+// this.masterConnectionPoolSize = masterConnectionPoolSize;
+// }
+//
+// public String[] getSentinelAddresses() {
+// return sentinelAddresses;
+// }
+//
+// public void setSentinelAddresses(String sentinelAddresses) {
+// this.sentinelAddresses = sentinelAddresses.split(",");
+// }
+//
+// public String getMasterName() {
+// return masterName;
+// }
+//
+// public void setMasterName(String masterName) {
+// this.masterName = masterName;
+// }
+//
+// public String getPassword() {
+// return password;
+// }
+//
+// public void setPassword(String password) {
+// this.password = password;
+// }
+//
+// public String getAddress() {
+// return address;
+// }
+//
+// public void setAddress(String address) {
+// this.address = address;
+// }
+//
+// public int getConnectionPoolSize() {
+// return connectionPoolSize;
+// }
+//
+// public void setConnectionPoolSize(int connectionPoolSize) {
+// this.connectionPoolSize = connectionPoolSize;
+// }
+//
+// public int getConnectionMinimumIdleSize() {
+// return connectionMinimumIdleSize;
+// }
+//
+// public void setConnectionMinimumIdleSize(int connectionMinimumIdleSize) {
+// this.connectionMinimumIdleSize = connectionMinimumIdleSize;
+// }
+//}
+//
diff --git a/src/main/java/com/geekq/miaosha/redis/RedissonService.java b/src/main/java/com/geekq/miaosha/redis/RedissonService.java
index 7124c3d..16739ad 100644
--- a/src/main/java/com/geekq/miaosha/redis/RedissonService.java
+++ b/src/main/java/com/geekq/miaosha/redis/RedissonService.java
@@ -1,146 +1,146 @@
-package com.geekq.miaosha.redis;
-
-import org.redisson.api.*;
-import org.redisson.config.Config;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.io.IOException;
-
-/**
- * redisson操作类
- */
-@Service("redissonService")
-public class RedissonService {
-
- @Autowired
- private RedissonClient redissonClient;
-
- public void getRedissonClient() throws IOException {
- Config config = redissonClient.getConfig();
- System.out.println(config.toJSON().toString());
- }
-
- /**`
- * 获取字符串对象
- *
- * @param objectName
- * @return
- */
- public RBucket getRBucket(String objectName) {
- RBucket bucket = redissonClient.getBucket(objectName);
- return bucket;
- }
-
- /**
- * 获取Map对象
- *
- * @param objectName
- * @return
- */
- public RMap getRMap(String objectName) {
- RMap map = redissonClient.getMap(objectName);
- return map;
- }
-
- /**
- * 获取有序集合
- *
- * @param objectName
- * @return
- */
- public RSortedSet getRSortedSet(String objectName) {
- RSortedSet sortedSet = redissonClient.getSortedSet(objectName);
- return sortedSet;
- }
-
- /**
- * 获取集合
- *
- * @param objectName
- * @return
- */
- public RSet getRSet(String objectName) {
- RSet rSet = redissonClient.getSet(objectName);
- return rSet;
- }
-
- /**
- * 获取列表
- *
- * @param objectName
- * @return
- */
- public RList getRList(String objectName) {
- RList rList = redissonClient.getList(objectName);
- return rList;
- }
-
- /**
- * 获取队列
- *
- * @param objectName
- * @return
- */
- public RQueue getRQueue(String objectName) {
- RQueue rQueue = redissonClient.getQueue(objectName);
- return rQueue;
- }
-
- /**
- * 获取双端队列
- *
- * @param objectName
- * @return
- */
- public RDeque getRDeque(String objectName) {
- RDeque rDeque = redissonClient.getDeque(objectName);
- return rDeque;
- }
-
-
- /**
- * 获取锁
- *
- * @param objectName
- * @return
- */
- public RLock getRLock(String objectName) {
- RLock rLock = redissonClient.getLock(objectName);
- return rLock;
- }
-
- /**
- * 获取读取锁
- *
- * @param objectName
- * @return
- */
- public RReadWriteLock getRWLock(String objectName) {
- RReadWriteLock rwlock = redissonClient.getReadWriteLock(objectName);
- return rwlock;
- }
-
- /**
- * 获取原子数
- *
- * @param objectName
- * @return
- */
- public RAtomicLong getRAtomicLong(String objectName) {
- RAtomicLong rAtomicLong = redissonClient.getAtomicLong(objectName);
- return rAtomicLong;
- }
-
- /**
- * 获取记数锁
- *
- * @param objectName
- * @return
- */
- public RCountDownLatch getRCountDownLatch(String objectName) {
- RCountDownLatch rCountDownLatch = redissonClient.getCountDownLatch(objectName);
- return rCountDownLatch;
- }
-
-}
\ No newline at end of file
+//package com.geekq.miaosha.redis;
+//
+//import org.redisson.api.*;
+//import org.redisson.config.Config;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Service;
+//
+//import java.io.IOException;
+//
+///**
+// * redisson操作类
+// */
+//@Service("redissonService")
+//public class RedissonService {
+//
+// @Autowired
+// private RedissonClient redissonClient;
+//
+// public void getRedissonClient() throws IOException {
+// Config config = redissonClient.getConfig();
+// System.out.println(config.toJSON().toString());
+// }
+//
+// /**`
+// * 获取字符串对象
+// *
+// * @param objectName
+// * @return
+// */
+// public RBucket getRBucket(String objectName) {
+// RBucket bucket = redissonClient.getBucket(objectName);
+// return bucket;
+// }
+//
+// /**
+// * 获取Map对象
+// *
+// * @param objectName
+// * @return
+// */
+// public RMap getRMap(String objectName) {
+// RMap map = redissonClient.getMap(objectName);
+// return map;
+// }
+//
+// /**
+// * 获取有序集合
+// *
+// * @param objectName
+// * @return
+// */
+// public RSortedSet getRSortedSet(String objectName) {
+// RSortedSet sortedSet = redissonClient.getSortedSet(objectName);
+// return sortedSet;
+// }
+//
+// /**
+// * 获取集合
+// *
+// * @param objectName
+// * @return
+// */
+// public RSet getRSet(String objectName) {
+// RSet rSet = redissonClient.getSet(objectName);
+// return rSet;
+// }
+//
+// /**
+// * 获取列表
+// *
+// * @param objectName
+// * @return
+// */
+// public RList getRList(String objectName) {
+// RList rList = redissonClient.getList(objectName);
+// return rList;
+// }
+//
+// /**
+// * 获取队列
+// *
+// * @param objectName
+// * @return
+// */
+// public RQueue getRQueue(String objectName) {
+// RQueue rQueue = redissonClient.getQueue(objectName);
+// return rQueue;
+// }
+//
+// /**
+// * 获取双端队列
+// *
+// * @param objectName
+// * @return
+// */
+// public RDeque getRDeque(String objectName) {
+// RDeque rDeque = redissonClient.getDeque(objectName);
+// return rDeque;
+// }
+//
+//
+// /**
+// * 获取锁
+// *
+// * @param objectName
+// * @return
+// */
+// public RLock getRLock(String objectName) {
+// RLock rLock = redissonClient.getLock(objectName);
+// return rLock;
+// }
+//
+// /**
+// * 获取读取锁
+// *
+// * @param objectName
+// * @return
+// */
+// public RReadWriteLock getRWLock(String objectName) {
+// RReadWriteLock rwlock = redissonClient.getReadWriteLock(objectName);
+// return rwlock;
+// }
+//
+// /**
+// * 获取原子数
+// *
+// * @param objectName
+// * @return
+// */
+// public RAtomicLong getRAtomicLong(String objectName) {
+// RAtomicLong rAtomicLong = redissonClient.getAtomicLong(objectName);
+// return rAtomicLong;
+// }
+//
+// /**
+// * 获取记数锁
+// *
+// * @param objectName
+// * @return
+// */
+// public RCountDownLatch getRCountDownLatch(String objectName) {
+// RCountDownLatch rCountDownLatch = redissonClient.getCountDownLatch(objectName);
+// return rCountDownLatch;
+// }
+//
+//}
\ No newline at end of file
diff --git a/src/main/java/com/geekq/miaosha/service/MiaoShaUserService.java b/src/main/java/com/geekq/miaosha/service/MiaoShaUserService.java
index c29d3fd..2a7649a 100644
--- a/src/main/java/com/geekq/miaosha/service/MiaoShaUserService.java
+++ b/src/main/java/com/geekq/miaosha/service/MiaoShaUserService.java
@@ -37,7 +37,7 @@ public class MiaoShaUserService {
}
MiaoshaUser user =redisService.get(MiaoShaUserKey.token,token,MiaoshaUser.class) ;
if(user!=null) {
- addCookie(response, user);
+ addCookie(response, token, user);
}
return user ;
@@ -105,17 +105,25 @@ public class MiaoShaUserService {
if(!calcPass.equals(dbPass)){
throw new GlobleException(CodeMsg.PASSWORD_ERROR);
}
- //生成cookie
- addCookie(response,user);
+ //生成cookie
+ String token= UUIDUtil.uuid();
+ addCookie(response, token, user);
return true ;
}
- private void addCookie(HttpServletResponse response ,MiaoshaUser user){
- String token = UUIDUtil.uuid();
- redisService.set(MiaoShaUserKey.token,token,user) ;
- Cookie cookie = new Cookie(COOKIE_NAME_TOKEN , token) ;
+ private void addCookie(HttpServletResponse response, String token, MiaoshaUser user) {
+ redisService.set(MiaoShaUserKey.token, token, user);
+ Cookie cookie = new Cookie(COOKIE_NAME_TOKEN, token);
cookie.setMaxAge(MiaoShaUserKey.token.expireSeconds());
cookie.setPath("/");
response.addCookie(cookie);
}
+// private void addCookie(HttpServletResponse response ,MiaoshaUser user){
+// String token = UUIDUtil.uuid();
+// redisService.set(MiaoShaUserKey.token,token,user) ;
+// Cookie cookie = new Cookie(COOKIE_NAME_TOKEN , token) ;
+// cookie.setMaxAge(MiaoShaUserKey.token.expireSeconds());
+// cookie.setPath("/");
+// response.addCookie(cookie);
+// }
}
diff --git a/src/main/java/com/geekq/miaosha/timeTask/OrderCloseTask.java b/src/main/java/com/geekq/miaosha/timeTask/OrderCloseTask.java
index 5995a78..0bc0165 100644
--- a/src/main/java/com/geekq/miaosha/timeTask/OrderCloseTask.java
+++ b/src/main/java/com/geekq/miaosha/timeTask/OrderCloseTask.java
@@ -1,114 +1,114 @@
-package com.geekq.miaosha.timeTask;
-
-import com.geekq.miaosha.dao.OrderDao;
-import com.geekq.miaosha.redis.RedisService;
-import com.geekq.miaosha.redis.RedissonService;
-import com.geekq.miaosha.service.OrderService;
-import jodd.util.PropertiesUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.redisson.api.RLock;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.util.concurrent.TimeUnit;
-
-import static com.geekq.miaosha.common.Constanst.CLOSE_ORDER_INFO_TASK_LOCK;
-
-@Component
-@Slf4j
-public class OrderCloseTask {
-
- @Autowired
- private OrderDao orderDao ;
- @Autowired
- private RedisService redisService;
-
- @Autowired
- private OrderService orderService;
- @Autowired
- private RedissonService redissonService;
-
-
-// @Scheduled(cron = "0/1 * * * * ?")
- private void closeOrderTaskv1(){
- int hour = 2;
- orderService.closeOrder(hour);
- log.info("关闭订单定时任务结束");
- }
-// @Scheduled(cron = "0/1 * * * * ?")
-// public void closeOrderTaskV2(){
-// log.info("关闭订单定时任务启动");
-// long lockTime = 5000;
-// Long setnxResult = redisService.setnx(CLOSE_ORDER_INFO_TASK_LOCK,String.valueOf(System.currentTimeMillis()+lockTime));
-// //代表获取了锁
-// if(setnxResult !=null && setnxResult ==1){
-// closeOrder(CLOSE_ORDER_INFO_TASK_LOCK);
-// }else {
-// log.info("没有获得分布式锁:{}",CLOSE_ORDER_INFO_TASK_LOCK);
-// }
-// log.info("关闭订单定时任务结束");
-// }
-
-// @Scheduled(cron = "0/1 * * * * ?")
-// public void closeOrderTaskV3(){
-// log.info("关闭订单定时任务启动");
-// long lockTime = 5000;
-// Long setnxResult = redisService.setnx(CLOSE_ORDER_INFO_TASK_LOCK,String.valueOf(System.currentTimeMillis()+lockTime));
-// //代表获取了锁
-// if(setnxResult !=null && setnxResult ==1){
-// closeOrder(CLOSE_ORDER_INFO_TASK_LOCK);
-// }else {
-// log.info("没有获得分布式锁:{}",CLOSE_ORDER_INFO_TASK_LOCK);
-// String lockValueStr = redisService.get(CLOSE_ORDER_INFO_TASK_LOCK);
-// if(lockValueStr!=null&&System.currentTimeMillis() > Long.parseLong(lockValueStr)){
-// //把之前的释放在新加入锁
-// String getSetResult = redisService.getset(CLOSE_ORDER_INFO_TASK_LOCK,String.valueOf(System.currentTimeMillis()+lockTime));
+//package com.geekq.miaosha.timeTask;
//
-// if(getSetResult == null || (getSetResult != null && StringUtils.equals(lockValueStr,getSetResult))){
-// closeOrder(CLOSE_ORDER_INFO_TASK_LOCK);
-// }else {
-// log.info("没有获取到分布式锁:{}",CLOSE_ORDER_INFO_TASK_LOCK);
-// }
-// }else {
-// log.info("没有获取到分布式锁:{}",CLOSE_ORDER_INFO_TASK_LOCK);
-// }
-// }
+//import com.geekq.miaosha.dao.OrderDao;
+//import com.geekq.miaosha.redis.RedisService;
+//import com.geekq.miaosha.redis.RedissonService;
+//import com.geekq.miaosha.service.OrderService;
+//import jodd.util.PropertiesUtil;
+//import lombok.extern.slf4j.Slf4j;
+//import org.apache.commons.lang3.StringUtils;
+//import org.redisson.api.RLock;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.scheduling.annotation.Scheduled;
+//import org.springframework.stereotype.Component;
+//
+//import java.util.concurrent.TimeUnit;
+//
+//import static com.geekq.miaosha.common.Constanst.CLOSE_ORDER_INFO_TASK_LOCK;
+//
+//@Component
+//@Slf4j
+//public class OrderCloseTask {
+//
+// @Autowired
+// private OrderDao orderDao ;
+// @Autowired
+// private RedisService redisService;
+//
+// @Autowired
+// private OrderService orderService;
+// @Autowired
+// private RedissonService redissonService;
+//
+//
+//// @Scheduled(cron = "0/1 * * * * ?")
+// private void closeOrderTaskv1(){
+// int hour = 2;
+// orderService.closeOrder(hour);
// log.info("关闭订单定时任务结束");
// }
- @Scheduled(cron="0 */1 * * * ?")
- public void closeOrderTaskV4(){
- RLock lock = redissonService.getRLock(CLOSE_ORDER_INFO_TASK_LOCK);
- boolean getLock = false;
- try {
- if(getLock = lock.tryLock(0,50, TimeUnit.SECONDS)){
- log.info("Redisson获取到分布式锁:{},ThreadName:{}",CLOSE_ORDER_INFO_TASK_LOCK,Thread.currentThread().getName());
- int hour = 2;
-// iOrderService.closeOrder(hour);
- }else{
- log.info("Redisson没有获取到分布式锁:{},ThreadName:{}",CLOSE_ORDER_INFO_TASK_LOCK,Thread.currentThread().getName());
- }
- } catch (InterruptedException e) {
- log.error("Redisson分布式锁获取异常",e);
- } finally {
- if(!getLock){
- return;
- }
- lock.unlock();
- log.info("Redisson分布式锁释放锁");
- }
- }
-
-
-
- private void closeOrder(String lockName){
- redisService.expire(lockName,5);
- log.info("获取{},当前线程名称!" ,lockName,Thread.currentThread().getName());
- int hour = 2;
- orderService.closeOrder(hour);
- redisService.del(CLOSE_ORDER_INFO_TASK_LOCK);
- log.info("===============================");
-
- }
-}
+//// @Scheduled(cron = "0/1 * * * * ?")
+//// public void closeOrderTaskV2(){
+//// log.info("关闭订单定时任务启动");
+//// long lockTime = 5000;
+//// Long setnxResult = redisService.setnx(CLOSE_ORDER_INFO_TASK_LOCK,String.valueOf(System.currentTimeMillis()+lockTime));
+//// //代表获取了锁
+//// if(setnxResult !=null && setnxResult ==1){
+//// closeOrder(CLOSE_ORDER_INFO_TASK_LOCK);
+//// }else {
+//// log.info("没有获得分布式锁:{}",CLOSE_ORDER_INFO_TASK_LOCK);
+//// }
+//// log.info("关闭订单定时任务结束");
+//// }
+//
+//// @Scheduled(cron = "0/1 * * * * ?")
+//// public void closeOrderTaskV3(){
+//// log.info("关闭订单定时任务启动");
+//// long lockTime = 5000;
+//// Long setnxResult = redisService.setnx(CLOSE_ORDER_INFO_TASK_LOCK,String.valueOf(System.currentTimeMillis()+lockTime));
+//// //代表获取了锁
+//// if(setnxResult !=null && setnxResult ==1){
+//// closeOrder(CLOSE_ORDER_INFO_TASK_LOCK);
+//// }else {
+//// log.info("没有获得分布式锁:{}",CLOSE_ORDER_INFO_TASK_LOCK);
+//// String lockValueStr = redisService.get(CLOSE_ORDER_INFO_TASK_LOCK);
+//// if(lockValueStr!=null&&System.currentTimeMillis() > Long.parseLong(lockValueStr)){
+//// //把之前的释放在新加入锁
+//// String getSetResult = redisService.getset(CLOSE_ORDER_INFO_TASK_LOCK,String.valueOf(System.currentTimeMillis()+lockTime));
+////
+//// if(getSetResult == null || (getSetResult != null && StringUtils.equals(lockValueStr,getSetResult))){
+//// closeOrder(CLOSE_ORDER_INFO_TASK_LOCK);
+//// }else {
+//// log.info("没有获取到分布式锁:{}",CLOSE_ORDER_INFO_TASK_LOCK);
+//// }
+//// }else {
+//// log.info("没有获取到分布式锁:{}",CLOSE_ORDER_INFO_TASK_LOCK);
+//// }
+//// }
+//// log.info("关闭订单定时任务结束");
+//// }
+//// @Scheduled(cron="0 */1 * * * ?")
+//// public void closeOrderTaskV4(){
+//// RLock lock = redissonService.getRLock(CLOSE_ORDER_INFO_TASK_LOCK);
+//// boolean getLock = false;
+//// try {
+//// if(getLock = lock.tryLock(0,50, TimeUnit.SECONDS)){
+//// log.info("Redisson获取到分布式锁:{},ThreadName:{}",CLOSE_ORDER_INFO_TASK_LOCK,Thread.currentThread().getName());
+//// int hour = 2;
+////// iOrderService.closeOrder(hour);
+//// }else{
+//// log.info("Redisson没有获取到分布式锁:{},ThreadName:{}",CLOSE_ORDER_INFO_TASK_LOCK,Thread.currentThread().getName());
+//// }
+//// } catch (InterruptedException e) {
+//// log.error("Redisson分布式锁获取异常",e);
+//// } finally {
+//// if(!getLock){
+//// return;
+//// }
+//// lock.unlock();
+//// log.info("Redisson分布式锁释放锁");
+//// }
+//// }
+//
+//
+//
+// private void closeOrder(String lockName){
+// redisService.expire(lockName,5);
+// log.info("获取{},当前线程名称!" ,lockName,Thread.currentThread().getName());
+// int hour = 2;
+// orderService.closeOrder(hour);
+// redisService.del(CLOSE_ORDER_INFO_TASK_LOCK);
+// log.info("===============================");
+//
+// }
+//}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index c90492a..af03501 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -16,9 +16,9 @@ mybatis.mapperLocations=classpath:mybatis/mapper/*.xml
#add mybatis
mybatis.config-locations=classpath:mybatis/config.xml
#datasource
-spring.datasource.url=jdbc:mysql://localhost:3306/miaosha?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
+spring.datasource.url=jdbc:mysql://39.107.245.253:3306/miaosha?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
spring.datasource.username=root
-spring.datasource.password=aixiyue11
+spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#druid
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
@@ -44,7 +44,7 @@ spring.resources.chain.gzipped=true
spring.resources.chain.html-application-cache=true
spring.resources.static-locations=classpath:/static/
#redis
-redis.host=192.168.1.116
+redis.host=39.107.245.253
redis.port=6379
redis.timeout=100
redis.password=123456
@@ -54,10 +54,10 @@ redis.poolMaxWait=500
#server.port=8003
#rabbitmq
-spring.rabbitmq.host=localhost
+spring.rabbitmq.host=39.107.245.253
spring.rabbitmq.port=5672
-spring.rabbitmq.username=guest
-spring.rabbitmq.password=guest
+spring.rabbitmq.username=mqadmin
+spring.rabbitmq.password=mqadmin
spring.rabbitmq.virtual-host=/
spring.rabbitmq.listener.simple.concurrency= 10
spring.rabbitmq.listener.simple.max-concurrency= 10
@@ -71,4 +71,4 @@ spring.rabbitmq.template.retry.max-interval=10000
spring.rabbitmq.template.retry.multiplier=1.0
## maven隔离
-spring.profiles.active=dev
\ No newline at end of file
+#spring.profiles.active=dev
\ No newline at end of file
diff --git a/target/classes/application.properties b/target/classes/application.properties
index c90492a..af03501 100644
--- a/target/classes/application.properties
+++ b/target/classes/application.properties
@@ -16,9 +16,9 @@ mybatis.mapperLocations=classpath:mybatis/mapper/*.xml
#add mybatis
mybatis.config-locations=classpath:mybatis/config.xml
#datasource
-spring.datasource.url=jdbc:mysql://localhost:3306/miaosha?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
+spring.datasource.url=jdbc:mysql://39.107.245.253:3306/miaosha?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
spring.datasource.username=root
-spring.datasource.password=aixiyue11
+spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#druid
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
@@ -44,7 +44,7 @@ spring.resources.chain.gzipped=true
spring.resources.chain.html-application-cache=true
spring.resources.static-locations=classpath:/static/
#redis
-redis.host=192.168.1.116
+redis.host=39.107.245.253
redis.port=6379
redis.timeout=100
redis.password=123456
@@ -54,10 +54,10 @@ redis.poolMaxWait=500
#server.port=8003
#rabbitmq
-spring.rabbitmq.host=localhost
+spring.rabbitmq.host=39.107.245.253
spring.rabbitmq.port=5672
-spring.rabbitmq.username=guest
-spring.rabbitmq.password=guest
+spring.rabbitmq.username=mqadmin
+spring.rabbitmq.password=mqadmin
spring.rabbitmq.virtual-host=/
spring.rabbitmq.listener.simple.concurrency= 10
spring.rabbitmq.listener.simple.max-concurrency= 10
@@ -71,4 +71,4 @@ spring.rabbitmq.template.retry.max-interval=10000
spring.rabbitmq.template.retry.multiplier=1.0
## maven隔离
-spring.profiles.active=dev
\ No newline at end of file
+#spring.profiles.active=dev
\ No newline at end of file
diff --git a/target/classes/com/geekq/miaosha/DemoTask$1.class b/target/classes/com/geekq/miaosha/DemoTask$1.class
index d5a3e7a..4fcfd95 100644
Binary files a/target/classes/com/geekq/miaosha/DemoTask$1.class and b/target/classes/com/geekq/miaosha/DemoTask$1.class differ
diff --git a/target/classes/com/geekq/miaosha/DemoTask$2.class b/target/classes/com/geekq/miaosha/DemoTask$2.class
index 024b906..7af6ecf 100644
Binary files a/target/classes/com/geekq/miaosha/DemoTask$2.class and b/target/classes/com/geekq/miaosha/DemoTask$2.class differ
diff --git a/target/classes/com/geekq/miaosha/DemoTask.class b/target/classes/com/geekq/miaosha/DemoTask.class
index 0f77919..2e010f0 100644
Binary files a/target/classes/com/geekq/miaosha/DemoTask.class and b/target/classes/com/geekq/miaosha/DemoTask.class differ
diff --git a/target/classes/com/geekq/miaosha/GeekQMainApplication.class b/target/classes/com/geekq/miaosha/GeekQMainApplication.class
index 0e81ae5..2eee7e3 100644
Binary files a/target/classes/com/geekq/miaosha/GeekQMainApplication.class and b/target/classes/com/geekq/miaosha/GeekQMainApplication.class differ
diff --git a/target/classes/com/geekq/miaosha/Md5Utils/MD5Utils.class b/target/classes/com/geekq/miaosha/Md5Utils/MD5Utils.class
index 3ccffb2..ac35aa5 100644
Binary files a/target/classes/com/geekq/miaosha/Md5Utils/MD5Utils.class and b/target/classes/com/geekq/miaosha/Md5Utils/MD5Utils.class differ
diff --git a/target/classes/com/geekq/miaosha/access/AccessInterceptor.class b/target/classes/com/geekq/miaosha/access/AccessInterceptor.class
index 44922dd..bc8a91c 100644
Binary files a/target/classes/com/geekq/miaosha/access/AccessInterceptor.class and b/target/classes/com/geekq/miaosha/access/AccessInterceptor.class differ
diff --git a/target/classes/com/geekq/miaosha/common/ResponseCode.class b/target/classes/com/geekq/miaosha/common/ResponseCode.class
index 303ef69..669eb9b 100644
Binary files a/target/classes/com/geekq/miaosha/common/ResponseCode.class and b/target/classes/com/geekq/miaosha/common/ResponseCode.class differ
diff --git a/target/classes/com/geekq/miaosha/config/UserArgumentResolver.class b/target/classes/com/geekq/miaosha/config/UserArgumentResolver.class
index f723885..146f5ee 100644
Binary files a/target/classes/com/geekq/miaosha/config/UserArgumentResolver.class and b/target/classes/com/geekq/miaosha/config/UserArgumentResolver.class differ
diff --git a/target/classes/com/geekq/miaosha/controller/DemoController.class b/target/classes/com/geekq/miaosha/controller/DemoController.class
index 65633e7..937ad09 100644
Binary files a/target/classes/com/geekq/miaosha/controller/DemoController.class and b/target/classes/com/geekq/miaosha/controller/DemoController.class differ
diff --git a/target/classes/com/geekq/miaosha/controller/GoodsController.class b/target/classes/com/geekq/miaosha/controller/GoodsController.class
index adbdb3a..8400e39 100644
Binary files a/target/classes/com/geekq/miaosha/controller/GoodsController.class and b/target/classes/com/geekq/miaosha/controller/GoodsController.class differ
diff --git a/target/classes/com/geekq/miaosha/controller/LoginController.class b/target/classes/com/geekq/miaosha/controller/LoginController.class
index 684d5e4..3d02cc8 100644
Binary files a/target/classes/com/geekq/miaosha/controller/LoginController.class and b/target/classes/com/geekq/miaosha/controller/LoginController.class differ
diff --git a/target/classes/com/geekq/miaosha/controller/MiaoshaController.class b/target/classes/com/geekq/miaosha/controller/MiaoshaController.class
index 45d4cfe..c75dcc9 100644
Binary files a/target/classes/com/geekq/miaosha/controller/MiaoshaController.class and b/target/classes/com/geekq/miaosha/controller/MiaoshaController.class differ
diff --git a/target/classes/com/geekq/miaosha/rabbitmq/MQConfig.class b/target/classes/com/geekq/miaosha/rabbitmq/MQConfig.class
index 67086f0..a001fc9 100644
Binary files a/target/classes/com/geekq/miaosha/rabbitmq/MQConfig.class and b/target/classes/com/geekq/miaosha/rabbitmq/MQConfig.class differ
diff --git a/target/classes/com/geekq/miaosha/rabbitmq/MQReceiver.class b/target/classes/com/geekq/miaosha/rabbitmq/MQReceiver.class
index 97be849..457b1c6 100644
Binary files a/target/classes/com/geekq/miaosha/rabbitmq/MQReceiver.class and b/target/classes/com/geekq/miaosha/rabbitmq/MQReceiver.class differ
diff --git a/target/classes/com/geekq/miaosha/rabbitmq/MQSender.class b/target/classes/com/geekq/miaosha/rabbitmq/MQSender.class
index d7c0414..a4e7df4 100644
Binary files a/target/classes/com/geekq/miaosha/rabbitmq/MQSender.class and b/target/classes/com/geekq/miaosha/rabbitmq/MQSender.class differ
diff --git a/target/classes/com/geekq/miaosha/redis/RedisPoolFactory.class b/target/classes/com/geekq/miaosha/redis/RedisPoolFactory.class
index 1c91eb8..502cc1c 100644
Binary files a/target/classes/com/geekq/miaosha/redis/RedisPoolFactory.class and b/target/classes/com/geekq/miaosha/redis/RedisPoolFactory.class differ
diff --git a/target/classes/com/geekq/miaosha/redis/RedisService.class b/target/classes/com/geekq/miaosha/redis/RedisService.class
index 6c27047..eb6093a 100644
Binary files a/target/classes/com/geekq/miaosha/redis/RedisService.class and b/target/classes/com/geekq/miaosha/redis/RedisService.class differ
diff --git a/target/classes/com/geekq/miaosha/service/MiaoShaUserService.class b/target/classes/com/geekq/miaosha/service/MiaoShaUserService.class
index 2a213f6..c738db8 100644
Binary files a/target/classes/com/geekq/miaosha/service/MiaoShaUserService.class and b/target/classes/com/geekq/miaosha/service/MiaoShaUserService.class differ
diff --git a/target/classes/com/geekq/miaosha/service/MiaoshaService.class b/target/classes/com/geekq/miaosha/service/MiaoshaService.class
index ba96442..9647ce0 100644
Binary files a/target/classes/com/geekq/miaosha/service/MiaoshaService.class and b/target/classes/com/geekq/miaosha/service/MiaoshaService.class differ
diff --git a/target/classes/com/geekq/miaosha/service/OrderService.class b/target/classes/com/geekq/miaosha/service/OrderService.class
index 00f7d8b..056c391 100644
Binary files a/target/classes/com/geekq/miaosha/service/OrderService.class and b/target/classes/com/geekq/miaosha/service/OrderService.class differ
diff --git a/target/classes/com/geekq/miaosha/validator/IsMobileValidator.class b/target/classes/com/geekq/miaosha/validator/IsMobileValidator.class
index 49c8782..7cda246 100644
Binary files a/target/classes/com/geekq/miaosha/validator/IsMobileValidator.class and b/target/classes/com/geekq/miaosha/validator/IsMobileValidator.class differ