Skip to content
sky1core edited this page Sep 5, 2015 · 15 revisions

MAP 관련

map상의 CCTV 정보 가져오기

  • url: /map/cctvs
  • method: GET
  • parameters(논의되지 않음, 임의로 적음)
  • northEastLatitude
  • northEastLongitude
  • southWestLatitude
  • southWestLongitude
  • success response example
{
   "cctvs":[
      {
         "cctvId":10,
         "latitude":37.4812,
         "longitude":126.952514,
         "purpose" : "UNKNOWN"
      },
      {
         "cctvId":11,
         "latitude":37.478216,
         "longitude":126.951527,
      }
   ],
   "status":"SUCCESS"
}
  • fail response example
{
   "status":"FAILURE",
   "errorCode":400,
   "errorMessage":"error message"
}

CCTV 세부 정보

CCTV 한 대의 정보 가져오기

  • url: /cctv/{id}
  • method: GET
  • parameters: 없음(위 {id} 부분에 CCTV ID 입력)
  • success response example
  • userId 관련 부분은 변경될 수 있음
{
   "status":"SUCCESS",
   "cctv":{
      "cctvId":1,
      "address":"adsf",
      "cctvImage":"http://noimage",
      "noticeImage":"http://image",
      "purpose":"UNKNOWN",
      "source":"BOROUGH"
   },
   "comments":{
      "nextCommentId":13,
      "comments":[
         {
            "commentId":15,
            "userId":"jokie",
            "contents":"hello world2",
            "createdAt":1438878279000
         },
         {
            "commentId":14,
            "userId":"jokie",
            "contents":"hello world",
            "createdAt":1438878252000
         }
      ]
   }
}
  • fail response example
{
   "status":"FAILURE",
   "errorCode":400,
   "errorMessage":"error message"
}

CCTV comment 가져오기

  • url: /cctv/{id}/comments
  • method: GET
  • parameters
  • fromCommentId: number, required
  • size: number, optional(default = 5)
  • success response example
  • userId 관련 부분은 변경될 수 있음
{
   "comments":{
      "nextCommentId":11,
      "comments":[
         {
            "commentId":13,
            "userId":"a",
            "contents":"13",
            "createdAt":1438614605000
         },
         {
            "commentId":12,
            "userId":"a",
            "contents":"12",
            "createdAt":1438614605000
         }
      ]
   },
   "status":"SUCCESS"
}
  • fail response
{
   "status":"FAILURE",
   "errorCode":400,
   "errorMessage":"error message"
}

CCTV 코멘트 등록

  • url: /cctv/{id}/comment
  • method: POST
  • parameters
  • userId: string, required
  • contents: string, required
  • size: number, optional
  • success response example
  • userId 관련 부분은 변경될 수 있음
{
   "comments":{
      "nextCommentId":11,
      "comments":[
         {
            "commentId":13,
            "userId":"a",
            "contents":"13",
            "createdAt":1438614605000
         },
         {
            "commentId":12,
            "userId":"a",
            "contents":"12",
            "createdAt":1438614605000
         }
      ]
   },
   "status":"SUCCESS"
}
  • fail response example
{
   "status":"FAILURE",
   "errorCode":400,
   "errorMessage":"error message"
}

CCTV 코멘트 삭제

  • url: /cctv/{id}/comment
  • method: DELETE
  • parameters
  • userId: string, required, 삭제를 요청한 user의 userId
  • commentId: number, required
  • success response example
{
   "status":"SUCCESS"
}
  • fail response example
{
   "status":"FAILURE",
   "errorCode":400,
   "errorMessage":"error message"
}

CCTV 등록

CCTV 등록

  • url: /cctv
  • method: POST
  • enctype: multipart/form-data 로 할것
  • parameters
  • latitude: number, required
  • longitude: number, required
  • purpose: string, required
  • cctvImage: file, required
  • noticeImage: file, optional
  • userId: string, required
  • success response example
{
   "status":"SUCCESS",
   "cctvId":2
}
  • fail response example
{
   "status":"FAILURE",
   "errorCode":400,
   "errorMessage":"error message"
}