Skip to content

Commit

Permalink
어노테이션 제외
Browse files Browse the repository at this point in the history
  • Loading branch information
nsa06035Prac committed Nov 22, 2023
1 parent d156911 commit 539bdae
Show file tree
Hide file tree
Showing 55 changed files with 575 additions and 51 deletions.
6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

129 changes: 129 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed 김진수/.gradle/8.4/checksums/checksums.lock
Binary file not shown.
Binary file removed 김진수/.gradle/8.4/checksums/md5-checksums.bin
Binary file not shown.
Binary file removed 김진수/.gradle/8.4/checksums/sha1-checksums.bin
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file removed 김진수/.gradle/8.4/fileChanges/last-build.bin
Binary file not shown.
Binary file removed 김진수/.gradle/8.4/fileHashes/fileHashes.bin
Binary file not shown.
Binary file removed 김진수/.gradle/8.4/fileHashes/fileHashes.lock
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
2 changes: 0 additions & 2 deletions 김진수/.gradle/buildOutputCleanup/cache.properties

This file was deleted.

Binary file removed 김진수/.gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file removed 김진수/.gradle/file-system.probe
Binary file not shown.
Empty file.
2 changes: 2 additions & 0 deletions 김진수/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-devtools'
implementation 'org.springframework.boot:spring-boot-starter-validation'

implementation 'org.mapstruct:mapstruct:1.4.2.Final'

implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'

compileOnly 'org.projectlombok:lombok'
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
//@RequiredArgsConstructor
@RequestMapping("/api/comments")
public class CommentController {

private final CommentService commentService;

// 생성자 주입 사용
public CommentController(CommentService commentService) {
this.commentService = commentService;
}

// postId, memberId를 dto로 받으면 어떨까?
// memberId가 DB에 없는 상황이라면 throw로 예외를 발생시키는게 맞는지?
// 아니면
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
//@RequiredArgsConstructor
@RequestMapping("/api/members")
public class MemberController {

private final MemberService memberService;

// 생성자 주입 사용
public MemberController(MemberService memberService) {
this.memberService = memberService;
}

/**
* 회원 가입
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@
import java.util.List;

@RestController
@RequiredArgsConstructor
//@RequiredArgsConstructor
@RequestMapping("/api/posts")
public class PostController {

private final PostService postService;

// 생성자 주입 사용
public PostController(PostService postService) {
this.postService = postService;
}

/**
* 게시글 작성
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import lombok.Setter;

@Entity
@Getter @Setter
@NoArgsConstructor
//@Getter @Setter
//@NoArgsConstructor
public class Comment {

@Id @GeneratedValue
Expand All @@ -22,16 +22,56 @@ public class Comment {
@JoinColumn(name = "postId")
private Post post; // 게시글

@Column(nullable = false)
private String author;

@Column(nullable = false)
private String comments;

public Comment(final String comments, final String author, final Post post, final Member member) {
public Comment(final String comments, final Post post, final Member member) {
this.comments = comments;
this.author = author;
this.post = post;
this.member = member;
}

// 기본 생성자
public Comment() {
}

// id의 Getter
public Long getId() {
return id;
}

// id의 Setter
public void setId(Long id) {
this.id = id;
}

// member의 Getter
public Member getMember() {
return member;
}

// member의 Setter
public void setMember(Member member) {
this.member = member;
}

// post의 Getter
public Post getPost() {
return post;
}

// post의 Setter
public void setPost(Post post) {
this.post = post;
}

// comments의 Getter
public String getComments() {
return comments;
}

// comments의 Setter
public void setComments(String comments) {
this.comments = comments;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import java.util.List;

@Entity
@Getter @Setter
@NoArgsConstructor
//@Getter @Setter
//@NoArgsConstructor
public class Member {

@Id
Expand Down Expand Up @@ -38,4 +38,56 @@ public Member(final String email, final String password, final String nickname)
this.password = password;
this.nickname = nickname;
}

public Member() {
// 기본 생성자
}

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getEmail() {
return email;
}

public void setEmail(String email) {
this.email = email;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

public String getNickname() {
return nickname;
}

public void setNickname(String nickname) {
this.nickname = nickname;
}

public List<Post> getPosts() {
return posts;
}

public void setPosts(List<Post> posts) {
this.posts = posts;
}

public List<Comment> getComments() {
return comments;
}

public void setComments(List<Comment> comments) {
this.comments = comments;
}
}
Loading

0 comments on commit 539bdae

Please sign in to comment.