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
e7579052
Commit
e7579052
authored
May 19, 2017
by
Java-刘 彧阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加日志打印
parent
2467e8c5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
2 deletions
+32
-2
UserController.java
...ntgroup/xyqb/controller/internal/user/UserController.java
+17
-2
IUserService.java
...in/java/cn/quantgroup/xyqb/service/user/IUserService.java
+2
-0
UserServiceImpl.java
...cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
+13
-0
No files found.
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserController.java
View file @
e7579052
...
@@ -94,7 +94,7 @@ public class UserController implements IBaseController {
...
@@ -94,7 +94,7 @@ public class UserController implements IBaseController {
@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
,
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
createdFrom
,
String
key
,
HttpServletRequest
request
)
{
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Long
createdFrom
,
String
key
,
@RequestParam
(
required
=
false
)
Long
btRegisterChannelId
,
HttpServletRequest
request
)
{
Map
<
String
,
JsonResult
>
validMap
=
getHeaderParam
(
request
);
Map
<
String
,
JsonResult
>
validMap
=
getHeaderParam
(
request
);
if
(
null
!=
validMap
.
get
(
"fail"
))
{
if
(
null
!=
validMap
.
get
(
"fail"
))
{
return
validMap
.
get
(
"fail"
);
return
validMap
.
get
(
"fail"
);
...
@@ -110,7 +110,7 @@ public class UserController implements IBaseController {
...
@@ -110,7 +110,7 @@ public class UserController implements IBaseController {
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
}
}
if
(
user
==
null
)
{
if
(
user
==
null
)
{
user
=
registerFastWhenLogin
(
phoneNo
,
channelId
,
createdFrom
,
appChannel
);
user
=
registerFastWhenLogin
(
phoneNo
,
channelId
,
createdFrom
,
appChannel
,
btRegisterChannelId
);
if
(
user
==
null
)
{
if
(
user
==
null
)
{
throw
new
UserNotExistException
(
"用户未找到"
);
throw
new
UserNotExistException
(
"用户未找到"
);
}
}
...
@@ -119,6 +119,21 @@ public class UserController implements IBaseController {
...
@@ -119,6 +119,21 @@ public class UserController implements IBaseController {
// return createSession(channelId, createdFrom, appChannel, user);
// return createSession(channelId, createdFrom, appChannel, user);
}
}
private
User
registerFastWhenLogin
(
String
phoneNo
,
Long
channelId
,
Long
registerFrom
,
String
appChannel
,
Long
btRegisterChannelId
)
{
String
password
=
genRandomPwd
();
LOGGER
.
info
(
"用户快速注册, phoneNo:{}, verificationCode:{}, channelId:{}, registerFrom:{},appChannel:{}"
,
phoneNo
,
channelId
,
registerFrom
,
appChannel
);
if
(!
ValidationUtil
.
validatePhoneNo
(
phoneNo
))
{
LOGGER
.
info
(
"用户快速注册失败,手机号错误, registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
throw
new
UserNotExistException
(
"手机号错误"
);
}
if
(
null
==
registerFrom
)
{
registerFrom
=
1L
;
}
LOGGER
.
info
(
"用户快速注册成功, registerFrom:{}, phoneNo:{}"
,
registerFrom
,
phoneNo
);
return
userService
.
registerAndReturn
(
phoneNo
,
password
,
registerFrom
,
btRegisterChannelId
);
}
/**
/**
* 快速登录验证
* 快速登录验证
*
*
...
...
src/main/java/cn/quantgroup/xyqb/service/user/IUserService.java
View file @
e7579052
...
@@ -34,4 +34,6 @@ public interface IUserService {
...
@@ -34,4 +34,6 @@ public interface IUserService {
boolean
register
(
String
phoneNo
,
String
password
,
Long
registerFrom
,
String
ip
,
Long
channelId
,
Long
btRegisterChannelId
);
boolean
register
(
String
phoneNo
,
String
password
,
Long
registerFrom
,
String
ip
,
Long
channelId
,
Long
btRegisterChannelId
);
List
<
User
>
findByPhones
(
List
<
String
>
phones
);
List
<
User
>
findByPhones
(
List
<
String
>
phones
);
User
registerAndReturn
(
String
phoneNo
,
String
password
,
Long
registerFrom
,
Long
btRegisterChannelId
);
}
}
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
View file @
e7579052
...
@@ -103,6 +103,19 @@ public class UserServiceImpl implements IUserService {
...
@@ -103,6 +103,19 @@ public class UserServiceImpl implements IUserService {
});
});
}
}
@Override
public
User
registerAndReturn
(
String
phoneNo
,
String
password
,
Long
registerFrom
,
Long
btRegisterChannelId
)
{
User
user
=
registerAndReturn
(
phoneNo
,
password
,
registerFrom
);
if
(
null
!=
user
&&
null
!=
btRegisterChannelId
){
UserBtRegister
userBtRegister
=
new
UserBtRegister
();
userBtRegister
.
setUserId
(
user
.
getId
());
userBtRegister
.
setRegisterBtMerchantId
(
btRegisterChannelId
);
userBtRegisterService
.
save
(
userBtRegister
);
log
.
info
(
"白条注册渠道信息保存完成"
);
}
return
user
;
}
@Override
@Override
public
boolean
register
(
String
phoneNo
,
String
password
,
Long
registerFrom
,
String
ip
,
Long
channelId
,
Long
btRegisterChannelId
)
{
public
boolean
register
(
String
phoneNo
,
String
password
,
Long
registerFrom
,
String
ip
,
Long
channelId
,
Long
btRegisterChannelId
)
{
String
uuid
=
lkbUserService
.
registerApp
(
phoneNo
,
password
);
String
uuid
=
lkbUserService
.
registerApp
(
phoneNo
,
password
);
...
...
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