Skip to content

Commit

Permalink
feat: swagger test를 위한 api 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
junseokkim committed Jan 6, 2024
1 parent 91ad339 commit 0682fc3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ out/
### VS Code ###
.vscode/

.env
application.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
package com.umc.networkingService.domain.test.controller;

import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "예제 API", description = "Swagger 테스트용 API")
@RestController
@RequiredArgsConstructor
@RequestMapping("/test")
public class TestController {
@Operation(summary = "문자열 반복", description = "파라미터로 받은 문자열을 2번 반복합니다.")
@Parameter(name = "str", description = "2번 반복할 문자열")
@GetMapping("/returnStr")
public String returnStr(@RequestParam String str) {
return str + "\n" + str;
}

@GetMapping("/example")
public String example() {
return "예시 API";
}

@GetMapping
public String getTest() {
return "kimjunseok";
@Hidden
@GetMapping("/ignore")
public String ignore() {
return "무시되는 API";
}
}
}

0 comments on commit 0682fc3

Please sign in to comment.