refactor(service): 移除冗余的getById方法
多个服务类中移除了重复的getById方法实现
This commit is contained in:
@@ -102,10 +102,7 @@ public class CloudRkService extends EntityService<CloudRk, CloudRkVo, Integer>
|
|||||||
return cloudRKRepository;
|
return cloudRKRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public CloudRk getById(Integer id) {
|
|
||||||
return super.getById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Cacheable(key = "#p0")
|
@Cacheable(key = "#p0")
|
||||||
public CloudRkVo findById(Integer id) {
|
public CloudRkVo findById(Integer id) {
|
||||||
|
|||||||
@@ -47,10 +47,7 @@ public class ContractCatalogService extends EntityService<ContractCatalog, Contr
|
|||||||
return repository.findById(id).map(ContractCatalog::toVo).orElse(null);
|
return repository.findById(id).map(ContractCatalog::toVo).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ContractCatalog getById(Integer id) {
|
|
||||||
return repository.findById(id).orElse(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ContractCatalog findByName(String name) {
|
public ContractCatalog findByName(String name) {
|
||||||
return repository.findByName(name).orElse(null);
|
return repository.findByName(name).orElse(null);
|
||||||
|
|||||||
@@ -52,10 +52,7 @@ public class SaleOrdersService extends EntityService<SalesOrder, SalesOrderVo, I
|
|||||||
return new SalesOrder();
|
return new SalesOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SalesOrder getById(Integer id) {
|
|
||||||
return repository.findById(id).orElse(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Cacheable(key = "#p0")
|
@Cacheable(key = "#p0")
|
||||||
public SalesOrderVo findById(Integer id) {
|
public SalesOrderVo findById(Integer id) {
|
||||||
|
|||||||
@@ -70,9 +70,7 @@ public class InventoryService extends EntityService<Inventory, InventoryVo, Inte
|
|||||||
return inventoryRepository.findById(id).map(Inventory::toVo).orElse(null);
|
return inventoryRepository.findById(id).map(Inventory::toVo).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Inventory getById(Integer id) {
|
|
||||||
return inventoryRepository.findById(id).orElse(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<Inventory> findAll(Specification<Inventory> spec, Pageable pageable) {
|
public Page<Inventory> findAll(Specification<Inventory> spec, Pageable pageable) {
|
||||||
|
|||||||
@@ -104,9 +104,7 @@ public class ProjectService extends EntityService<Project, ProjectVo, Integer>
|
|||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Project getById(Integer id) {
|
|
||||||
return projectRepository.findById(id).orElse(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Cacheable(key = "#p0")
|
@Cacheable(key = "#p0")
|
||||||
public ProjectVo findById(Integer id) {
|
public ProjectVo findById(Integer id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user