Выбор сервиса в паттернах

This commit is contained in:
serega6531
2021-01-12 22:32:10 +03:00
parent 8c752f1d44
commit f5dc4b7b6f
7 changed files with 26 additions and 12 deletions

View File

@@ -31,16 +31,18 @@ public class ServicesService {
private final InetAddress localIp;
private final Map<Integer, CtfService> services = new HashMap<>();
private final ModelMapper modelMapper = new ModelMapper();
private final ModelMapper modelMapper;
@Autowired
public ServicesService(ServiceRepository repository,
SubscriptionService subscriptionService,
@Lazy PcapService pcapService,
ModelMapper modelMapper,
@Value("${local-ip}") String localIpString) throws UnknownHostException {
this.repository = repository;
this.subscriptionService = subscriptionService;
this.pcapService = pcapService;
this.modelMapper = modelMapper;
this.localIp = InetAddress.getByName(localIpString);
repository.findAll().forEach(s -> services.put(s.getPort(), s));