Skip to content

Commit

Permalink
fix: path variable 롤백
Browse files Browse the repository at this point in the history
  • Loading branch information
mangowhoiscloud committed Nov 12, 2024
1 parent 9308759 commit 9c97c34
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 24 deletions.
2 changes: 1 addition & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ backend/src/main/resources/application.yml
### VS Code ###
.vscode/

### log ###
### log ###
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public ResponseEntity<DataResponse<Void>> deleteMember(@RequestBody DeleteMember

@GetMapping("/profile/presigned/{filename}")
public ResponseEntity<DataResponse<CreatePresignedUrlResponse>> createProfileImagePreSignedUrl(
@Valid @PathVariable("filename") CreatePresignedUrlRequest createPresignedUrlRequest) {
@Valid @PathVariable("filename") String filename) {
CreatePresignedUrlRequest createPresignedUrlRequest = CreatePresignedUrlRequest.of(filename);
return ResponseEntity.status(HttpStatus.CREATED)
.body(DataResponse.created(s3Service.createProfilePresignedUrl(createPresignedUrlRequest)));
}
Expand Down Expand Up @@ -133,7 +134,8 @@ public ResponseEntity<DataResponse<Void>> sendTemporaryPassword(

@GetMapping("/nickname/{nickname}/exists")
public ResponseEntity<DataResponse<NicknameExistsResponse>> checkNicknameExists(
@PathVariable("nickname")CheckNicknameExistsRequest request) {
@PathVariable("nickname") String nickname) {
CheckNicknameExistsRequest request = CheckNicknameExistsRequest.of(nickname);
NicknameExistsResponse exist = NicknameExistsResponse.of(memberService.checkNicknameExists(request));
return ResponseEntity.status(HttpStatus.OK).body(DataResponse.from(exist));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,22 @@ public ResponseEntity<DataResponse<Page<FindPostsByPostTypeResponse>>> findPosts

@GetMapping("/{postId}")
public ResponseEntity<DataResponse<FindPostAndCommentsByIdResponse>> findPostAndComments(
@PathVariable("postId") FindPostAndCommentsRequest request) {
@PathVariable("postId") Long postId) {
Long memberId = MemberLoader.getMemberId();
FindPostAndCommentsByIdParameter parameter = FindPostAndCommentsByIdParameter.of(memberId, request.postId());
FindPostAndCommentsByIdParameter parameter = FindPostAndCommentsByIdParameter.of(memberId, postId);
return ResponseEntity.ok(DataResponse.from(postMemberService.findPostAndCommentsDtoById(parameter)));
}

@GetMapping("/{postId}/judgement")
public ResponseEntity<DataResponse<FindJudgementResponse>> findJudgement(
@PathVariable("postId") FindJudgementRequest request) {
return ResponseEntity.ok(DataResponse.from(postService.findJudgementBy(request.postId())));
@PathVariable("postId") Long postId) {
return ResponseEntity.ok(DataResponse.from(postService.findJudgementBy(postId)));
}

@DeleteMapping("/{postId}")
public ResponseEntity<DataResponse<Void>> deletePost(@PathVariable("postId") DeletePostRequest request) {
public ResponseEntity<DataResponse<Void>> deletePost(@PathVariable("postId") Long postId) {
Long memberId = MemberLoader.getMemberId();
DeletePostParameter parameter = DeletePostParameter.of(memberId, request.postId());
DeletePostParameter parameter = DeletePostParameter.of(memberId, postId);
postService.deletePostBy(parameter);
return ResponseEntity.ok(DataResponse.noContent());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,11 @@
import aimo.backend.common.dto.DataResponse;

import aimo.backend.common.util.memberLoader.MemberLoader;
import aimo.backend.domains.privatePost.dto.parameter.ChatRecordParameter;
import aimo.backend.domains.privatePost.dto.parameter.DeletePrivatePostParameter;
import aimo.backend.domains.privatePost.dto.parameter.FindPrivatePostParameter;
import aimo.backend.domains.privatePost.dto.parameter.FindPrivatePostPreviewParameter;
import aimo.backend.domains.privatePost.dto.parameter.SpeechToTextParameter;
import aimo.backend.domains.privatePost.dto.parameter.TextRecordParameter;
import aimo.backend.domains.privatePost.dto.request.DeletePrivatePostRequest;
import aimo.backend.domains.privatePost.dto.request.FindPrivatePostRequest;
import aimo.backend.domains.privatePost.dto.parameter.JudgementParameter;
import aimo.backend.domains.privatePost.dto.parameter.JudgementToAiParameter;
import aimo.backend.domains.privatePost.dto.request.ChatRecordRequest;
import aimo.backend.domains.privatePost.dto.request.JudgementToAiRequest;
import aimo.backend.domains.privatePost.dto.response.JudgementResponse;
import aimo.backend.domains.privatePost.dto.response.PrivatePostPreviewResponse;
import aimo.backend.domains.privatePost.dto.response.PrivatePostResponse;
import aimo.backend.domains.privatePost.dto.request.SaveAudioSuccessRequest;
Expand All @@ -43,10 +35,8 @@
import aimo.backend.domains.privatePost.dto.response.SpeechToTextResponse;

import aimo.backend.domains.privatePost.dto.request.TextRecordRequest;
import aimo.backend.domains.privatePost.entity.ChatRecord;
import aimo.backend.domains.privatePost.model.OriginType;
import aimo.backend.domains.privatePost.service.AudioRecordService;
import aimo.backend.domains.privatePost.service.ChatRecordService;
import aimo.backend.domains.privatePost.service.PrivatePostMemberService;

import aimo.backend.domains.privatePost.service.SaveAudioSuccessParameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public class ViewController {

@PostMapping("/{postId}/views")
public ResponseEntity<DataResponse<Void>> increasePostView(
@PathVariable("postId")IncreasePostViewRequest request) {
@PathVariable("postId")Long postId) {
Long memberId = MemberLoader.getMemberId();
IncreasePostViewParameter increasePostViewParameter =
IncreasePostViewParameter.of(memberId, request.postId());
IncreasePostViewParameter.of(memberId, postId);
postViewMemberService.increasePostViewBy(increasePostViewParameter);
return ResponseEntity
.status(HttpStatus.CREATED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public class VoteController {

@PostMapping("/{postId}/votes")
public ResponseEntity<DataResponse<Void>> saveVotePost(
@PathVariable SaveVotePostRequest request,
@PathVariable Long postId,
@RequestParam("side") Side side
) {
Long memberId = MemberLoader.getMemberId();
SaveVotePostParameter saveVotePostParameter =
SaveVotePostParameter.of(memberId, request.postId(), side);
SaveVotePostParameter.of(memberId, postId, side);
voteService.votePost(saveVotePostParameter);
return ResponseEntity.status(HttpStatus.CREATED).body(DataResponse.created());
}
Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- 로그 파일에 로그를 출력하는 설정 -->
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>~/build/libs/backend-server-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<fileNamePattern>build/libs/backend-server-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>10MB</maxFileSize>
<maxHistory>30</maxHistory>
<totalSizeCap>1GB</totalSizeCap>
Expand Down

0 comments on commit 9c97c34

Please sign in to comment.