Tabnine Logo
UserEntity.getPassword
Code IndexAdd Tabnine to your IDE (free)

How to use
getPassword
method
in
com.wikift.model.user.UserEntity

Best Java code snippets using com.wikift.model.user.UserEntity.getPassword (Showing top 5 results out of 315)

origin: wikift/wikift

@Override
public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
  UserEntity userEntity = userService.getInfoByUsername(s);
  if (ObjectUtils.isEmpty(userEntity)) {
    throw new UsernameNotFoundException(String.format("this user %s not found", s));
  }
  // 封装权限信息
  List<GrantedAuthority> authorities = new ArrayList<>();
  userEntity.getUserRoles().forEach(v -> authorities.add(new SimpleGrantedAuthority(v.getRoleName())));
  UserDetails userDetails = new User(userEntity.getUsername(), userEntity.getPassword(), authorities);
  return userDetails;
}
origin: wikift/wikift

@Override
public Integer updatePassword(UserEntity entity) {
  return userRepository.updateByPassword(entity.getId(), entity.getPassword());
}
origin: wikift/wikift

@PreAuthorize("hasAuthority(('USER')) && hasPermission(#entity.id, 'update|user')")
@RequestMapping(value = "user/update", method = RequestMethod.PUT)
CommonResult<UserEntity> update(@RequestBody UserEntity entity) {
  Assert.notNull(entity, MessageEnums.PARAMS_NOT_NULL.getValue());
  UserEntity targetUserEntity = userService.getUserById(entity.getId());
  entity.setPassword(targetUserEntity.getPassword());
  return CommonResult.success(userService.update(entity));
}
origin: wikift/wikift

@Override
public UserEntity update(UserEntity entity) {
  entity.setPassword(userRepository.findByUsername(entity.getUsername()).getPassword());
  return userRepository.save(entity);
}
origin: wikift/wikift

@PreAuthorize("hasAuthority(('USER')) && hasPermission(#param.id, 'update|user')")
@RequestMapping(value = "user/update/password", method = RequestMethod.PUT)
CommonResult<UserEntity> updatePassword(@RequestBody @Validated UserParamForPassword param) {
  Assert.notNull(param, MessageEnums.PARAMS_NOT_NULL.getValue());
  // 抽取邮箱是否为当前用户设置的邮箱地址
  UserEntity user = userService.getUserById(param.getId());
  if (!param.getEmail().equals(user.getEmail())) {
    return CommonResult.validateError(MessageEnums.USER_EMAIL_NOT_AGREE);
  }
  // 抽取原密码是否正确
  if (!ShaUtils.hash256(param.getPassword()).equals(user.getPassword())) {
    return CommonResult.validateError(MessageEnums.USER_PASSWORD_INPUT_ERROR);
  }
  // 抽取修改后密码是否与原密码一致
  if (param.getRepassword().equals(param.getPassword())) {
    return CommonResult.validateError(MessageEnums.USER_PASSWORD_INPUT_SAME);
  }
  UserEntity entity = new UserEntity();
  entity.setId(param.getId());
  entity.setPassword(ShaUtils.hash256(param.getRepassword()));
  return CommonResult.success(userService.updatePassword(entity));
}
com.wikift.model.userUserEntitygetPassword

Popular methods of UserEntity

  • getEmail
  • getId
  • getUsername
  • <init>
  • setPassword
  • setUserType
  • setUsername
  • getFollows
  • getUserRoles
  • getUserType
  • setEmail
  • setId
  • setEmail,
  • setId,
  • setUserRoles

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • putExtra (Intent)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now