package com.dowstats.controllers

import com.dowstats.service.w40k.IconsService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController


@RestController
@RequestMapping("api/v1/grapics")
class AssetsController @Autowired constructor(
    val iconService: IconsService,
) {

    @GetMapping("/icon/{modName}/{raceIconFolder}/{imageName}")
    fun getUnits(
        @PathVariable modName: String,
        @PathVariable raceIconFolder: String,
                 @PathVariable imageName: String,): ByteArray? {
        return iconService.returnIcon(modName, raceIconFolder, imageName)
    }
}