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
e73393dd
Commit
e73393dd
authored
May 30, 2018
by
徐小光
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/firstSlaveDBuse' into 'master'
测试一个读库使用 See merge request !14
parents
ec822d00
e0cae9f6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
42 deletions
+7
-42
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+7
-42
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
e73393dd
package
cn
.
quantgroup
.
xyqb
.
controller
.
external
.
user
;
package
cn
.
quantgroup
.
xyqb
.
controller
.
external
.
user
;
import
cn.quantgroup.tech.db.DSType
;
import
cn.quantgroup.tech.db.TargetDataSource
;
import
cn.quantgroup.user.enums.Relation
;
import
cn.quantgroup.user.enums.Relation
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.controller.IBaseController
;
import
cn.quantgroup.xyqb.controller.IBaseController
;
...
@@ -9,23 +11,18 @@ import cn.quantgroup.xyqb.exception.UserNotExistException;
...
@@ -9,23 +11,18 @@ import cn.quantgroup.xyqb.exception.UserNotExistException;
import
cn.quantgroup.xyqb.model.*
;
import
cn.quantgroup.xyqb.model.*
;
import
cn.quantgroup.xyqb.service.api.IUserApiService
;
import
cn.quantgroup.xyqb.service.api.IUserApiService
;
import
cn.quantgroup.xyqb.service.auth.IIdCardService
;
import
cn.quantgroup.xyqb.service.auth.IIdCardService
;
import
cn.quantgroup.xyqb.service.http.IHttpService
;
import
cn.quantgroup.xyqb.service.merchant.IMerchantService
;
import
cn.quantgroup.xyqb.service.merchant.IMerchantService
;
import
cn.quantgroup.xyqb.service.register.IUserRegisterService
;
import
cn.quantgroup.xyqb.service.register.IUserRegisterService
;
import
cn.quantgroup.xyqb.service.session.ISessionService
;
import
cn.quantgroup.xyqb.service.session.ISessionService
;
import
cn.quantgroup.xyqb.service.sms.ISmsService
;
import
cn.quantgroup.xyqb.service.sms.ISmsService
;
import
cn.quantgroup.xyqb.service.user.*
;
import
cn.quantgroup.xyqb.service.user.*
;
import
cn.quantgroup.xyqb.service.user.vo.UserDetailVO
;
import
cn.quantgroup.xyqb.service.wechat.IWechatService
;
import
cn.quantgroup.xyqb.service.wechat.IWechatService
;
import
cn.quantgroup.xyqb.util.*
;
import
cn.quantgroup.xyqb.util.*
;
import
cn.quantgroup.xyqb.util.encrypt.MD5Util
;
import
cn.quantgroup.xyqb.util.encrypt.MD5Util
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.TypeReference
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.SerializationFeature
;
import
com.google.common.base.MoreObjects
;
import
com.google.common.base.MoreObjects
;
import
com.google.common.collect.ImmutableMap
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
...
@@ -37,7 +34,6 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -37,7 +34,6 @@ import org.apache.commons.lang3.StringUtils;
import
org.apache.commons.lang3.math.NumberUtils
;
import
org.apache.commons.lang3.math.NumberUtils
;
import
org.apache.http.HttpStatus
;
import
org.apache.http.HttpStatus
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -84,20 +80,8 @@ public class InnerController implements IBaseController {
...
@@ -84,20 +80,8 @@ public class InnerController implements IBaseController {
@Autowired
@Autowired
private
ISmsService
smsService
;
private
ISmsService
smsService
;
@Autowired
@Autowired
private
IHttpService
httpService
;
@Autowired
private
IUserRegisterService
userRegisterService
;
private
IUserRegisterService
userRegisterService
;
@Value
(
"${userqry.http}"
)
private
String
queryUrl
;
private
static
final
ObjectMapper
MAPPER
=
new
ObjectMapper
();
static
{
MAPPER
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
MAPPER
.
configure
(
SerializationFeature
.
WRITE_ENUMS_USING_INDEX
,
true
);
}
private
static
final
char
[]
PWD_BASE
=
{
private
static
final
char
[]
PWD_BASE
=
{
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
,
'g'
,
'h'
,
'i'
,
'j'
,
'k'
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
,
'g'
,
'h'
,
'i'
,
'j'
,
'k'
,
'l'
,
'm'
,
'n'
,
'o'
,
'p'
,
'q'
,
'r'
,
's'
,
't'
,
'u'
,
'v'
,
'w'
,
'l'
,
'm'
,
'n'
,
'o'
,
'p'
,
'q'
,
'r'
,
's'
,
't'
,
'u'
,
'v'
,
'w'
,
...
@@ -566,34 +550,15 @@ public class InnerController implements IBaseController {
...
@@ -566,34 +550,15 @@ public class InnerController implements IBaseController {
}
}
@RequestMapping
(
"/user_detail/search_list"
)
@RequestMapping
(
"/user_detail/search_list"
)
@TargetDataSource
(
type
=
DSType
.
SLAVE
)
public
JsonResult
searchUserDetailList
(
String
name
,
String
phoneNo
,
String
idNo
)
{
public
JsonResult
searchUserDetailList
(
String
name
,
String
phoneNo
,
String
idNo
)
{
log
.
info
(
"searchUserDetailList ,param.name:{},phone:{},idNo:{},ip:{}"
,
name
,
phoneNo
,
idNo
,
getIp
());
log
.
info
(
"searchUserDetailList ,param.name:{},phone:{},idNo:{},ip:{}"
,
name
,
phoneNo
,
idNo
,
getIp
());
if
(
StringUtils
.
isBlank
(
name
)
&&
StringUtils
.
isBlank
(
phoneNo
)
&&
StringUtils
.
isBlank
(
idNo
))
{
if
(
StringUtils
.
isBlank
(
name
)
&&
StringUtils
.
isBlank
(
phoneNo
)
&&
StringUtils
.
isBlank
(
idNo
))
{
return
JsonResult
.
buildErrorStateResult
(
"至少必须满足一个条件不为空"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"至少必须满足一个条件不为空"
,
null
);
}
}
/*List<UserDetailVO> userDetails = userDetailService.searchUserDetailList(name, phoneNo, idNo);
List
<
UserDetailVO
>
userDetails
=
userDetailService
.
searchUserDetailList
(
name
,
phoneNo
,
idNo
);
return JsonResult.buildSuccessResult("success", userDetails);*/
return
JsonResult
.
buildSuccessResult
(
"success"
,
userDetails
);
ImmutableMap
.
Builder
<
String
,
String
>
builder
=
ImmutableMap
.
builder
();
if
(
StringUtils
.
isNotBlank
(
name
))
{
builder
.
put
(
"name"
,
name
);
}
if
(
StringUtils
.
isNotBlank
(
phoneNo
))
{
builder
.
put
(
Constants
.
PHONE_NO
,
phoneNo
);
}
if
(
StringUtils
.
isNotBlank
(
idNo
))
{
builder
.
put
(
"idNo"
,
idNo
);
}
Map
<
String
,
String
>
param
=
builder
.
build
();
String
s
=
httpService
.
get
(
queryUrl
.
concat
(
"/innerapi/user_detail/search_list"
),
param
);
boolean
isJson
=
StringUtils
.
isNotBlank
(
s
)
&&
s
.
trim
().
startsWith
(
"{"
)
&&
s
.
trim
().
endsWith
(
"}"
);
if
(!
isJson
)
{
log
.
warn
(
"用户详情信息查询结果不完整:{}"
,
s
);
JsonResult
.
buildErrorStateResult
(
"数据不完整"
,
s
);
}
return
JSON
.
parseObject
(
s
,
JsonResult
.
class
);
}
}
@RequestMapping
(
"/user_ext_info/search/user_id"
)
@RequestMapping
(
"/user_ext_info/search/user_id"
)
...
...
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