Добавлены классы для пакетов и паттернов
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package ru.serega6531.packmate.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class PacketService {
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package ru.serega6531.packmate.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import ru.serega6531.packmate.model.Pattern;
|
||||
import ru.serega6531.packmate.repository.PatternRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class PatternService {
|
||||
|
||||
private final PatternRepository repository;
|
||||
|
||||
@Autowired
|
||||
public PatternService(PatternRepository repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
|
||||
public List<Pattern> findAll() {
|
||||
return repository.findAll();
|
||||
}
|
||||
|
||||
public void deleteById(int id) {
|
||||
repository.deleteById(id);
|
||||
}
|
||||
|
||||
public Pattern save(Pattern service) {
|
||||
return repository.save(service);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package ru.serega6531.packmate.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import ru.serega6531.packmate.model.CtfService;
|
||||
import ru.serega6531.packmate.repository.ServiceRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ServicesService {
|
||||
|
||||
private final ServiceRepository repository;
|
||||
|
||||
@Autowired
|
||||
public ServicesService(ServiceRepository repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
|
||||
public List<CtfService> findAll() {
|
||||
return repository.findAll();
|
||||
}
|
||||
|
||||
public void deleteById(int id) {
|
||||
repository.deleteById(id);
|
||||
}
|
||||
|
||||
public CtfService save(CtfService service) {
|
||||
return repository.save(service);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package ru.serega6531.packmate.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import ru.serega6531.packmate.model.Stream;
|
||||
import ru.serega6531.packmate.repository.StreamRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class StreamService {
|
||||
|
||||
private final StreamRepository repository;
|
||||
|
||||
@Autowired
|
||||
public StreamService(StreamRepository repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
|
||||
public List<Stream> findAll() {
|
||||
return repository.findAll();
|
||||
}
|
||||
|
||||
public List<Stream> findAllByServicePort(int port) {
|
||||
return repository.findAllByService_Port(port);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user