Commit 8e57f0ba authored by neo's avatar neo

[DEV] delete user account service interface

parent fe31a606
package pwc.taxtech.atms.controller;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -9,21 +10,18 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
import pwc.taxtech.atms.dto.LoginOutputDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.user.UserPasswordDto;
import pwc.taxtech.atms.service.UserAccountService;
import pwc.taxtech.atms.service.impl.UserAccountServiceImpl;
/** @see PwC.Tax.Tech.Atms.WebApi\Controllers\AccountController.cs */
@RestController
@RequestMapping("/api/v1/Account/")
public class AccountController {
private static final Logger logger = LoggerFactory.getLogger(AccountController.class);
@Autowired
private UserAccountService userAccountService;
private UserAccountServiceImpl userAccountService;
@ApiOperation(value = "修改密码")
@RequestMapping(value = "userPassword", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
......
......@@ -29,7 +29,7 @@ import pwc.taxtech.atms.dto.user.UserRoleDisplayInfo;
import pwc.taxtech.atms.dto.user.UserRoleSaveDto;
import pwc.taxtech.atms.entity.User;
import pwc.taxtech.atms.service.RoleService;
import pwc.taxtech.atms.service.UserAccountService;
import pwc.taxtech.atms.service.impl.UserAccountServiceImpl;
import pwc.taxtech.atms.service.impl.UserRoleServiceImpl;
import pwc.taxtech.atms.service.impl.UserServiceImpl;
......@@ -46,7 +46,7 @@ public class UserController {
@Autowired
private RoleService roleService;
@Autowired
private UserAccountService userAccountService;
private UserAccountServiceImpl userAccountService;
// used to test,
// http://localhost:8080/atms-api/api/v1/user/getUser?id=0906913f-f8c3-423c-b9b1-9ae1be647087
......
package pwc.taxtech.atms.service;
import pwc.taxtech.atms.dto.LoginOutputDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.user.UserAndUserRoleSaveDto;
import pwc.taxtech.atms.dto.user.UserPasswordDto;
import pwc.taxtech.atms.entity.User;
public interface UserAccountService {
OperationResultDto<LoginOutputDto> changeExternalUserPassword(UserPasswordDto userPasswordDto);
void resetAttemptTimes(User tempUser);
void dealWithWrongPassword(User tempUser);
OperationResultDto<Object> forgetPassword(String mail);
OperationResultDto<User> addNewUser(UserAndUserRoleSaveDto userAndUserRoleSaveDto);
OperationResultDto<User> addUser(UserAndUserRoleSaveDto userAndUserRoleSaveDto);
}
......@@ -29,7 +29,6 @@ import pwc.taxtech.atms.entity.UserOrganization;
import pwc.taxtech.atms.entity.UserRole;
import pwc.taxtech.atms.security.AtmsPasswordEncoder;
import pwc.taxtech.atms.service.CommonService;
import pwc.taxtech.atms.service.UserAccountService;
import java.util.ArrayList;
import java.util.Date;
......@@ -37,7 +36,7 @@ import java.util.List;
import java.util.Objects;
@Service
public class UserAccountServiceImpl extends AbstractService implements UserAccountService {
public class UserAccountServiceImpl extends AbstractService {
// TODO Move it to constants file
private static final String MAIL_TEMPLATE_PATH = "mailTemplate/";
......@@ -61,7 +60,6 @@ public class UserAccountServiceImpl extends AbstractService implements UserAccou
@Autowired
private AtmsApiSettings atmsApiSettings;
@Override
public OperationResultDto<LoginOutputDto> changeExternalUserPassword(UserPasswordDto userPasswordDto) {
logger.debug("修改密码 Start");
final String userName = authUserHelper.getCurrentAuditor().get();
......@@ -148,7 +146,6 @@ public class UserAccountServiceImpl extends AbstractService implements UserAccou
return containsOldPassword;
}
@Override
public void resetAttemptTimes(User tempUser) {
User userTarget = new User();
userTarget.setAttemptTimes(0);
......@@ -156,7 +153,6 @@ public class UserAccountServiceImpl extends AbstractService implements UserAccou
userMapper.updateByPrimaryKeySelective(userTarget);
}
@Override
public void dealWithWrongPassword(User tempUser) {
User userTarget = new User();
userTarget.setId(tempUser.getId());
......@@ -182,7 +178,6 @@ public class UserAccountServiceImpl extends AbstractService implements UserAccou
}
@Override
public OperationResultDto<Object> forgetPassword(final String mail) {
OperationResultDto<ForgetPasswordDto> result = forgetPasswordForUser(mail);
if (result == null || result.getResult() == null || !result.getResult()) {
......@@ -253,7 +248,6 @@ public class UserAccountServiceImpl extends AbstractService implements UserAccou
return new OperationResultDto<>(true, null, forgetPasswordDto);
}
@Override
public OperationResultDto<User> addNewUser(UserAndUserRoleSaveDto userAndUserRoleSaveDto) {
OperationResultDto<User> user = addUser(userAndUserRoleSaveDto);
//todo send mail
......@@ -277,7 +271,6 @@ public class UserAccountServiceImpl extends AbstractService implements UserAccou
return user;
}
@Override
public OperationResultDto<User> addUser(UserAndUserRoleSaveDto userAndUserRoleSaveDto) {
String userName = authUserHelper.getCurrentAuditor().get();
OperationResultDto<User> operationResultDto = new OperationResultDto<>();
......
......@@ -58,7 +58,6 @@ import pwc.taxtech.atms.service.MenuService;
import pwc.taxtech.atms.service.OperationLogService;
import pwc.taxtech.atms.service.OrganizationService;
import pwc.taxtech.atms.service.RoleService;
import pwc.taxtech.atms.service.UserAccountService;
import java.util.ArrayList;
import java.util.Date;
......@@ -90,7 +89,7 @@ public class UserServiceImpl extends AbstractService {
@Autowired
private MenuService menuService;
@Autowired
private UserAccountService userAccountService;
private UserAccountServiceImpl userAccountService;
@Autowired
private LdapAuthenticationProvider ldapAuthenticationProvider;
@Autowired
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment