@Test public void createUsernamePasswordIdentity() { UserIdentityDO userIdentity = userIdentityService.createUsernamePasswordIdentity( 1L, "pedro", "123456"); assertNotNull(userIdentity.getId()); assertTrue(EncryptUtil.verify(userIdentity.getCredential(), "123456")); }
@Override public UserIdentityDO createUsernamePasswordIdentity(Long userId, String identifier, String credential) { credential = EncryptUtil.encrypt(credential); return this.createIdentity(userId, IdentityConsts.USERNAME_PASSWORD_IDENTITY, identifier, credential); }
UserIdentityServiceImpl extends ServiceImpl<UserIdentityMapper, UserIdentityDO> implements UserIdentityService { @Override public UserIdentityDO createUsernamePasswordIdentity(Long userId, String identifier, String credential) { credential = EncryptUtil.encrypt(credential); return this.createIdentity(userId, IdentityConsts.USERNAME_PASSWORD_IDENTITY, identifier, credential); } }
UserIdentityServiceImpl extends ServiceImpl<UserIdentityMapper, UserIdentityDO> implements UserIdentityService { @Override public UserIdentityDO createUsernamePasswordIdentity(Long userId, String identifier, String credential) { credential = EncryptUtil.encrypt(credential); return this.createIdentity(userId, IdentityConsts.USERNAME_PASSWORD_IDENTITY, identifier, credential); }  }
UserIdentityServiceImpl extends ServiceImpl<UserIdentityMapper, UserIdentityDO> implements UserIdentityService { @Override public UserIdentityDO createUsernamePasswordIdentity(Long userId, String identifier, String credential) { credential = EncryptUtil.encrypt(credential); return this.createIdentity(userId, IdentityConsts.USERNAME_PASSWORD_IDENTITY, identifier, credential); }  @Override UserIdentityDO createIdentity(Long userId, String identityType, String identifier, String credential); @Override UserIdentityDO createIdentity(UserIdentityDO userIdentity); @Override UserIdentityDO createUsernamePasswordIdentity(Long userId, String identifier, String credential); @Override boolean verifyUsernamePassword(Long userId, String username, String password); @Override boolean changePassword(Long userId, String password); @Override boolean changeUsername(Long userId, String username); @Override boolean changeUsernamePassword(Long userId, String username, String password); }
UserIdentityServiceImpl extends ServiceImpl<UserIdentityMapper, UserIdentityDO> implements UserIdentityService { @Override public UserIdentityDO createUsernamePasswordIdentity(Long userId, String identifier, String credential) { credential = EncryptUtil.encrypt(credential); return this.createIdentity(userId, IdentityConsts.USERNAME_PASSWORD_IDENTITY, identifier, credential); }  @Override UserIdentityDO createIdentity(Long userId, String identityType, String identifier, String credential); @Override UserIdentityDO createIdentity(UserIdentityDO userIdentity); @Override UserIdentityDO createUsernamePasswordIdentity(Long userId, String identifier, String credential); @Override boolean verifyUsernamePassword(Long userId, String username, String password); @Override boolean changePassword(Long userId, String password); @Override boolean changeUsername(Long userId, String username); @Override boolean changeUsernamePassword(Long userId, String username, String password);  }