2.0依赖升级完成

This commit is contained in:
Xiong Neng 2018-09-09 22:16:56 +08:00
parent 9e9cd02507
commit 483b642ca0
29 changed files with 41 additions and 78 deletions

View File

@ -16,7 +16,6 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -16,7 +16,6 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -16,7 +16,6 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -16,7 +16,6 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -16,7 +16,6 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -16,7 +16,6 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -3,7 +3,7 @@
一般来讲对于RESTful API都会有认证(Authentication)和授权(Authorization)过程保证API的安全性。 一般来讲对于RESTful API都会有认证(Authentication)和授权(Authorization)过程保证API的安全性。
采用TOKEN认证这种方式也是再HTTP头中使用Authorization: Bearer <token>使用最广泛的TOKEN是JWT通过签名过的TOKEN。 采用TOKEN认证这种方式也是再HTTP头中使用`Authorization: Bearer <token>`使用最广泛的TOKEN是JWT通过签名过的TOKEN。
基于Shiro+JWT可实现Token认证方式 基于Shiro+JWT可实现Token认证方式
@ -60,31 +60,9 @@ GET http://localhost:9095/api/v1/join?imei=imei
``` ```
Content-Type: application/json Content-Type: application/json
Authorization: 'Bearer ' + token Authorization: "上面拿到的token值"
``` ```
*Body参数*
``` json
{
"username": "admin",
"password": "12345678",
"appid": "111",
"imei": "imei"
}
```
返回值:
``` json
{
"success": true,
"msg": "Login success",
"data": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBpZCI6IjExMSIsImltZWkiOiJpbWVpIiwiZXhwIjoxNTM2NDg3NTM1LCJ1c2VybmFtZSI6ImFkbWluIn0.uat7rvVLwC7bcM-jRs329RWdHIFC6P-YN7YdJrdRUHE"
}
```
## 许可证 ## 许可证
Copyright (c) 2018 Xiong Neng Copyright (c) 2018 Xiong Neng

View File

@ -16,7 +16,6 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -3,13 +3,14 @@ package com.xncoding.pos.common.aop;
import com.xncoding.pos.common.annotion.DataSource; import com.xncoding.pos.common.annotion.DataSource;
import com.xncoding.pos.common.mutidatesource.DSEnum; import com.xncoding.pos.common.mutidatesource.DSEnum;
import com.xncoding.pos.common.mutidatesource.DataSourceContextHolder; import com.xncoding.pos.common.mutidatesource.DataSourceContextHolder;
import org.apache.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature; import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature; import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -27,7 +28,7 @@ import java.lang.reflect.Method;
@ConditionalOnProperty(prefix = "xncoding", name = "muti-datasource-open", havingValue = "true") @ConditionalOnProperty(prefix = "xncoding", name = "muti-datasource-open", havingValue = "true")
public class MultiSourceExAop implements Ordered { public class MultiSourceExAop implements Ordered {
private Logger log = Logger.getLogger(this.getClass()); private Logger log = LoggerFactory.getLogger(this.getClass());
@Pointcut(value = "@annotation(com.xncoding.pos.common.annotion.DataSource)") @Pointcut(value = "@annotation(com.xncoding.pos.common.annotion.DataSource)")
private void cut() { private void cut() {

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>
@ -30,6 +29,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId> <artifactId>spring-boot-starter-amqp</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.6</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>

View File

@ -72,7 +72,7 @@ public class AsyncRPCServer {
public void onSuccess(String result) { public void onSuccess(String result) {
amqpTemplate.convertAndSend(replyTo, (Object) result, m -> { amqpTemplate.convertAndSend(replyTo, (Object) result, m -> {
//https://stackoverflow.com/questions/42382307/messageproperties-setcorrelationidstring-is-not-working //https://stackoverflow.com/questions/42382307/messageproperties-setcorrelationidstring-is-not-working
m.getMessageProperties().setCorrelationId(correlationId); m.getMessageProperties().setCorrelationId(new String(correlationId));
return m; return m;
}); });
} }

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -40,6 +40,8 @@ import java.security.cert.X509Certificate;
*/ */
@Configuration @Configuration
public class RestClientConfig { public class RestClientConfig {
private Logger log = LoggerFactory.getLogger(this.getClass());
@Bean @Bean
public RestTemplate restTemplate() { public RestTemplate restTemplate() {
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();

View File

@ -8,8 +8,8 @@ import org.junit.runner.RunWith;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.embedded.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.RequestEntity; import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;

View File

@ -15,7 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
</parent> </parent>
<properties> <properties>

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>

View File

@ -15,8 +15,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>1.5.10.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath/>
</parent> </parent>
<properties> <properties>