Package com.bytedesk.core.rbac.authority
Class AuthorityRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<AuthorityEntity,AuthorityRequest,AuthorityResponse>
com.bytedesk.core.rbac.authority.AuthorityRestService
@Service
public class AuthorityRestService
extends BaseRestService<AuthorityEntity,AuthorityRequest,AuthorityResponse>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AuthorityRepository
private final org.modelmapper.ModelMapper
private final UidUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToResponse
(AuthorityEntity entity) create
(AuthorityRequest request) createForPlatform
(String permissionValue) void
delete
(AuthorityRequest entity) void
deleteByUid
(String uid) protected AuthorityEntity
doSave
(AuthorityEntity entity) existsByValue
(String value) findByValue
(String value) handleOptimisticLockingFailureException
(org.springframework.orm.ObjectOptimisticLockingFailureException e, AuthorityEntity entity) org.springframework.data.domain.Page<AuthorityResponse>
queryByOrg
(AuthorityRequest request) queryByUid
(AuthorityRequest request) org.springframework.data.domain.Page<AuthorityResponse>
queryByUser
(AuthorityRequest request) save
(AuthorityEntity entity) update
(AuthorityRequest request) Methods inherited from class com.bytedesk.core.base.BaseRestService
getUidFromRequest, recover
-
Field Details
-
authorityRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
-
Constructor Details
-
AuthorityRestService
public AuthorityRestService()
-
-
Method Details
-
queryByOrg
- Specified by:
queryByOrg
in classBaseRestService<AuthorityEntity,
AuthorityRequest, AuthorityResponse>
-
queryByUser
public org.springframework.data.domain.Page<AuthorityResponse> queryByUser(AuthorityRequest request) - Specified by:
queryByUser
in classBaseRestService<AuthorityEntity,
AuthorityRequest, AuthorityResponse>
-
findByUid
@Cacheable(value="authority", key="#uid", unless="#result==null") public Optional<AuthorityEntity> findByUid(String uid) - Specified by:
findByUid
in classBaseRestService<AuthorityEntity,
AuthorityRequest, AuthorityResponse>
-
findByValue
@Cacheable(value="authority", key="#value", unless="#result == null") public Optional<AuthorityEntity> findByValue(String value) -
existsByValue
-
createForPlatform
-
create
- Specified by:
create
in classBaseRestService<AuthorityEntity,
AuthorityRequest, AuthorityResponse>
-
update
- Specified by:
update
in classBaseRestService<AuthorityEntity,
AuthorityRequest, AuthorityResponse>
-
save
- Overrides:
save
in classBaseRestService<AuthorityEntity,
AuthorityRequest, AuthorityResponse>
-
doSave
- Specified by:
doSave
in classBaseRestService<AuthorityEntity,
AuthorityRequest, AuthorityResponse>
-
handleOptimisticLockingFailureException
public AuthorityEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, AuthorityEntity entity) - Specified by:
handleOptimisticLockingFailureException
in classBaseRestService<AuthorityEntity,
AuthorityRequest, AuthorityResponse>
-
deleteByUid
- Specified by:
deleteByUid
in classBaseRestService<AuthorityEntity,
AuthorityRequest, AuthorityResponse>
-
delete
- Specified by:
delete
in classBaseRestService<AuthorityEntity,
AuthorityRequest, AuthorityResponse>
-
convertToResponse
- Specified by:
convertToResponse
in classBaseRestService<AuthorityEntity,
AuthorityRequest, AuthorityResponse>
-
queryByUid
- Overrides:
queryByUid
in classBaseRestService<AuthorityEntity,
AuthorityRequest, AuthorityResponse>
-