| | |
| | |
|
| | | import com.moral.common.exception.BusinessException;
|
| | | import com.moral.common.util.Crypto;
|
| | | import com.moral.common.util.ValidateUtil;
|
| | | import com.moral.entity.OperateUser;
|
| | | import com.moral.mapper.OperateUserMapper;
|
| | | import com.moral.service.OperateUserService;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | @Service
|
| | | public class OperateUserServiceImpl implements OperateUserService {
|
| | |
| | |
|
| | | @Override
|
| | | public OperateUser mobileLogin(String mobile, String password) {
|
| | | ValidateUtil.notEmpty(mobile, "param.is.null");
|
| | | ValidateUtil.notEmpty(password, "param.is.null");
|
| | | OperateUser operateUser = new OperateUser();
|
| | | operateUser.setMobile(mobile);
|
| | | operateUser.setPassword(Crypto.md5(password));
|
| | |
| | | @Override
|
| | | @Transactional
|
| | | public OperateUser updatePassword(Integer uid, String password, String newPassword) {
|
| | | ValidateUtil.notNull(uid, "param.is.null");
|
| | | ValidateUtil.notEmpty(password, "param.is.null");
|
| | | ValidateUtil.notEmpty(newPassword, "param.is.null");
|
| | | OperateUser operateUser = operateUserMapper.selectByPrimaryKey(uid);
|
| | | if (ObjectUtils.isEmpty(operateUser) || !Crypto.md5(password).equals(operateUser.getPassword())) {
|
| | | throw new BusinessException("旧密码错误,修改密码失败!");
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<OperateUser> findOperateUserList() {
|
| | | return operateUserMapper.findOperateUserList();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Long findOperateUserCount() {
|
| | | return operateUserMapper.findOperateUserCount();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public OperateUser findOperateUser(int id) {
|
| | | return operateUserMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public int insertOperateUser(OperateUser user) {
|
| | | return operateUserMapper.insertSelective(user);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public int updateOperateUser(OperateUser user) {
|
| | | return operateUserMapper.updateByPrimaryKeySelective(user);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public int deleteOperateUser(int id) {
|
| | | return operateUserMapper.deleteByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public int deleteOperateUserList(String[] ids) {
|
| | | return operateUserMapper.deleteOperateUserList(ids);
|
| | | }
|
| | | }
|