springboot升级至2.1.3,elasticsearch升级至6.2.2

This commit is contained in:
macro
2019-03-21 15:46:37 +08:00
parent 470c40eb16
commit c3359c9fcb
24 changed files with 172 additions and 127 deletions

View File

@@ -8,8 +8,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
import org.springframework.security.authentication.encoding.PasswordEncoder;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@@ -17,6 +15,8 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
/**
* SpringSecurity的配置
@@ -90,7 +90,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Bean
public PasswordEncoder passwordEncoder() {
return new Md5PasswordEncoder();
return new BCryptPasswordEncoder();
}
@Bean

View File

@@ -2,8 +2,7 @@ package com.macro.mall.portal.config;
import org.apache.catalina.connector.Connector;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory;
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
@@ -18,8 +17,8 @@ public class TomcatConfig {
@Value("${http.port}")
private Integer port;
@Bean
public EmbeddedServletContainerFactory servletContainer() {
TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
public TomcatServletWebServerFactory servletContainer() {
TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
tomcat.addAdditionalTomcatConnectors(createStandardConnector()); // 添加http
return tomcat;
}

View File

@@ -34,7 +34,7 @@ public class MemberReadHistoryServiceImpl implements MemberReadHistoryService {
memberReadHistory.setId(id);
deleteList.add(memberReadHistory);
}
memberReadHistoryRepository.delete(deleteList);
memberReadHistoryRepository.deleteAll(deleteList);
return ids.size();
}

View File

@@ -286,7 +286,9 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
orderItemExample.createCriteria().andOrderIdEqualTo(orderId);
List<OmsOrderItem> orderItemList = orderItemMapper.selectByExample(orderItemExample);
//解除订单商品库存锁定
portalOrderDao.releaseSkuStockLock(orderItemList);
if(!CollectionUtils.isEmpty(orderItemList)){
portalOrderDao.releaseSkuStockLock(orderItemList);
}
//修改优惠券使用状态
updateCouponStatus(cancelOrder.getCouponId(),cancelOrder.getMemberId(),0);
//返还使用积分

View File

@@ -12,10 +12,10 @@ import com.macro.mall.portal.service.RedisService;
import com.macro.mall.portal.service.UmsMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.encoding.PasswordEncoder;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
@@ -77,7 +77,7 @@ public class UmsMemberServiceImpl implements UmsMemberService {
UmsMember umsMember = new UmsMember();
umsMember.setUsername(username);
umsMember.setPhone(telephone);
umsMember.setPassword(passwordEncoder.encodePassword(password, null));
umsMember.setPassword(passwordEncoder.encode(password));
umsMember.setCreateTime(new Date());
umsMember.setStatus(1);
//获取默认会员等级并设置
@@ -118,7 +118,7 @@ public class UmsMemberServiceImpl implements UmsMemberService {
return new CommonResult().failed("验证码错误");
}
UmsMember umsMember = memberList.get(0);
umsMember.setPassword(passwordEncoder.encodePassword(password,null));
umsMember.setPassword(passwordEncoder.encode(password));
memberMapper.updateByPrimaryKeySelective(umsMember);
return new CommonResult().success("密码修改成功",null);
}

View File

@@ -14,7 +14,7 @@ logging.level.com.macro.mall.portal.dao=debug
#===logging end===
#===datasource start===
spring.datasource.url=jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8
spring.datasource.url=jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
spring.datasource.username=root
spring.datasource.password=root
#===datasource end===
@@ -49,15 +49,15 @@ spring.redis.port=6379
# Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09
spring.redis.password=
# \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09
spring.redis.pool.max-active=8
spring.redis.jedis.pool.max-active=8
# \u8FDE\u63A5\u6C60\u6700\u5927\u963B\u585E\u7B49\u5F85\u65F6\u95F4\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09
spring.redis.pool.max-wait=-1
spring.redis.jedis.pool.max-wait=-1ms
# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5
spring.redis.pool.max-idle=8
spring.redis.jedis.pool.max-idle=8
# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5
spring.redis.pool.min-idle=0
spring.redis.jedis.pool.min-idle=0
# \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09
spring.redis.timeout=0
spring.redis.timeout=0ms
#===redis end===
#===rabbitMq start===

View File

@@ -41,13 +41,13 @@ spring.redis.port=6379
# Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09
spring.redis.password=
# \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09
spring.redis.pool.max-active=8
spring.redis.jedis.pool.max-active=8
# \u8FDE\u63A5\u6C60\u6700\u5927\u963B\u585E\u7B49\u5F85\u65F6\u95F4\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09
spring.redis.pool.max-wait=-1
spring.redis.jedis.pool.max-wait=-1ms
# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5
spring.redis.pool.max-idle=8
spring.redis.jedis.pool.max-idle=8
# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5
spring.redis.pool.min-idle=0
spring.redis.jedis.pool.min-idle=0
# \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09
spring.redis.timeout=0
spring.redis.timeout=0ms
#===redis end===