Skip to content

Commit

Permalink
Refector: Post API
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeg00 committed Oct 28, 2023
1 parent c8a5285 commit 81843a1
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/main/java/com/example/just/Dto/PostPostDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.example.just.Dto;

import com.example.just.Dao.Comment;
import com.example.just.Dao.Member;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
@NoArgsConstructor

public class PostPostDto {
private String post_content; //글 내용

private String post_tag; //글 태그

private Long post_picture;

@JsonIgnore
private Timestamp post_create_time; //글 생성 시간

private boolean secret; //글 공개 여부


private String emoticon; //글 이모티콘


private String post_category; //글 카테고리

@JsonIgnore
private List<Member> likedMembers = new ArrayList<>();

@JsonIgnore // Swagger에 postDto만 넘기려고
private Member member; //글을쓴 Member_id

@JsonIgnore
private List<Comment> comments;


public boolean getSecret() {
return this.secret;
}
}
54 changes: 54 additions & 0 deletions src/main/java/com/example/just/Dto/PutPostDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.example.just.Dto;

import com.example.just.Dao.Comment;
import com.example.just.Dao.Member;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

/*
//
*/
@Getter
@Setter
@NoArgsConstructor

public class PutPostDto {
private Long post_id;

private String post_content; //글 내용

private String post_tag; //글 태그

private Long post_picture;

@JsonIgnore
private Timestamp post_create_time; //글 생성 시간

private boolean secret; //글 공개 여부


private String emoticon; //글 이모티콘


private String post_category; //글 카테고리

@JsonIgnore
private List<Member> likedMembers = new ArrayList<>();

@JsonIgnore // Swagger에 postDto만 넘기려고
private Member member; //글을쓴 Member_id

@JsonIgnore
private List<Comment> comments;


public boolean getSecret() {
return this.secret;
}
}

0 comments on commit 81843a1

Please sign in to comment.