Commit 8e57f0ba authored by neo's avatar neo

[DEV] delete user account service interface

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