Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
83d49e0e
Commit
83d49e0e
authored
May 31, 2018
by
xiaoguang.xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat : 1. 升级undertow, 2. 去掉无用的lkb访问, 3. 去掉无用的model 访问
parent
cc07c444
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
82 deletions
+12
-82
pom.xml
pom.xml
+10
-0
HttpConfig.java
src/main/java/cn/quantgroup/xyqb/config/http/HttpConfig.java
+1
-1
ResubmissionException.java
...a/cn/quantgroup/xyqb/exception/ResubmissionException.java
+0
-12
ILkbUserService.java
...java/cn/quantgroup/xyqb/service/user/ILkbUserService.java
+0
-17
LkbUserviceImpl.java
...cn/quantgroup/xyqb/service/user/impl/LkbUserviceImpl.java
+1
-52
No files found.
pom.xml
View file @
83d49e0e
...
@@ -86,6 +86,16 @@
...
@@ -86,6 +86,16 @@
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-undertow
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
...
...
src/main/java/cn/quantgroup/xyqb/config/http/HttpConfig.java
View file @
83d49e0e
...
@@ -134,7 +134,7 @@ public class HttpConfig {
...
@@ -134,7 +134,7 @@ public class HttpConfig {
connectionManager
.
setDefaultMaxPerRoute
(
2000
);
connectionManager
.
setDefaultMaxPerRoute
(
2000
);
// retry handler
// retry handler
HttpRequestRetryHandler
retryHandler
=
new
StandardHttpRequestRetryHandler
(
3
,
false
);
HttpRequestRetryHandler
retryHandler
=
new
StandardHttpRequestRetryHandler
();
// keep alive strategy
// keep alive strategy
ConnectionKeepAliveStrategy
keepAliveStrategy
=
new
DefaultConnectionKeepAliveStrategy
();
ConnectionKeepAliveStrategy
keepAliveStrategy
=
new
DefaultConnectionKeepAliveStrategy
();
...
...
src/main/java/cn/quantgroup/xyqb/exception/ResubmissionException.java
deleted
100644 → 0
View file @
cc07c444
package
cn
.
quantgroup
.
xyqb
.
exception
;
/**
* Created by Miraculous on 15/7/29.
*/
public
class
ResubmissionException
extends
RuntimeException
{
private
static
final
long
serialVersionUID
=
-
1L
;
public
ResubmissionException
()
{
super
(
"不能重复提交表单"
);
}
}
src/main/java/cn/quantgroup/xyqb/service/user/ILkbUserService.java
View file @
83d49e0e
...
@@ -6,23 +6,6 @@ package cn.quantgroup.xyqb.service.user;
...
@@ -6,23 +6,6 @@ package cn.quantgroup.xyqb.service.user;
*/
*/
public
interface
ILkbUserService
{
public
interface
ILkbUserService
{
/**
* App用户注册
*
* @param phoneNo
* @param password
* @return
*/
String
registerApp
(
String
phoneNo
,
String
password
);
/**
* 同步用户信息
*
* @param uuid
* @param name
* @param idNo
*/
void
userUpdate
(
String
uuid
,
String
name
,
String
idNo
);
/**
/**
* 同步用戶信息
* 同步用戶信息
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/LkbUserviceImpl.java
View file @
83d49e0e
...
@@ -5,8 +5,6 @@ import cn.quantgroup.xyqb.service.http.IHttpService;
...
@@ -5,8 +5,6 @@ import cn.quantgroup.xyqb.service.http.IHttpService;
import
cn.quantgroup.xyqb.service.user.ILkbUserService
;
import
cn.quantgroup.xyqb.service.user.ILkbUserService
;
import
cn.quantgroup.xyqb.util.JsonUtil
;
import
cn.quantgroup.xyqb.util.JsonUtil
;
import
cn.quantgroup.xyqb.util.PasswordUtil
;
import
cn.quantgroup.xyqb.util.PasswordUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.ImmutableMap
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -14,7 +12,6 @@ import org.slf4j.Logger;
...
@@ -14,7 +12,6 @@ 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.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -39,54 +36,6 @@ public class LkbUserviceImpl implements ILkbUserService {
...
@@ -39,54 +36,6 @@ public class LkbUserviceImpl implements ILkbUserService {
@Value
(
"${lkb.client.url}"
)
@Value
(
"${lkb.client.url}"
)
private
String
clientUrl
;
private
String
clientUrl
;
@Value
(
"${lkb.client.user.register.app}"
)
private
String
registerApp
;
@Value
(
"${lkb.client.user.update}"
)
private
String
userUpdate
;
@Value
(
"${lkb.client.user.push}"
)
private
String
userPushPath
;
@Override
public
String
registerApp
(
String
phoneNo
,
String
password
)
{
String
timeunit
=
System
.
currentTimeMillis
()
+
""
;
String
token
=
PasswordUtil
.
MD5
(
String
.
format
(
TOKEN_PATTERN
,
timeunit
));
Map
<
String
,
String
>
parameters
=
ImmutableMap
.<
String
,
String
>
builder
()
.
put
(
"appId"
,
Constants
.
Channel
.
LKB_CODE
)
.
put
(
"timeunit"
,
timeunit
)
.
put
(
"token"
,
token
)
.
put
(
"userName"
,
phoneNo
)
.
put
(
"password"
,
password
)
.
build
();
String
response
=
httpService
.
get
(
clientUrl
+
registerApp
,
parameters
);
Map
<
String
,
String
>
result
=
JSONObject
.
parseObject
(
response
,
Map
.
class
);
if
(
result
==
null
||
"0"
.
equals
(
result
.
get
(
"flag"
)))
{
LOGGER
.
warn
(
"向LKB注册用户失败, phoneNo:{}, password:{}"
,
phoneNo
,
password
);
return
""
;
}
return
result
.
get
(
"uid"
);
}
@Override
@Async
public
void
userUpdate
(
String
uuid
,
String
name
,
String
idNo
)
{
Map
<
String
,
String
>
parameters
=
ImmutableMap
.<
String
,
String
>
builder
()
.
put
(
"userId"
,
uuid
)
.
put
(
"realName"
,
name
)
.
put
(
"idcard"
,
idNo
)
.
build
();
String
response
=
httpService
.
get
(
clientUrl
+
userUpdate
,
parameters
);
//Map<String, String> result = GSON.fromJson(response, Map.class);
Map
<
String
,
String
>
result
=
JSONObject
.
parseObject
(
response
,
Map
.
class
);
if
(
result
==
null
||
"false"
.
equals
(
result
.
get
(
"flag"
)))
{
LOGGER
.
warn
(
"向LKB-Client同步用户信息失败, result: {}"
,
result
);
}
}
@Override
@Override
public
boolean
pushUser
(
String
uuid
,
String
phoneNo
,
String
name
,
String
idNo
)
{
public
boolean
pushUser
(
String
uuid
,
String
phoneNo
,
String
name
,
String
idNo
)
{
String
timeunit
=
System
.
currentTimeMillis
()
+
""
;
String
timeunit
=
System
.
currentTimeMillis
()
+
""
;
...
@@ -103,7 +52,7 @@ public class LkbUserviceImpl implements ILkbUserService {
...
@@ -103,7 +52,7 @@ public class LkbUserviceImpl implements ILkbUserService {
if
(
StringUtils
.
isNotBlank
(
idNo
))
{
if
(
StringUtils
.
isNotBlank
(
idNo
))
{
parameters
.
put
(
"idCardNo"
,
idNo
);
parameters
.
put
(
"idCardNo"
,
idNo
);
}
}
String
response
=
httpService
.
post
(
clientUrl
+
userPushPath
,
parameters
);
String
response
=
httpService
.
post
(
clientUrl
+
"/user/push.json"
,
parameters
);
Optional
<
Map
>
resultOptional
=
JsonUtil
.
fromJson
(
response
,
Map
.
class
);
Optional
<
Map
>
resultOptional
=
JsonUtil
.
fromJson
(
response
,
Map
.
class
);
if
(!
resultOptional
.
isPresent
()
||
!
"0000"
.
equals
(
resultOptional
.
get
().
get
(
"code"
)))
{
if
(!
resultOptional
.
isPresent
()
||
!
"0000"
.
equals
(
resultOptional
.
get
().
get
(
"code"
)))
{
LOGGER
.
error
(
"[lkb_user_push]向LKB同步用户失败,phoneNo:{},response={}"
,
phoneNo
,
response
);
LOGGER
.
error
(
"[lkb_user_push]向LKB同步用户失败,phoneNo:{},response={}"
,
phoneNo
,
response
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment