Skip to content

Commit c9e1e40

Browse files
committed
[EA3-206] PR 템플릿 응답값 ResponseEntity로 수정
1 parent 94d96a5 commit c9e1e40

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/main/java/grep/neogulcoder/domain/prtemplate/controller/PrTemplateController.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ public ResponseEntity<ApiResponse<PrPageResponse>> get(@AuthenticationPrincipal
3232
}
3333

3434
@GetMapping("/{userid}")
35-
public ApiResponse<PrPageResponse> get(@PathVariable("userid") Long userId) {
35+
public ResponseEntity<ApiResponse<PrPageResponse>> get(@PathVariable("userid") Long userId) {
3636
PrPageResponse prPageResponse = prTemplateService.toResponse(userId);
37-
return ApiResponse.success(prPageResponse);
37+
return ResponseEntity.ok(ApiResponse.success(prPageResponse));
3838
}
3939

4040
@PutMapping("/update/template")
41-
public ApiResponse<Void> update(@AuthenticationPrincipal Principal principal,
41+
public ResponseEntity<ApiResponse<Void>> update(@AuthenticationPrincipal Principal principal,
4242
@RequestBody PrUpdateRequest request) {
4343
prTemplateService.update(principal.getUserId(), request.getLocation());
4444
linkService.update(principal.getUserId(), request.getPrUrls());
45-
return ApiResponse.noContent();
45+
return ResponseEntity.ok(ApiResponse.noContent());
4646
}
4747

4848
@PutMapping("/update/introduction")
49-
public ApiResponse<Void> updateIntroduction(@AuthenticationPrincipal Principal principal,
49+
public ResponseEntity<ApiResponse<Void>> updateIntroduction(@AuthenticationPrincipal Principal principal,
5050
@RequestBody IntroductionUpdateRequest request) {
5151
prTemplateService.updateIntroduction(principal.getUserId(), request.getIntroduction());
52-
return ApiResponse.noContent();
52+
return ResponseEntity.ok(ApiResponse.noContent());
5353
}
5454
}

src/main/java/grep/neogulcoder/domain/prtemplate/controller/PrTemplateSpecification.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import io.swagger.v3.oas.annotations.tags.Tag;
1010
import org.springframework.http.ResponseEntity;
1111
import org.springframework.security.core.annotation.AuthenticationPrincipal;
12+
import org.springframework.web.bind.annotation.PathVariable;
1213
import org.springframework.web.bind.annotation.RequestBody;
1314

1415
@Tag(name = "PR_Template", description = "PR 템플릿 API")
@@ -17,10 +18,13 @@ public interface PrTemplateSpecification {
1718
@Operation(summary = "PR 템플릿 조회", description = "PR 템플릿을 조회합니다.")
1819
ResponseEntity<ApiResponse<PrPageResponse>> get(@AuthenticationPrincipal Principal principal);
1920

21+
@Operation(summary = "타인 PR 템플릿 조회", description = "회원 ID를 통해 PR 템플릿을 조회합니다.")
22+
ResponseEntity<ApiResponse<PrPageResponse>> get(@PathVariable("userid") Long userId);
23+
2024
@Operation(summary = "PR 정보 수정", description = "PR 정보를 수정합니다.")
21-
ApiResponse<Void> update(@AuthenticationPrincipal Principal principal, @RequestBody PrUpdateRequest request);
25+
ResponseEntity<ApiResponse<Void>> update(@AuthenticationPrincipal Principal principal, @RequestBody PrUpdateRequest request);
2226

2327
@Operation(summary = "PR 소개글 수정", description = "PR 소개글을 수정합니다.")
24-
ApiResponse<Void> updateIntroduction(@AuthenticationPrincipal Principal principal, @RequestBody IntroductionUpdateRequest request);
28+
ResponseEntity<ApiResponse<Void>> updateIntroduction(@AuthenticationPrincipal Principal principal, @RequestBody IntroductionUpdateRequest request);
2529

2630
}

0 commit comments

Comments
 (0)