Package com.bytedesk.core.rbac.user
Class UserRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<T,TRequest,TResponse>
com.bytedesk.core.base.BaseRestServiceWithExport<UserEntity,UserRequest,UserResponse,UserExcel>
com.bytedesk.core.rbac.user.UserRestService
@Service
public class UserRestService
extends BaseRestServiceWithExport<UserEntity,UserRequest,UserResponse,UserExcel>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AuthServiceprivate final org.springframework.security.crypto.bcrypt.BCryptPasswordEncoderprivate final UserRepositoryprivate final UserService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToExcel(UserEntity entity) 转换为Excel对象 子类必须实现此方法convertToResponse(UserEntity entity) create(UserRequest request) protected org.springframework.data.jpa.domain.Specification<UserEntity>createSpecification(UserRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现voiddelete(UserRequest request) voiddeleteByUid(String uid) protected UserEntitydoSave(UserEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<UserEntity>executePageQuery(org.springframework.data.jpa.domain.Specification<UserEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现findAll(UserRequest request) handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, UserEntity entity) update(UserRequest request) Methods inherited from class com.bytedesk.core.base.BaseRestServiceWithExport
queryByOrgEntityMethods inherited from class com.bytedesk.core.base.BaseRestService
deleteByOrgUid, findByOrgUid, getUidFromRequest, queryByOrg, queryByUid, queryByUser, recover, save, setUserUidToRequest
-
Field Details
-
userRepository
-
authService
-
userService
-
passwordEncoder
private final org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder passwordEncoder
-
-
Constructor Details
-
UserRestService
public UserRestService()
-
-
Method Details
-
findByUid
@Cacheable(value="user", key="#uid", unless="#result == null") public Optional<UserEntity> findByUid(String uid) - Specified by:
findByUidin classBaseRestService<UserEntity,UserRequest, UserResponse>
-
getProfile
-
create
- Specified by:
createin classBaseRestService<UserEntity,UserRequest, UserResponse>
-
update
- Specified by:
updatein classBaseRestService<UserEntity,UserRequest, UserResponse>
-
doSave
Description copied from class:BaseRestService子类实现具体的保存逻辑- Specified by:
doSavein classBaseRestService<UserEntity,UserRequest, UserResponse>
-
handleOptimisticLockingFailureException
public UserEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, UserEntity entity) - Specified by:
handleOptimisticLockingFailureExceptionin classBaseRestService<UserEntity,UserRequest, UserResponse>
-
deleteByUid
- Specified by:
deleteByUidin classBaseRestService<UserEntity,UserRequest, UserResponse>
-
delete
- Specified by:
deletein classBaseRestService<UserEntity,UserRequest, UserResponse>
-
convertToResponse
- Specified by:
convertToResponsein classBaseRestService<UserEntity,UserRequest, UserResponse>
-
findAll
-
convertToExcel
Description copied from class:BaseRestServiceWithExport转换为Excel对象 子类必须实现此方法- Specified by:
convertToExcelin classBaseRestServiceWithExport<UserEntity,UserRequest, UserResponse, UserExcel>
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<UserEntity> createSpecification(UserRequest request) Description copied from class:BaseRestService创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecificationin classBaseRestService<UserEntity,UserRequest, UserResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<UserEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<UserEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQueryin classBaseRestService<UserEntity,UserRequest, UserResponse>
-