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 LicenseRepositoryprivate final org.modelmapper.ModelMapperprivate final UidUtilsFields 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的通用实现voiddelete(LicenseRequest request) voiddeleteByUid(String uid) protected LicenseEntitydoSave(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) booleanvalidateLicense(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:
createSpecificationin 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:
executePageQueryin classBaseRestService<LicenseEntity,LicenseRequest, LicenseResponse>
-
queryByUid
Description copied from class:BaseRestService通用的queryByUid实现- Overrides:
queryByUidin classBaseRestService<LicenseEntity,LicenseRequest, LicenseResponse>
-
findByUid
- Specified by:
findByUidin classBaseRestService<LicenseEntity,LicenseRequest, LicenseResponse>
-
create
- Specified by:
createin classBaseRestService<LicenseEntity,LicenseRequest, LicenseResponse>
-
update
- Specified by:
updatein classBaseRestService<LicenseEntity,LicenseRequest, LicenseResponse>
-
doSave
Description copied from class:BaseRestService子类实现具体的保存逻辑- Specified by:
doSavein classBaseRestService<LicenseEntity,LicenseRequest, LicenseResponse>
-
deleteByUid
- Specified by:
deleteByUidin classBaseRestService<LicenseEntity,LicenseRequest, LicenseResponse>
-
delete
- Specified by:
deletein classBaseRestService<LicenseEntity,LicenseRequest, LicenseResponse>
-
handleOptimisticLockingFailureException
public LicenseEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, LicenseEntity entity) - Specified by:
handleOptimisticLockingFailureExceptionin classBaseRestService<LicenseEntity,LicenseRequest, LicenseResponse>
-
convertToResponse
- Specified by:
convertToResponsein classBaseRestService<LicenseEntity,LicenseRequest, LicenseResponse>
-
generateLicenseKey
生成激活密钥,按格式拼接、base64编码(不再AES加密) -
parseLicenseKey
解析激活密钥,base64解码->字段拆分(不再AES解密) -
validateLicense
验证授权
-