@@ -4,6 +4,7 @@ import com.github.nenadjakic.eav.dto.AttributeValueAddRequest
4
4
import com.github.nenadjakic.eav.dto.AttributeValueResponse
5
5
import com.github.nenadjakic.eav.entity.AttributeValue
6
6
import com.github.nenadjakic.eav.extension.collectionMap
7
+ import com.github.nenadjakic.eav.service.AttributeService
7
8
import com.github.nenadjakic.eav.service.AttributeValueService
8
9
import io.swagger.v3.oas.annotations.Operation
9
10
import io.swagger.v3.oas.annotations.responses.ApiResponse
@@ -14,25 +15,27 @@ import org.modelmapper.ModelMapper
14
15
import org.springframework.http.ResponseEntity
15
16
import org.springframework.security.access.prepost.PreAuthorize
16
17
import org.springframework.validation.annotation.Validated
17
- import org.springframework.web.bind.annotation.DeleteMapping
18
- import org.springframework.web.bind.annotation.GetMapping
19
- import org.springframework.web.bind.annotation.PathVariable
20
- import org.springframework.web.bind.annotation.PostMapping
21
- import org.springframework.web.bind.annotation.PutMapping
22
- import org.springframework.web.bind.annotation.RequestBody
23
- import org.springframework.web.bind.annotation.RequestMapping
24
- import org.springframework.web.bind.annotation.RestController
18
+ import org.springframework.web.bind.WebDataBinder
19
+ import org.springframework.web.bind.annotation.*
25
20
import org.springframework.web.servlet.support.ServletUriComponentsBuilder
26
21
22
+
27
23
@Tag(name = " Attribute-value controller" , description = " API endpoints for managing values of attributes." )
28
24
@RestController
29
25
@RequestMapping(" /attribute-value" )
30
26
@Validated
31
27
open class AttributeValueController (
32
28
val modelMapper : ModelMapper ,
29
+ val attributeService : AttributeService ,
33
30
val attributeValueService : AttributeValueService
34
31
) {
35
32
33
+ // @InitBinder(value = ["attributeValueAddRequest"])
34
+ protected fun initBinder (binder : WebDataBinder ) {
35
+ // može i kao bean
36
+ // binder.addValidators(AttributeValueValidator(attributeService))
37
+ }
38
+
36
39
@Operation(
37
40
operationId = " findAttributeValueById" ,
38
41
summary = " Get attribute-value by id." ,
0 commit comments