feat(商城): 代码优化

master
wayn 3 years ago
parent 8539808347
commit 004fc21233

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.8</version> <version>2.5.9</version>
</parent> </parent>
<modules> <modules>
<module>waynboot-common</module> <module>waynboot-common</module>
@ -37,10 +37,9 @@
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>
<spring-boot.version>2.5.8</spring-boot.version> <spring-boot.version>2.5.9</spring-boot.version>
<mysql.connector.java.version>8.0.27</mysql.connector.java.version> <mysql.connector.java.version>8.0.25</mysql.connector.java.version>
<lettuce.version>6.1.6.RELEASE</lettuce.version> <elasticsearch.version>7.13.4</elasticsearch.version>
<elasticsearch.version>7.14.0</elasticsearch.version>
<mybatis-plus.version>3.5.0</mybatis-plus.version> <mybatis-plus.version>3.5.0</mybatis-plus.version>
<druid.version>1.2.8</druid.version> <druid.version>1.2.8</druid.version>
<commons.io.version>2.11.0</commons.io.version> <commons.io.version>2.11.0</commons.io.version>
@ -49,12 +48,12 @@
<commons-lang3.version>3.12.0</commons-lang3.version> <commons-lang3.version>3.12.0</commons-lang3.version>
<fastjson.version>1.2.79</fastjson.version> <fastjson.version>1.2.79</fastjson.version>
<easy-captcha.version>1.6.2</easy-captcha.version> <easy-captcha.version>1.6.2</easy-captcha.version>
<swagger.version>3.0.0</swagger.version> <knife4j.version>3.0.3</knife4j.version>
<easypoi.version>4.4.0</easypoi.version> <easypoi.version>4.4.0</easypoi.version>
<jwt.version>3.18.3</jwt.version> <jwt.version>3.18.3</jwt.version>
<qiniu.version>7.9.1</qiniu.version> <qiniu.version>7.9.1</qiniu.version>
<mail.version>1.4.7</mail.version> <mail.version>1.4.7</mail.version>
<spring-boot-admin.version>2.5.4</spring-boot-admin.version> <spring-boot-admin.version>2.6.2</spring-boot-admin.version>
</properties> </properties>
<dependencies> <dependencies>
@ -79,8 +78,8 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.data</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-data-redis</artifactId> <artifactId>spring-boot-starter-data-redis</artifactId>
<version>${spring-boot.version}</version> <version>${spring-boot.version}</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/io.lettuce/lettuce-core --> <!-- https://mvnrepository.com/artifact/io.lettuce/lettuce-core -->
@ -137,7 +136,6 @@
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
@ -215,9 +213,10 @@
<!--springfox swagger官方Starter--> <!--springfox swagger官方Starter-->
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>com.github.xiaoymin</groupId>
<artifactId>springfox-boot-starter</artifactId> <artifactId>knife4j-spring-boot-starter</artifactId>
<version>${swagger.version}</version> <!--在引用时请在maven中央仓库搜索3.X最新版本号-->
<version>${knife4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>

@ -70,6 +70,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/captcha/**").anonymous() .antMatchers("/captcha/**").anonymous()
.antMatchers("/upload/**").anonymous() .antMatchers("/upload/**").anonymous()
.antMatchers("/common/download**").anonymous() .antMatchers("/common/download**").anonymous()
.antMatchers("/doc.html").anonymous()
.antMatchers("/swagger-ui/**").anonymous() .antMatchers("/swagger-ui/**").anonymous()
.antMatchers("/swagger-resources/**").anonymous() .antMatchers("/swagger-resources/**").anonymous()
.antMatchers("/webjars/**").anonymous() .antMatchers("/webjars/**").anonymous()

@ -11,8 +11,10 @@ import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact; import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration @Configuration
@EnableSwagger2
public class SwaggerConfig { public class SwaggerConfig {
/** /**

@ -13,7 +13,6 @@ import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Objects; import java.util.Objects;
@ -28,9 +27,6 @@ public class UserDetailsServiceImpl implements UserDetailsService {
@Autowired @Autowired
private IDeptService iDeptService; private IDeptService iDeptService;
@Autowired
private PasswordEncoder passwordEncoder;
@Autowired @Autowired
private SysPermissionService permissionService; private SysPermissionService permissionService;

@ -25,8 +25,8 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.data</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-data-redis</artifactId> <artifactId>spring-boot-starter-data-redis</artifactId>
<version>${spring-boot.version}</version> <version>${spring-boot.version}</version>
</dependency> </dependency>
@ -179,8 +179,8 @@
<version>1.1.0</version> <version>1.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>com.github.xiaoymin</groupId>
<artifactId>springfox-boot-starter</artifactId> <artifactId>knife4j-spring-boot-starter</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>

@ -12,8 +12,8 @@
<artifactId>waynboot-data-redis</artifactId> <artifactId>waynboot-data-redis</artifactId>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.data</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-data-redis</artifactId> <artifactId>spring-boot-starter-data-redis</artifactId>
<version>${spring-boot.version}</version> <version>${spring-boot.version}</version>
</dependency> </dependency>

@ -39,8 +39,8 @@
<version>${spring-boot.version}</version> <version>${spring-boot.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.data</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-data-redis</artifactId> <artifactId>spring-boot-starter-data-redis</artifactId>
<version>${spring-boot.version}</version> <version>${spring-boot.version}</version>
</dependency> </dependency>

@ -25,8 +25,7 @@ spring:
listener: listener:
simple: simple:
acknowledge-mode: manual acknowledge-mode: manual
direct: prefetch: 100
acknowledge-mode: manual
boot: boot:
admin: admin:
client: client:

@ -19,7 +19,7 @@ import com.wayn.mobile.framework.manager.thread.AsyncManager;
import com.wayn.mobile.framework.security.util.MobileSecurityUtils; import com.wayn.mobile.framework.security.util.MobileSecurityUtils;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.MatchPhraseQueryBuilder; import org.elasticsearch.index.query.MatchPhraseQueryBuilder;
import org.elasticsearch.index.query.MatchQueryBuilder; import org.elasticsearch.index.query.MatchQueryBuilder;

@ -67,6 +67,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/home/**", "/category/**", "/comment/**", "/goods/detail/**", "/cart/goodsCount", "/diamond/**").permitAll() .antMatchers("/home/**", "/category/**", "/comment/**", "/goods/detail/**", "/cart/goodsCount", "/diamond/**").permitAll()
.antMatchers("/upload/**").anonymous() .antMatchers("/upload/**").anonymous()
.antMatchers("/common/download**").anonymous() .antMatchers("/common/download**").anonymous()
.antMatchers("/doc.html").anonymous()
.antMatchers("/swagger-ui/**").anonymous() .antMatchers("/swagger-ui/**").anonymous()
.antMatchers("/swagger-resources/**").anonymous() .antMatchers("/swagger-resources/**").anonymous()
.antMatchers("/webjars/**").anonymous() .antMatchers("/webjars/**").anonymous()

@ -11,8 +11,10 @@ import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact; import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration @Configuration
@EnableSwagger2
public class SwaggerConfig { public class SwaggerConfig {
/** /**

Loading…
Cancel
Save