Package com.bytedesk.ai.alibaba.shopping
Class ShoppingRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<T,TRequest,TResponse>
  
com.bytedesk.core.base.BaseRestServiceWithExport<ShoppingEntity,ShoppingRequest,ShoppingResponse,ShoppingExcel>
   
com.bytedesk.ai.alibaba.shopping.ShoppingRestService
@Service
public class ShoppingRestService
extends BaseRestServiceWithExport<ShoppingEntity,ShoppingRequest,ShoppingResponse,ShoppingExcel>   
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final org.modelmapper.ModelMapperprivate final ShoppingRepositoryprivate final UidUtilsFields inherited from class com.bytedesk.core.base.BaseRestServiceauthService
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionconvertToExcel(ShoppingEntity entity) 转换为Excel对象 子类必须实现此方法convertToResponse(ShoppingEntity entity) create(ShoppingRequest request) protected org.springframework.data.jpa.domain.Specification<ShoppingEntity>createSpecification(ShoppingRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现voiddelete(ShoppingRequest request) voiddeleteByUid(String uid) protected ShoppingEntitydoSave(ShoppingEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<ShoppingEntity>executePageQuery(org.springframework.data.jpa.domain.Specification<ShoppingEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现existsByUid(String uid) findByNameAndOrgUidAndType(String name, String orgUid, String type) handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, ShoppingEntity entity) voidinitShoppings(String orgUid) update(ShoppingRequest request) Methods inherited from class com.bytedesk.core.base.BaseRestServiceWithExportqueryByOrgEntityMethods inherited from class com.bytedesk.core.base.BaseRestServicedeleteByOrgUid, findByOrgUid, getUidFromRequest, queryByOrg, queryByUid, queryByUser, recover, save, setUserUidToRequest
- 
Field Details- 
shoppingRepository
- 
modelMapperprivate final org.modelmapper.ModelMapper modelMapper
- 
uidUtils
 
- 
- 
Constructor Details- 
ShoppingRestServicepublic ShoppingRestService()
 
- 
- 
Method Details- 
createSpecificationprotected org.springframework.data.jpa.domain.Specification<ShoppingEntity> createSpecification(ShoppingRequest request) Description copied from class:BaseRestService创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
- createSpecificationin class- BaseRestService<ShoppingEntity,- ShoppingRequest, - ShoppingResponse> 
 
- 
executePageQueryprotected org.springframework.data.domain.Page<ShoppingEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<ShoppingEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
- executePageQueryin class- BaseRestService<ShoppingEntity,- ShoppingRequest, - ShoppingResponse> 
 
- 
findByUid@Cacheable(value="shopping", key="#uid", unless="#result==null") public Optional<ShoppingEntity> findByUid(String uid) - Specified by:
- findByUidin class- BaseRestService<ShoppingEntity,- ShoppingRequest, - ShoppingResponse> 
 
- 
findByNameAndOrgUidAndType@Cacheable(value="shopping", key="#name + \'_\' + #orgUid + \'_\' + #type", unless="#result==null") public Optional<ShoppingEntity> findByNameAndOrgUidAndType(String name, String orgUid, String type) 
- 
existsByUid
- 
create- Specified by:
- createin class- BaseRestService<ShoppingEntity,- ShoppingRequest, - ShoppingResponse> 
 
- 
update- Specified by:
- updatein class- BaseRestService<ShoppingEntity,- ShoppingRequest, - ShoppingResponse> 
 
- 
doSaveDescription copied from class:BaseRestService子类实现具体的保存逻辑- Specified by:
- doSavein class- BaseRestService<ShoppingEntity,- ShoppingRequest, - ShoppingResponse> 
 
- 
handleOptimisticLockingFailureExceptionpublic ShoppingEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, ShoppingEntity entity) - Specified by:
- handleOptimisticLockingFailureExceptionin class- BaseRestService<ShoppingEntity,- ShoppingRequest, - ShoppingResponse> 
 
- 
deleteByUid- Specified by:
- deleteByUidin class- BaseRestService<ShoppingEntity,- ShoppingRequest, - ShoppingResponse> 
 
- 
delete- Specified by:
- deletein class- BaseRestService<ShoppingEntity,- ShoppingRequest, - ShoppingResponse> 
 
- 
convertToResponse- Specified by:
- convertToResponsein class- BaseRestService<ShoppingEntity,- ShoppingRequest, - ShoppingResponse> 
 
- 
convertToExcelDescription copied from class:BaseRestServiceWithExport转换为Excel对象 子类必须实现此方法- Specified by:
- convertToExcelin class- BaseRestServiceWithExport<ShoppingEntity,- ShoppingRequest, - ShoppingResponse, - ShoppingExcel> 
 
- 
initShoppings
 
-