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
0b7134a0
Commit
0b7134a0
authored
Mar 07, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
按照UserStatistics注释纠正发送统计参数值
parent
323eefa0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
27 deletions
+30
-27
UserController.java
...ntgroup/xyqb/controller/internal/user/UserController.java
+26
-26
UserStatistics.java
src/main/java/cn/quantgroup/xyqb/model/UserStatistics.java
+4
-1
No files found.
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserController.java
View file @
0b7134a0
...
@@ -114,6 +114,28 @@ public class UserController implements IBaseController {
...
@@ -114,6 +114,28 @@ public class UserController implements IBaseController {
return
login
(
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
request
,
openId
,
dimension
);
return
login
(
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
request
,
openId
,
dimension
);
}
}
@LogHttpCaller
@PasswordErrorFiniteValidator
@RequestMapping
(
"/login"
)
public
JsonResult
login
(
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
channelId
,
String
appChannel
,
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
createdFrom
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
userId
,
@RequestParam
(
required
=
false
,
defaultValue
=
"xyqb"
)
String
key
,
HttpServletRequest
request
,
String
openId
,
@RequestParam
(
required
=
false
)
String
dimension
)
{
LOGGER
.
info
(
"login -> channelId:{},appChannel:{},createdFrom:{},userId:{},key:{},openId:{},dimension:{}"
,
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
openId
,
dimension
);
Merchant
merchant
=
merchantService
.
findMerchantByName
(
key
);
if
(
merchant
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
"未知的连接"
,
null
);
}
if
(!
StringUtils
.
isEmpty
(
userId
)
&&
userId
.
length
()
>
10
)
{
return
loginWithUserId
(
channelId
,
appChannel
,
createdFrom
,
userId
,
merchant
,
dimension
);
}
else
{
return
loginWithHttpBasic
(
channelId
,
appChannel
,
createdFrom
,
merchant
,
request
,
openId
,
dimension
);
}
}
/**
/**
* 快速登录(手机号 + 短信验证码),H5专用入口
* 快速登录(手机号 + 短信验证码),H5专用入口
* 短信验证码错误达到限定次数时执行图形验证码校验
* 短信验证码错误达到限定次数时执行图形验证码校验
...
@@ -139,29 +161,6 @@ public class UserController implements IBaseController {
...
@@ -139,29 +161,6 @@ public class UserController implements IBaseController {
return
loginFast
(
channelId
,
appChannel
,
createdFrom
,
key
,
btRegisterChannelId
,
dimension
,
request
);
return
loginFast
(
channelId
,
appChannel
,
createdFrom
,
key
,
btRegisterChannelId
,
dimension
,
request
);
}
}
@LogHttpCaller
@PasswordErrorFiniteValidator
@RequestMapping
(
"/login"
)
public
JsonResult
login
(
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
channelId
,
String
appChannel
,
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
createdFrom
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
userId
,
@RequestParam
(
required
=
false
,
defaultValue
=
"xyqb"
)
String
key
,
HttpServletRequest
request
,
String
openId
,
@RequestParam
(
required
=
false
)
String
dimension
)
{
LOGGER
.
info
(
"login -> channelId:{},appChannel:{},createdFrom:{},userId:{},key:{},openId:{},dimension:{}"
,
channelId
,
appChannel
,
createdFrom
,
userId
,
key
,
openId
,
dimension
);
Merchant
merchant
=
merchantService
.
findMerchantByName
(
key
);
if
(
merchant
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
"未知的连接"
,
null
);
}
if
(!
StringUtils
.
isEmpty
(
userId
)
&&
userId
.
length
()
>
10
)
{
return
loginWithUserId
(
channelId
,
appChannel
,
createdFrom
,
userId
,
merchant
,
dimension
);
}
else
{
return
loginWithHttpBasic
(
channelId
,
appChannel
,
createdFrom
,
merchant
,
request
,
openId
,
dimension
);
}
}
@RequestMapping
(
"/login/fast"
)
@RequestMapping
(
"/login/fast"
)
public
JsonResult
loginFast
(
public
JsonResult
loginFast
(
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
channelId
,
String
appChannel
,
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
channelId
,
String
appChannel
,
...
@@ -192,14 +191,15 @@ public class UserController implements IBaseController {
...
@@ -192,14 +191,15 @@ public class UserController implements IBaseController {
LOGGER
.
error
(
"用户不存在,或者已经注销,phoneNo:{}"
,
phoneNo
);
LOGGER
.
error
(
"用户不存在,或者已经注销,phoneNo:{}"
,
phoneNo
);
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
}
}
UserStatistics
statistics
=
new
UserStatistics
(
user
,
dimension
,
2
,
channelId
);
if
(
user
==
null
)
{
if
(
user
==
null
)
{
user
=
userRegisterService
.
register
(
phoneNo
,
channelId
,
createdFrom
,
appChannel
,
btRegisterChannelId
,
dimension
);
user
=
userRegisterService
.
register
(
phoneNo
,
channelId
,
createdFrom
,
appChannel
,
btRegisterChannelId
,
dimension
);
statistics
.
setAction
(
1
);
if
(
user
==
null
)
{
if
(
user
==
null
)
{
throw
new
UserNotExistException
(
"用户未找到"
);
throw
new
UserNotExistException
(
"用户未找到"
);
}
}
}
}
//增加登陆统计发送
//增加登陆统计发送
UserStatistics
statistics
=
new
UserStatistics
(
user
,
dimension
,
3
,
channelId
);
MqUtils
.
sendLoanVest
(
statistics
);
MqUtils
.
sendLoanVest
(
statistics
);
return
new
JsonResult
(
sessionService
.
createSession
(
channelId
,
createdFrom
,
appChannel
,
user
,
merchant
));
return
new
JsonResult
(
sessionService
.
createSession
(
channelId
,
createdFrom
,
appChannel
,
user
,
merchant
));
// return createSession(channelId, createdFrom, appChannel, user);
// return createSession(channelId, createdFrom, appChannel, user);
...
@@ -388,7 +388,7 @@ public class UserController implements IBaseController {
...
@@ -388,7 +388,7 @@ public class UserController implements IBaseController {
return
JsonResult
.
buildErrorStateResult
(
"用户名或密码不正确"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"用户名或密码不正确"
,
null
);
}
}
//增加登陆统计发送
//增加登陆统计发送
UserStatistics
statistics
=
new
UserStatistics
(
user
,
dimension
,
1
,
channelId
);
UserStatistics
statistics
=
new
UserStatistics
(
user
,
dimension
,
0
,
channelId
);
MqUtils
.
sendLoanVest
(
statistics
);
MqUtils
.
sendLoanVest
(
statistics
);
LOGGER
.
info
(
"用户登陆成功phonNo:{},当前ip:{},用户登陆信息:{}"
,
user
.
getPhoneNo
(),
IPUtil
.
getRemoteIP
(
request
),
statistics
);
LOGGER
.
info
(
"用户登陆成功phonNo:{},当前ip:{},用户登陆信息:{}"
,
user
.
getPhoneNo
(),
IPUtil
.
getRemoteIP
(
request
),
statistics
);
return
new
JsonResult
(
sessionService
.
createSession
(
channelId
,
createdFrom
,
appChannel
,
user
,
merchant
));
return
new
JsonResult
(
sessionService
.
createSession
(
channelId
,
createdFrom
,
appChannel
,
user
,
merchant
));
...
@@ -448,7 +448,7 @@ public class UserController implements IBaseController {
...
@@ -448,7 +448,7 @@ public class UserController implements IBaseController {
//用户信息存在,更新session中的最后访问时间,重新写入缓存.
//用户信息存在,更新session中的最后访问时间,重新写入缓存.
if
(
null
!=
user
||
!
user
.
getEnable
())
{
if
(
null
!=
user
||
!
user
.
getEnable
())
{
//增加登陆统计发送
//增加登陆统计发送
UserStatistics
statistics
=
new
UserStatistics
(
user
,
dimension
,
1
,
channelId
);
UserStatistics
statistics
=
new
UserStatistics
(
user
,
dimension
,
3
,
channelId
);
MqUtils
.
sendLoanVest
(
statistics
);
MqUtils
.
sendLoanVest
(
statistics
);
return
new
JsonResult
(
sessionService
.
createSession
(
channelId
,
createdFrom
,
appChannel
,
user
,
merchant
));
return
new
JsonResult
(
sessionService
.
createSession
(
channelId
,
createdFrom
,
appChannel
,
user
,
merchant
));
}
else
{
}
else
{
...
...
src/main/java/cn/quantgroup/xyqb/model/UserStatistics.java
View file @
0b7134a0
...
@@ -12,7 +12,10 @@ public class UserStatistics {
...
@@ -12,7 +12,10 @@ public class UserStatistics {
private
String
uuid
;
private
String
uuid
;
private
Long
registerFrom
;
private
Long
registerFrom
;
private
String
dimension
;
private
String
dimension
;
private
int
action
;
//登录0,注册1,快捷登录2,免密登录3
/**
* 登录0,注册1,快捷登录2,免密登录3
*/
private
int
action
;
private
Long
channel
;
private
Long
channel
;
public
UserStatistics
()
{
public
UserStatistics
()
{
...
...
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