Refactor code

This commit is contained in:
Sergey Shkurov
2023-04-27 20:44:27 +02:00
parent 79315c3c18
commit 8bbd135e96
8 changed files with 54 additions and 59 deletions

View File

@@ -1,13 +1,18 @@
package ru.serega6531.packmate.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import ru.serega6531.packmate.model.CtfService;
import ru.serega6531.packmate.model.pojo.ServiceDto;
import ru.serega6531.packmate.service.ServicesService;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/api/service/")
@@ -24,7 +29,7 @@ public class ServiceController {
public List<ServiceDto> getServices() {
return service.findAll().stream()
.map(service::toDto)
.collect(Collectors.toList());
.toList();
}
@DeleteMapping("/{port}")