Package com.bytedesk.control.license
Class LicenseRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<LicenseEntity,LicenseRequest,LicenseResponse>
com.bytedesk.control.license.LicenseRestService
@Service
public class LicenseRestService
extends BaseRestService<LicenseEntity,LicenseRequest,LicenseResponse>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LicenseRepository
private final org.modelmapper.ModelMapper
private final UidUtils
Fields inherited from class com.bytedesk.core.base.BaseRestService
authService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToResponse
(LicenseEntity entity) create
(LicenseRequest request) protected org.springframework.data.jpa.domain.Specification<LicenseEntity>
createSpecification
(LicenseRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现void
delete
(LicenseRequest request) void
deleteByUid
(String uid) protected LicenseEntity
doSave
(LicenseEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<LicenseEntity>
executePageQuery
(org.springframework.data.jpa.domain.Specification<LicenseEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现generateLicenseKey
(LicenseEntity entity) 生成激活密钥,按格式拼接、base64编码(不再AES加密)handleOptimisticLockingFailureException
(org.springframework.orm.ObjectOptimisticLockingFailureException e, LicenseEntity entity) parseLicenseKey
(String licenseKey) 解析激活密钥,base64解码->字段拆分(不再AES解密)queryByUid
(LicenseRequest request) 通用的queryByUid实现update
(LicenseRequest request) boolean
validateLicense
(String licenseKey) 验证授权Methods inherited from class com.bytedesk.core.base.BaseRestService
deleteByOrgUid, findByOrgUid, getUidFromRequest, queryByOrg, queryByUser, recover, save, setUserUidToRequest
-
Field Details
-
licenseRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
-
Constructor Details
-
LicenseRestService
public LicenseRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<LicenseEntity> createSpecification(LicenseRequest request) Description copied from class:BaseRestService
创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecification
in classBaseRestService<LicenseEntity,
LicenseRequest, LicenseResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<LicenseEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<LicenseEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService
执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQuery
in classBaseRestService<LicenseEntity,
LicenseRequest, LicenseResponse>
-
queryByUid
Description copied from class:BaseRestService
通用的queryByUid实现- Overrides:
queryByUid
in classBaseRestService<LicenseEntity,
LicenseRequest, LicenseResponse>
-
findByUid
- Specified by:
findByUid
in classBaseRestService<LicenseEntity,
LicenseRequest, LicenseResponse>
-
create
- Specified by:
create
in classBaseRestService<LicenseEntity,
LicenseRequest, LicenseResponse>
-
update
- Specified by:
update
in classBaseRestService<LicenseEntity,
LicenseRequest, LicenseResponse>
-
doSave
Description copied from class:BaseRestService
子类实现具体的保存逻辑- Specified by:
doSave
in classBaseRestService<LicenseEntity,
LicenseRequest, LicenseResponse>
-
deleteByUid
- Specified by:
deleteByUid
in classBaseRestService<LicenseEntity,
LicenseRequest, LicenseResponse>
-
delete
- Specified by:
delete
in classBaseRestService<LicenseEntity,
LicenseRequest, LicenseResponse>
-
handleOptimisticLockingFailureException
public LicenseEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, LicenseEntity entity) - Specified by:
handleOptimisticLockingFailureException
in classBaseRestService<LicenseEntity,
LicenseRequest, LicenseResponse>
-
convertToResponse
- Specified by:
convertToResponse
in classBaseRestService<LicenseEntity,
LicenseRequest, LicenseResponse>
-
generateLicenseKey
生成激活密钥,按格式拼接、base64编码(不再AES加密) -
parseLicenseKey
解析激活密钥,base64解码->字段拆分(不再AES解密) -
validateLicense
验证授权
-