拆分模块
This commit is contained in:
32
server/src/main/java/com/ecep/contract/IEntityService.java
Normal file
32
server/src/main/java/com/ecep/contract/IEntityService.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package com.ecep.contract;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
|
||||
public interface IEntityService<T> {
|
||||
T findById(Integer id);
|
||||
|
||||
Page<T> findAll(Specification<T> spec, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 根据搜索文本构建了一个特定的规格化查询,以实现对实体模糊搜索
|
||||
*
|
||||
* @param searchText 要搜索的文本
|
||||
* @return 规格化查询
|
||||
*/
|
||||
Specification<T> getSpecification(String searchText);
|
||||
|
||||
/**
|
||||
* 根据搜索文本查询列表
|
||||
*/
|
||||
default List<T> search(String searchText) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
void delete(T entity);
|
||||
|
||||
T save(T entity);
|
||||
}
|
||||
Reference in New Issue
Block a user