/
Sturon
/
Diplom
Обзор
Документация
Войти
/
Sturon
/
Diplom
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
backend/src/main/java/ru/diplom/vision/api/LocalInspectionController.java
37 строк
2 KB
Sturon
Initial
03 июн 2026, 15:01
03 июн 2026, 15:01
17b44a2
Код
Авторство
О чём код?
package ru.diplom.vision.api; import jakarta.validation.Valid; import org.springframework.http.MediaType; 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.RequestPart; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import ru.diplom.vision.api.dto.LocalInspectionRequest; import ru.diplom.vision.api.dto.LocalInspectionResponse; import ru.diplom.vision.service.LocalInspectionService; @RestController @RequestMapping("/api/local-inspections") public class LocalInspectionController { private final LocalInspectionService localInspectionService; public LocalInspectionController(LocalInspectionService localInspectionService) { this.localInspectionService = localInspectionService; } @PostMapping(value = "/evaluate", consumes = MediaType.APPLICATION_JSON_VALUE) public LocalInspectionResponse evaluate(@Valid @RequestBody LocalInspectionRequest request) { return localInspectionService.evaluate(request, null); } @PostMapping(value = "/evaluate", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public LocalInspectionResponse evaluate( @Valid @RequestPart("parameters") LocalInspectionRequest request, @RequestPart(value = "image", required = false) MultipartFile image ) { return localInspectionService.evaluate(request, image); } }