Package com.bytedesk.core.webhook
Class WebhookRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<T,TRequest,TResponse>
com.bytedesk.core.base.BaseRestServiceWithExport<WebhookEntity,WebhookRequest,WebhookResponse,WebhookExcel>
com.bytedesk.core.webhook.WebhookRestService
@Service
public class WebhookRestService
extends BaseRestServiceWithExport<WebhookEntity,WebhookRequest,WebhookResponse,WebhookExcel>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.modelmapper.ModelMapperprivate final UidUtilsprivate final WebhookRepositoryFields inherited from class com.bytedesk.core.base.BaseRestService
authService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToExcel(WebhookEntity entity) 转换为Excel对象 子类必须实现此方法convertToResponse(WebhookEntity entity) create(WebhookRequest request) protected org.springframework.data.jpa.domain.Specification<WebhookEntity>createSpecification(WebhookRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现voiddelete(WebhookRequest request) voiddeleteByUid(String uid) protected WebhookEntitydoSave(WebhookEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<WebhookEntity>executePageQuery(org.springframework.data.jpa.domain.Specification<WebhookEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现existsByUid(String uid) handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, WebhookEntity entity) update(WebhookRequest 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
-
webhookRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
-
Constructor Details
-
WebhookRestService
public WebhookRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<WebhookEntity> createSpecification(WebhookRequest request) Description copied from class:BaseRestService创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecificationin classBaseRestService<WebhookEntity,WebhookRequest, WebhookResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<WebhookEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<WebhookEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQueryin classBaseRestService<WebhookEntity,WebhookRequest, WebhookResponse>
-
findByUid
@Cacheable(value="webhook", key="#uid", unless="#result==null") public Optional<WebhookEntity> findByUid(String uid) - Specified by:
findByUidin classBaseRestService<WebhookEntity,WebhookRequest, WebhookResponse>
-
existsByUid
-
create
- Specified by:
createin classBaseRestService<WebhookEntity,WebhookRequest, WebhookResponse>
-
update
- Specified by:
updatein classBaseRestService<WebhookEntity,WebhookRequest, WebhookResponse>
-
doSave
Description copied from class:BaseRestService子类实现具体的保存逻辑- Specified by:
doSavein classBaseRestService<WebhookEntity,WebhookRequest, WebhookResponse>
-
handleOptimisticLockingFailureException
public WebhookEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, WebhookEntity entity) - Specified by:
handleOptimisticLockingFailureExceptionin classBaseRestService<WebhookEntity,WebhookRequest, WebhookResponse>
-
deleteByUid
- Specified by:
deleteByUidin classBaseRestService<WebhookEntity,WebhookRequest, WebhookResponse>
-
delete
- Specified by:
deletein classBaseRestService<WebhookEntity,WebhookRequest, WebhookResponse>
-
convertToResponse
- Specified by:
convertToResponsein classBaseRestService<WebhookEntity,WebhookRequest, WebhookResponse>
-
convertToExcel
Description copied from class:BaseRestServiceWithExport转换为Excel对象 子类必须实现此方法- Specified by:
convertToExcelin classBaseRestServiceWithExport<WebhookEntity,WebhookRequest, WebhookResponse, WebhookExcel>
-