Class Post
- java.lang.Object
-
- com.restapi.template.api.common.Date
-
- com.restapi.template.api.community.post.data.Post
-
@Entity public class Post extends Date
게시글 엔터티.- Version:
- 1.0
- Author:
- always0ne
-
-
Field Summary
Fields Modifier and Type Field Description private Usersauthor작성자.private java.lang.Stringbody본문.private java.lang.LongcommentNum댓글수.private java.util.List<Comment>comments댓글들.private java.lang.LongpostIdpk.private java.lang.Stringtitle글 제목.private java.lang.Longviews조회수.-
Fields inherited from class com.restapi.template.api.common.Date
createdDate, modifiedDate
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddComment(Comment comment)댓글 추가.voiddeleteComment(Comment comment)댓글 삭제.voidincreaseViews()조회수 증가.voidupdateComment(Comment comment, java.lang.String message)댓글 수정.voidupdatePost(java.lang.String title, java.lang.String body)게시글 수정.-
Methods inherited from class com.restapi.template.api.common.Date
updateModifyDate
-
-
-
-
Field Detail
-
postId
private java.lang.Long postId
pk.
-
title
private java.lang.String title
글 제목.
-
body
private java.lang.String body
본문.
-
views
private java.lang.Long views
조회수.
-
commentNum
private java.lang.Long commentNum
댓글수.
-
author
private Users author
작성자.
-
-
Constructor Detail
-
Post
public Post(java.lang.Long id, Users author, java.lang.String title, java.lang.String body)게시글.- Parameters:
id- 게시글 IDauthor- 작성자title- 제목body- 본문
-
-
Method Detail
-
increaseViews
public void increaseViews()
조회수 증가.
-
updatePost
public void updatePost(java.lang.String title, java.lang.String body)게시글 수정. 데이터 변경- Parameters:
title- 글 제목body- 글 본문
-
addComment
public void addComment(Comment comment)
댓글 추가.- Parameters:
comment- 댓글
-
updateComment
public void updateComment(Comment comment, java.lang.String message)
댓글 수정.- Parameters:
comment- 댓글message- 수정할 메시지
-
deleteComment
public void deleteComment(Comment comment)
댓글 삭제.- Parameters:
comment- 댓글
-
-