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
62a173c5
Commit
62a173c5
authored
Apr 28, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
清除重置账号的接口
parent
30485d11
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
68 deletions
+0
-68
InnerController.java
...tgroup/xyqb/controller/external/user/InnerController.java
+0
-30
IUserDetailRepository.java
.../cn/quantgroup/xyqb/repository/IUserDetailRepository.java
+0
-6
IUserRepository.java
...n/java/cn/quantgroup/xyqb/repository/IUserRepository.java
+0
-6
IUserService.java
...in/java/cn/quantgroup/xyqb/service/user/IUserService.java
+0
-11
UserServiceImpl.java
...cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
+0
-15
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/InnerController.java
View file @
62a173c5
...
...
@@ -33,7 +33,6 @@ import org.apache.commons.codec.binary.Base64;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.math.NumberUtils
;
import
org.apache.http.HttpStatus
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -1256,35 +1255,6 @@ public class InnerController implements IBaseController {
return
JsonResult
.
buildSuccessResult
(
"用户已禁用."
,
flushed
);
}
/**
* 重置账号(手机号)接口
* -- 供内部系统免密调用
*
* 注意:此操作会级联更新UserDetail的phoneNo
*
* @param userId - 用户主键
* @param account - 旧账号
* @param phoneNo - 新账号
*/
@LogHttpCaller
@RequestMapping
(
"/user/resetAccount/{userId}/{account}"
)
public
JsonResult
resetAccount
(
@PathVariable
(
"userId"
)
Long
userId
,
@PathVariable
(
"account"
)
String
account
,
@RequestParam
(
"phoneNo"
)
String
phoneNo
)
{
log
.
info
(
"重置用户账号 userId:{},account_old:{},account_new:{}"
,
userId
,
account
,
phoneNo
);
if
(
ValidationUtil
.
validatePhoneNo
(
account
)
&&
ValidationUtil
.
validatePhoneNo
(
phoneNo
)){
try
{
// 重置账号
boolean
result
=
userService
.
resetAccount
(
userId
,
account
,
phoneNo
);
log
.
info
(
"重置用户账号,结果:{},account_old:{},account_new:{}"
,
result
,
account
,
(
result
?
phoneNo
:
account
));
return
JsonResult
.
buildSuccessResult
(
"用户账号已重置."
.
concat
(
String
.
valueOf
(
result
)),
(
result
?
phoneNo
:
account
));
}
catch
(
Exception
e
)
{
log
.
error
(
"账号重置失败,phone[{}],err:[{}]"
,
phoneNo
,
e
);
}
return
JsonResult
.
buildErrorStateResult
(
"用户账号重置失败."
,
"Error phone"
);
}
else
{
return
JsonResult
.
buildErrorStateResult
(
"用户账号重置失败."
,
"Error phone"
);
}
}
/**
* 重置用户实名信息接口
* -- 供内部系统免密调用
...
...
src/main/java/cn/quantgroup/xyqb/repository/IUserDetailRepository.java
View file @
62a173c5
...
...
@@ -10,8 +10,6 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.List
;
import
static
org
.
springframework
.
transaction
.
annotation
.
Propagation
.
MANDATORY
;
/**
* @author mengfan.feng
* @time 2015-09-11 11:22
...
...
@@ -57,8 +55,4 @@ public interface IUserDetailRepository extends JpaRepository<UserDetail, Long>,J
@Query
(
value
=
"update user_detail set name=?1 where phone_no=?2"
,
nativeQuery
=
true
)
int
updateNameByPhoneNo
(
String
name
,
String
phoneNo
);
@Transactional
(
propagation
=
MANDATORY
)
@Modifying
@Query
(
value
=
"update user_detail set phone_no=?2 where user_id=?1"
,
nativeQuery
=
true
)
int
resetPhoneNo
(
Long
userId
,
String
phoneNo
);
}
src/main/java/cn/quantgroup/xyqb/repository/IUserRepository.java
View file @
62a173c5
...
...
@@ -9,7 +9,6 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.List
;
import
static
org
.
springframework
.
transaction
.
annotation
.
Propagation
.
MANDATORY
;
/**
* Created by Miraculous on 15/7/4.
...
...
@@ -32,9 +31,4 @@ public interface IUserRepository extends JpaRepository<User, Long>, JpaSpecifica
@Query
(
value
=
"update user set enable=?1 where phone_no=?2"
,
nativeQuery
=
true
)
int
forbiddenUser
(
Boolean
enable
,
String
phoneNo
);
@Transactional
(
propagation
=
MANDATORY
)
@Modifying
@Query
(
value
=
"update user set phone_no=?3 where id=?1 and phone_no=?2"
,
nativeQuery
=
true
)
int
resetAccount
(
Long
userId
,
String
account
,
String
phoneNo
);
}
src/main/java/cn/quantgroup/xyqb/service/user/IUserService.java
View file @
62a173c5
...
...
@@ -18,17 +18,6 @@ public interface IUserService {
boolean
resetPassword
(
String
phoneNo
,
String
password
);
/**
* 重置账号
* 注意:此操作会级联更新UserDetail的phoneNo
*
* @param userId - 用户主键
* @param account - 旧账号
* @param phoneNo - 新账号
* @return
*/
boolean
resetAccount
(
Long
userId
,
String
account
,
String
phoneNo
);
User
findByPhoneInDb
(
String
phone
);
User
findByUuidInDb
(
String
uuid
);
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
View file @
62a173c5
...
...
@@ -163,21 +163,6 @@ public class UserServiceImpl implements IUserService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@CacheEvict
(
value
=
"usercache"
,
key
=
"'xyqbuser' + #account"
,
cacheManager
=
"cacheManager"
)
public
boolean
resetAccount
(
Long
userId
,
String
account
,
String
phoneNo
){
int
rowUser
=
userRepository
.
resetAccount
(
userId
,
account
,
phoneNo
);
if
(
rowUser
!=
1
){
throw
new
RuntimeException
(
"重置账号失败!"
);
}
int
rowUserDetail
=
userDetailRepository
.
resetPhoneNo
(
userId
,
phoneNo
);
if
(
rowUserDetail
!=
1
){
throw
new
RuntimeException
(
"重置账号失败!"
);
}
return
true
;
}
@Override
public
List
<
User
>
findRegisterUserByTime
(
String
beginTime
,
String
endTime
)
{
return
userRepository
.
findRegisterUserByTime
(
beginTime
,
endTime
);
...
...
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