Skip to content

Commit

Permalink
fix :: post request fix class -> record
Browse files Browse the repository at this point in the history
  • Loading branch information
lgwk42 committed Jul 3, 2024
1 parent 8eccbbc commit 89c65c7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 61 deletions.
24 changes: 0 additions & 24 deletions src/main/java/com/project/qvick/domain/check/client/dto/Check.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ public Post postFind(Long postId) {

@Override
public void postEdit(PostEditRequest request){
Post post = postUtil.findPost(request.getPostId());
post.setTitle(request.getTitle());
post.setContent(request.getContent());
Post post = postUtil.findPost(request.postId());
post.setTitle(request.title());
post.setContent(request.content());
postRepository.save(postMapper.toEntity(post));
}

@Override
public void postDelete(PostDeleteRequest request){
postRepository.deleteById(request.getPostId());
postRepository.deleteById(request.postId());
}

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
package com.project.qvick.domain.post.client.dto.request;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class PostDeleteRequest {

private Long postId;

}
public record PostDeleteRequest(
Long postId
){}
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
package com.project.qvick.domain.post.client.dto.request;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class PostEditRequest {

private Long postId;
private String title;
private String content;

}
public record PostEditRequest(
Long postId,
String title,
String content
){}
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
package com.project.qvick.domain.post.client.dto.request;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class PostRegisterRequest {

private String title;
private String content;

}
public record PostRegisterRequest(
String title,
String content
){}

0 comments on commit 89c65c7

Please sign in to comment.