Skip to content

Commit cac1ba2

Browse files
committed
refactor(import): update controller title of swagger, and rename
controller[backend][frontend]
1 parent a890002 commit cac1ba2

File tree

11 files changed

+23
-6
lines changed

11 files changed

+23
-6
lines changed

backend/src/main/java/heartbeat/controller/HealthController.java

+3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
import org.springframework.web.bind.annotation.RequestMapping;
88
import org.springframework.web.bind.annotation.RestController;
99

10+
import io.swagger.v3.oas.annotations.tags.Tag;
11+
1012
@RestController
13+
@Tag(name = "Health")
1114
@RequestMapping("/health")
1215
@RequiredArgsConstructor
1316
public class HealthController {

backend/src/main/java/heartbeat/controller/board/JiraController.java backend/src/main/java/heartbeat/controller/board/BoardController.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import heartbeat.controller.board.dto.response.JiraVerifyResponse;
88
import heartbeat.exception.BadRequestException;
99
import heartbeat.service.board.jira.JiraService;
10+
import io.swagger.v3.oas.annotations.tags.Tag;
1011
import jakarta.validation.Valid;
1112
import jakarta.validation.constraints.NotBlank;
1213
import lombok.RequiredArgsConstructor;
@@ -18,8 +19,9 @@
1819

1920
@RestController
2021
@RequiredArgsConstructor
22+
@Tag(name = "Board")
2123
@RequestMapping("/boards")
22-
public class JiraController {
24+
public class BoardController {
2325

2426
private final JiraService jiraService;
2527

backend/src/main/java/heartbeat/controller/crypto/CryptoController.java

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import heartbeat.controller.crypto.response.DecryptResponse;
66
import heartbeat.controller.crypto.response.EncryptResponse;
77
import heartbeat.service.crypto.EncryptDecryptService;
8+
import io.swagger.v3.oas.annotations.tags.Tag;
89
import lombok.RequiredArgsConstructor;
910
import lombok.extern.log4j.Log4j2;
1011
import org.springframework.validation.annotation.Validated;
@@ -14,6 +15,7 @@
1415

1516
@Log4j2
1617
@RestController
18+
@Tag(name = "Crypto")
1719
@RequiredArgsConstructor
1820
public class CryptoController {
1921

backend/src/main/java/heartbeat/controller/pipeline/PipelineController.java

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import heartbeat.controller.pipeline.dto.response.BuildKiteResponseDTO;
77
import heartbeat.controller.pipeline.dto.response.PipelineStepsDTO;
88
import heartbeat.service.pipeline.buildkite.BuildKiteService;
9+
import io.swagger.v3.oas.annotations.tags.Tag;
910
import jakarta.validation.Valid;
1011
import jakarta.validation.constraints.NotBlank;
1112
import lombok.RequiredArgsConstructor;
@@ -23,6 +24,7 @@
2324

2425
@RestController
2526
@RequiredArgsConstructor
27+
@Tag(name = "Pipeline")
2628
@RequestMapping("/pipelines")
2729
@Validated
2830
@Log4j2

backend/src/main/java/heartbeat/controller/report/ReportController.java

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import heartbeat.service.report.GenerateReporterService;
99
import heartbeat.service.report.ReportService;
1010
import io.swagger.v3.oas.annotations.media.Schema;
11+
import io.swagger.v3.oas.annotations.tags.Tag;
1112
import lombok.RequiredArgsConstructor;
1213
import lombok.extern.log4j.Log4j2;
1314
import org.springframework.beans.factory.annotation.Value;
@@ -26,6 +27,7 @@
2627

2728
@RestController
2829
@RequiredArgsConstructor
30+
@Tag(name = "Report")
2931
@RequestMapping("/reports")
3032
@Validated
3133
@Log4j2

backend/src/main/java/heartbeat/controller/source/GithubController.java backend/src/main/java/heartbeat/controller/source/SourceController.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import heartbeat.controller.source.dto.SourceControlDTO;
55
import heartbeat.controller.source.dto.VerifyBranchRequest;
66
import heartbeat.service.source.github.GitHubService;
7+
import io.swagger.v3.oas.annotations.tags.Tag;
78
import jakarta.validation.Valid;
89
import lombok.RequiredArgsConstructor;
910
import lombok.extern.log4j.Log4j2;
@@ -21,10 +22,11 @@
2122

2223
@RestController
2324
@RequiredArgsConstructor
25+
@Tag(name = "Source Control")
2426
@RequestMapping("/source-control")
2527
@Validated
2628
@Log4j2
27-
public class GithubController {
29+
public class SourceController {
2830

2931
public static final String TOKEN_PATTER = "^(ghp|gho|ghu|ghs|ghr)_([a-zA-Z0-9]{36})$";
3032

backend/src/main/java/heartbeat/controller/source/dto/SourceControlDTO.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import lombok.NoArgsConstructor;
99
import lombok.Setter;
1010

11-
import static heartbeat.controller.source.GithubController.TOKEN_PATTER;
11+
import static heartbeat.controller.source.SourceController.TOKEN_PATTER;
1212

1313
@Builder
1414
@NoArgsConstructor

backend/src/main/java/heartbeat/controller/source/dto/VerifyBranchRequest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import lombok.NoArgsConstructor;
1010
import lombok.Setter;
1111

12-
import static heartbeat.controller.source.GithubController.TOKEN_PATTER;
12+
import static heartbeat.controller.source.SourceController.TOKEN_PATTER;
1313

1414
@Builder
1515
@NoArgsConstructor

backend/src/main/java/heartbeat/controller/version/VersionController.java

+4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
import org.springframework.web.bind.annotation.GetMapping;
88
import org.springframework.web.bind.annotation.RequestMapping;
99
import org.springframework.web.bind.annotation.RestController;
10+
11+
import io.swagger.v3.oas.annotations.tags.Tag;
12+
1013
import org.springframework.beans.factory.annotation.Value;
1114

1215
import java.util.HashMap;
1316
import java.util.Map;
1417

1518
@RestController
1619
@RequiredArgsConstructor
20+
@Tag(name = "Version")
1721
@RequestMapping("/version")
1822
@Validated
1923
@Log4j2

backend/src/test/java/heartbeat/controller/board/JiraControllerTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.springframework.test.context.junit.jupiter.SpringExtension;
2929
import org.springframework.test.web.servlet.MockMvc;
3030

31-
@WebMvcTest(JiraController.class)
31+
@WebMvcTest(BoardController.class)
3232
@ExtendWith(SpringExtension.class)
3333
@AutoConfigureJsonTesters
3434
public class JiraControllerTest {

backend/src/test/java/heartbeat/controller/source/GithubControllerTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
3535
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
3636

37-
@WebMvcTest(GithubController.class)
37+
@WebMvcTest(SourceController.class)
3838
@ExtendWith(SpringExtension.class)
3939
@AutoConfigureJsonTesters
4040
class GithubControllerTest {

0 commit comments

Comments
 (0)