Changeset 9dcbf44 for src/main/java/com/example/autopartz/service
- Timestamp:
- 01/06/23 19:17:05 (23 months ago)
- Branches:
- main
- Children:
- cab5859
- Parents:
- d4b888e
- Location:
- src/main/java/com/example/autopartz/service
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/autopartz/service/DeliveryService.java
rd4b888e r9dcbf44 3 3 import com.example.autopartz.model.Delivery; 4 4 import com.example.autopartz.model.Deliveryman; 5 import com.example.autopartz.model.Order; 5 6 6 7 import java.util.List; … … 8 9 public interface DeliveryService { 9 10 List<Delivery> findAllByDeliverer(Deliveryman dm); 11 Delivery findById(Integer id); 12 void update(Delivery d); 13 Delivery findByOrder(Order o); 10 14 } -
src/main/java/com/example/autopartz/service/impl/DeliveryServiceImpl.java
rd4b888e r9dcbf44 3 3 import com.example.autopartz.model.Delivery; 4 4 import com.example.autopartz.model.Deliveryman; 5 import com.example.autopartz.model.Order; 5 6 import com.example.autopartz.repository.DeliveryRepository; 6 7 import com.example.autopartz.service.DeliveryService; … … 21 22 return deliveryRepository.findAllByDeliveryman(dm); 22 23 } 24 25 @Override 26 public Delivery findById(Integer id) { 27 return deliveryRepository.findById(id).get(); 28 } 29 30 @Override 31 public void update(Delivery d) { 32 deliveryRepository.save(d); 33 } 34 35 @Override 36 public Delivery findByOrder(Order o) { 37 return deliveryRepository.findAllByOrder(o).stream().findFirst().orElseThrow(RuntimeException::new); 38 } 23 39 }
Note:
See TracChangeset
for help on using the changeset viewer.