From 6aa4fe2f70d0a3ffae2b3a4164f4f168d2a033ba Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Mon, 4 Nov 2024 09:51:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20ex?= =?UTF-8?q?ample?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/swagger/controller/PointController.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/sadtech/example/swagger/controller/PointController.java b/src/main/java/org/sadtech/example/swagger/controller/PointController.java index f710c60..734b1d1 100644 --- a/src/main/java/org/sadtech/example/swagger/controller/PointController.java +++ b/src/main/java/org/sadtech/example/swagger/controller/PointController.java @@ -2,15 +2,18 @@ package org.sadtech.example.swagger.controller; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.constraints.Min; import jakarta.validation.constraints.NotBlank; import org.sadtech.example.swagger.dto.TypeOperation; import org.sadtech.example.swagger.dto.UserDto; +import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -36,8 +39,8 @@ public class PointController { @Operation(summary = "Управление баллами", description = "Позволяет удалить или добавить баллы пользователю") public HttpStatus changePoints( @PathVariable @NotBlank @Parameter(description = "Идентификатор пользователя") String key, - @RequestParam("point") @Min(0) @Parameter(description = "Количество баллов", required = true) Long point, - @RequestParam("type") @Parameter(description = "Тип операции", required = true) TypeOperation type + @RequestParam("point") @Min(0) @Parameter(description = "Количество баллов", required = true, example = "100") Long point, + @RequestParam("type") @Parameter(description = "Тип операции", required = true, example = "PLUS") TypeOperation type ) { final UserDto userDto = repository.get(key); userDto.setPoints(