Remove scheduler, add hwt sergeant :)

This commit is contained in:
anibus
2026-10-03 19:42:37 +03:00
parent 97ea7313b8
commit e4c6ee6a29
6 changed files with 62 additions and 53 deletions
@@ -0,0 +1,31 @@
package com.dowstats.controllers.instruments
import com.dowstats.data.dto.controllers.instruments.RgdNodeDto
import com.dowstats.data.dto.controllers.instruments.toRgdNodeDto
import com.dowstats.service.w40k.RgdParserService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.http.MediaType
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController
import org.springframework.web.multipart.MultipartFile
import java.io.DataInputStream
@RestController
@RequestMapping("api/v1/instruments/rgd")
class RgdTreeController @Autowired constructor(
val rgdParserService: RgdParserService,
) {
@PostMapping(
value = ["/tree"],
consumes = [MediaType.MULTIPART_FORM_DATA_VALUE],
produces = [MediaType.APPLICATION_JSON_VALUE],
)
fun parseRgdToTree(@RequestParam("file") file: MultipartFile): List<RgdNodeDto> {
return file.inputStream.use { input ->
rgdParserService.parseRgdFileStream(DataInputStream(input))
}.map { it.toRgdNodeDto() }
}
}