add files for 1st practical (not working yet)
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
package ua.com.dxrkness.model;
|
||||||
|
|
||||||
|
public record Freight() {
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package ua.com.dxrkness.model;
|
||||||
|
|
||||||
|
public record Route() {
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package ua.com.dxrkness.model;
|
||||||
|
|
||||||
|
public record Vehicle() {
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package ua.com.dxrkness.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import ua.com.dxrkness.model.Freight;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class FreightService {
|
||||||
|
public List<Freight> getAll() { }
|
||||||
|
public Freight add(Freight freight) { }
|
||||||
|
public Optional<Freight> getById(long id) { }
|
||||||
|
public Freight update(long id, Freight newFreight) { }
|
||||||
|
public Freight delete(long id) { }
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package ua.com.dxrkness.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import ua.com.dxrkness.model.Route;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class RouteService {
|
||||||
|
public List<Route> getAll() { }
|
||||||
|
public Optional<Route> getById(long id) { }
|
||||||
|
public Route add(Route route) { }
|
||||||
|
public Route getByFreightId(long freightId) { }
|
||||||
|
public Route getByVehicleId(long vehicleId) { }
|
||||||
|
public Route update(long id, Route newRoute) { }
|
||||||
|
public Route delete(long id) { }
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package ua.com.dxrkness.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import ua.com.dxrkness.model.Vehicle;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class VehicleService {
|
||||||
|
public List<Vehicle> getAll() { }
|
||||||
|
|
||||||
|
public Vehicle add(Vehicle veh) { }
|
||||||
|
|
||||||
|
public Optional<Vehicle> getById(long id) { }
|
||||||
|
|
||||||
|
public Vehicle update(long id, Vehicle newVehicle) { }
|
||||||
|
|
||||||
|
public Vehicle delete(long id) { }
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user