Skip to content

Main : Newsfeed

Juhyeon edited this page Dec 30, 2019 · 3 revisions

Read : 메인페이지 글 읽어오기

response body

{
  "first": true,
  "last": true,
  "contentlist": [
    {
      "sender": {
        "nickname": "주현",
        "username": "wngus"
      },
      "category": "comment",
      "message": "주현님이 이 게시물에 댓글을 남겼습니다.",
      "feed": {
        "postId": 44,
        "content": "남이 쓴 public 글입니다",
        "showLevel": "public",
        "timestamp": "2019.12.28",
        "totalTag": 0,
        "totalComment": 1,
        "totalLike": 2,
        "profile": {
          "name": "피자",
          "profile": "temp-url: aws s3"
        },
        "files": [],
        "tags": []
      },
      "profileId": "pizza",
      "comment": [
        {
          "postId": 44,
          "content": "pizza가 쓴 public글에 단 댓글. 이건 나를 팔로한 사람들 뉴스피드에서 보여아하는 글이다",
          "timestamp": "8분 전",
          "profile": {
            "name": "주현",
            "profile": "temp-url: aws s3"
          }
        }
      ]
    },
    {
      "sender": {
        "nickname": "김수근",
        "username": "rlatnrms"
      },
      "category": "post",
      "message": "",
      "feed": {
        "postId": 46,
        "content": "김수근이 쓴 프라이빗 글",
        "showLevel": "private",
        "timestamp": "5분 전",
        "totalTag": 0,
        "totalComment": 0,
        "totalLike": 0,
        "profile": {
          "name": "김수근",
          "profile": "temp-url: aws s3"
        },
        "files": [],
        "tags": []
      },
      "profileId": "rlatnrms",
      "comment": []
    },
    {
      "sender": {
        "nickname": "김수근",
        "username": "rlatnrms"
      },
      "category": "post",
      "message": "",
      "feed": {
        "postId": 47,
        "content": "김수근이 쓴 팔로우 글",
        "showLevel": "followers",
        "timestamp": "5분 전",
        "totalTag": 0,
        "totalComment": 0,
        "totalLike": 0,
        "profile": {
          "name": "김수근",
          "profile": "temp-url: aws s3"
        },
        "files": [],
        "tags": []
      },
      "profileId": "rlatnrms",
      "comment": []
    },
    {
      "sender": {
        "nickname": "주현",
        "username": "wngus"
      },
      "category": "like",
      "message": "주현님이 이 게시물을 좋아합니다.",
      "feed": {
        "postId": 44,
        "content": "남이 쓴 public 글입니다",
        "showLevel": "public",
        "timestamp": "2019.12.28",
        "totalTag": 0,
        "totalComment": 1,
        "totalLike": 2,
        "profile": {
          "name": "피자",
          "profile": "temp-url: aws s3"
        },
        "files": [],
        "tags": []
      },
      "profileId": "pizza",
      "comment": []
    }
  ]
}

response body 추가 설명

sender/ category : [front-end 예시] 
                    1. category == like 일때 : sender님이 좋아한 게시물입니다. 
                    2. category == comment 일때 : sender님이 댓글을 남기셨습니다.
                    3. category == post 일때 : 나 or 내가 팔로한 회원이 쓴 글일 경우

feed : 게시글 본문에 대한 내용/ 이미지/ 태그/ 댓글 수/ 좋아요 수/ 업로드 시기 등

comment : category == comment 일때 sender가 쓴 댓글 '만' 담음 
         (참고 : 친구의 댓글을 알려주는 페이스북 뉴스피드)
Clone this wiki locally