@Test public void register() { RegisterVO registerVO = new RegisterVO(); registerVO.setEmail(TestConsts.EMAIL); registerVO.setPassword(TestConsts.PASSWORD); registerVO.setUsername(TestConsts.USERNAME); userService.register(registerVO); }
@Override @LogMethod("注册用户") public void register(RegisterVO registerVO) { Checker.checkUsername(commonService, registerVO.getUsername()); Checker.checkEmail(commonService, registerVO.getEmail()); Checker.checkVerifyCode(registerVO.getEmail(), registerVO.getVcode()); User user = new User(); user.setUsername(registerVO.getUsername()); user.setEmail(registerVO.getEmail()); user.setPassword(DigestUtil.md5Hex(registerVO.getPassword())); user.setCreateTime(System.currentTimeMillis()); user.setId(IdUtil.simpleUUID()); user.setStatus("7"); save(user, false); }
UserServiceImpl implements UserService { @Override @LogMethod("注册用户") public void register(RegisterVO registerVO) { Checker.checkUsername(commonService, registerVO.getUsername()); Checker.checkEmail(commonService, registerVO.getEmail()); Checker.checkVerifyCode(registerVO.getEmail(), registerVO.getVcode()); User user = new User(); user.setUsername(registerVO.getUsername()); user.setEmail(registerVO.getEmail()); user.setPassword(DigestUtil.md5Hex(registerVO.getPassword())); user.setCreateTime(System.currentTimeMillis()); user.setId(IdUtil.simpleUUID()); user.setStatus("7"); save(user, false); } }
UserServiceImpl implements UserService { @Override @LogMethod("注册用户") public void register(RegisterVO registerVO) { Checker.checkUsername(commonService, registerVO.getUsername()); Checker.checkEmail(commonService, registerVO.getEmail()); Checker.checkVerifyCode(registerVO.getEmail(), registerVO.getVcode()); User user = new User(); user.setUsername(registerVO.getUsername()); user.setEmail(registerVO.getEmail()); user.setPassword(DigestUtil.md5Hex(registerVO.getPassword())); user.setCreateTime(System.currentTimeMillis()); user.setId(IdUtil.simpleUUID()); user.setStatus("7"); save(user, false); } @Autowired  UserServiceImpl(UserDAO userDAO, RedisTemplate<String, User> userRedisTemplate,
                           CommonService commonService); }
UserServiceImpl implements UserService { @Override @LogMethod("注册用户") public void register(RegisterVO registerVO) { Checker.checkUsername(commonService, registerVO.getUsername()); Checker.checkEmail(commonService, registerVO.getEmail()); Checker.checkVerifyCode(registerVO.getEmail(), registerVO.getVcode()); User user = new User(); user.setUsername(registerVO.getUsername()); user.setEmail(registerVO.getEmail()); user.setPassword(DigestUtil.md5Hex(registerVO.getPassword())); user.setCreateTime(System.currentTimeMillis()); user.setId(IdUtil.simpleUUID()); user.setStatus("7"); save(user, false); } @Autowired  UserServiceImpl(UserDAO userDAO, RedisTemplate<String, User> userRedisTemplate,
                           CommonService commonService); @Override @LogMethod("更新邮箱") void updateEmail(User user, String email); @Override @LogMethod("更新用户名") void updateUsername(User user, String username); @Override @LogMethod("更新用户头像") void updateAvatar(User user, String avatar); @Override @LogMethod("更新用户信息") void updateInfo(User user, UserInfoVO userInfoVO); @Override @LogMethod("注册用户") void register(RegisterVO registerVO); @Override @LogMethod("重置密码") void resetPassword(String email, String newPassword); @Override @LogMethod("修改密码") boolean updatePassword(User user, String oldPassword, String newPassword); @Override @LogMethod("用户登录") String login(String loginName, String password); @Override User getUserByToken(String token); }
UserServiceImpl implements UserService { @Override @LogMethod("注册用户") public void register(RegisterVO registerVO) { Checker.checkUsername(commonService, registerVO.getUsername()); Checker.checkEmail(commonService, registerVO.getEmail()); Checker.checkVerifyCode(registerVO.getEmail(), registerVO.getVcode()); User user = new User(); user.setUsername(registerVO.getUsername()); user.setEmail(registerVO.getEmail()); user.setPassword(DigestUtil.md5Hex(registerVO.getPassword())); user.setCreateTime(System.currentTimeMillis()); user.setId(IdUtil.simpleUUID()); user.setStatus("7"); save(user, false); } @Autowired  UserServiceImpl(UserDAO userDAO, RedisTemplate<String, User> userRedisTemplate,
                           CommonService commonService); @Override @LogMethod("更新邮箱") void updateEmail(User user, String email); @Override @LogMethod("更新用户名") void updateUsername(User user, String username); @Override @LogMethod("更新用户头像") void updateAvatar(User user, String avatar); @Override @LogMethod("更新用户信息") void updateInfo(User user, UserInfoVO userInfoVO); @Override @LogMethod("注册用户") void register(RegisterVO registerVO); @Override @LogMethod("重置密码") void resetPassword(String email, String newPassword); @Override @LogMethod("修改密码") boolean updatePassword(User user, String oldPassword, String newPassword); @Override @LogMethod("用户登录") String login(String loginName, String password); @Override User getUserByToken(String token);  }