-
Notifications
You must be signed in to change notification settings - Fork 0
api spec
sky1core edited this page Sep 5, 2015
·
15 revisions
- 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"
}
- 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"
}
- 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"
}
- 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"
}
- 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"
}
- 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"
}
- 개발준비
- [서버 실행을 위한 로컬 세팅 및 실행법] (서버 실행을 위한 로컬 세팅 및 실행법)
- Geolocation
- [api spec](api spec)
- client 개발도구 설치
- client 개발도구 사용법
- cordova-plugin 설치 및 실행
- REST API
- AngularJS
- Ionic
- Android
- 데이터 시각화