"FingerTown"의 두 판 사이의 차이
(새 문서: Category:개발 = FingerTown = == test == * http://oht.junho85.pe.kr/test) |
(→API) |
||
(같은 사용자의 중간 판 12개는 보이지 않습니다) | |||
2번째 줄: | 2번째 줄: | ||
= FingerTown = | = FingerTown = | ||
− | == test == | + | |
+ | |||
+ | == Server == | ||
+ | |||
+ | === DB === | ||
+ | * MySQL | ||
+ | |||
+ | === API === | ||
+ | * rule | ||
+ | * ex) http://oht.junho85.pe.kr/server/auth/register | ||
+ | ** fixed server url: http://oht.junho85.pe.kr/server/ | ||
+ | ** big category: auth/ | ||
+ | ** action: register/ | ||
+ | |||
+ | ==== user ==== | ||
+ | ===== register api ===== | ||
+ | * method: POST only | ||
+ | * url: http://oht.junho85.pe.kr/server/auth/register | ||
+ | * parameter | ||
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! column | ||
+ | ! comment | ||
+ | |- | ||
+ | | email | ||
+ | | email | ||
+ | |- | ||
+ | | avatar | ||
+ | | character | ||
+ | |- | ||
+ | | password | ||
+ | | password | ||
+ | |} | ||
+ | * test: | ||
+ | <source lang="javascript"> | ||
+ | jQuery.post( "http://oht.junho85.pe.kr/server/auth/register",{ | ||
+ | email: "junho85@daum.net", | ||
+ | nickname: "my nick", | ||
+ | avatar: 2, | ||
+ | password: "1234", }).done(function( data ) { | ||
+ | console.log( "Data Loaded: " + data ); | ||
+ | }); | ||
+ | </source> | ||
+ | * return | ||
+ | ** success <source lang="javascript"> | ||
+ | {"result":"success","message":"register success"} | ||
+ | </source> | ||
+ | ** fail | ||
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! errcode | ||
+ | ! explanation | ||
+ | |- | ||
+ | | 500 | ||
+ | | undefined | ||
+ | |- | ||
+ | | 501 | ||
+ | | duplicated email | ||
+ | |} | ||
+ | <source lang="javascript"> | ||
+ | {"result":"fail","errcode":"501","message":"junho852@daum.net already exists"} | ||
+ | </source> | ||
+ | |||
+ | ===== login api ===== | ||
+ | * method: POST only | ||
+ | * url: http://oht.junho85.pe.kr/server/auth/login | ||
+ | * test: | ||
+ | <source lang="javascript"> | ||
+ | jQuery.post( "http://oht.junho85.pe.kr/server/auth/login", { email:"junho85@gmail.com", password: "1234" }).done(function(data ) { | ||
+ | console.log( "Data Loaded: " + data ); | ||
+ | }); | ||
+ | </source> | ||
+ | ===== logout api ===== | ||
+ | * json - http://oht.junho85.pe.kr/server/auth/logout | ||
+ | * json - http://oht.junho85.pe.kr/server/auth/logout?callback=? | ||
+ | |||
+ | * user list api - just for testing | ||
+ | ** json - http://oht.junho85.pe.kr/server/auth/get_user_list | ||
+ | ** jsonp - http://oht.junho85.pe.kr/server/auth/get_user_list?callback=? | ||
+ | |||
+ | ==== item ==== | ||
+ | ===== item (tree and others) data list api ===== | ||
+ | * method: GET | ||
+ | * json - http://oht.junho85.pe.kr/server/item/get_list?town_id=1 | ||
+ | * jsonp - http://oht.junho85.pe.kr/server/item/get_list?town_id=1&callback=? | ||
+ | * type (1 -tree, 2 - trashcan, 3 - streetlight, 4 - trafficlight) | ||
+ | * test: http://oht.junho85.pe.kr/server/item/get_list?town_id=1 | ||
+ | <source lang="javascript"> | ||
+ | [{"id":"1","user_id":"1","town_id":"1","detail":"testtree","type":"1","coord_x":"100","coord_y":"100","latitude":"0.000000","longitude":"0.000000","picture":"","likecount":"0","created":"2013-10-0520:41:45"},{"id":"2","user_id":"1","town_id":"1","detail":"testtree2","type":"1","coord_x":"150","co... | ||
+ | </source> | ||
+ | |||
+ | ===== item data api (single data) ===== | ||
+ | * test: http://oht.junho85.pe.kr/server/item/get?item_id=1 | ||
+ | <source lang="javascript"> | ||
+ | test1{"id":"1","user_id":"1","town_id":"1","detail":"testtree","type":"1","coord_x":"100","coord_y":"100","latitude":"0.000000","longitude":"0.000000","picture":"","likecount":"0","created":"2013-10-0520:41:45"} | ||
+ | </source> | ||
+ | |||
+ | ===== item add api ===== | ||
+ | * test: http://oht.junho85.pe.kr/server/item/add?user_id=1&town_id=1&detail=testhello&type=2&coord_x=300&coord_y=300 | ||
+ | ===== item delete api ===== | ||
+ | * test: http://oht.junho85.pe.kr/server/item/delete?item_id=7 | ||
+ | |||
+ | ==== places (places.json) ==== | ||
+ | * coffeshop, parks, ... | ||
+ | <source lang="javascript"> | ||
+ | { "places": [ { "id": 1, "name": "The Handmade Coffe", "type": "Coffeshop", "coordinates": [ [ [ [ 126.9104254245758, 37.55368741183799 ], [ 126.91045761108398, 37.55373844562581 ], [ 126.91132128238678, 37.55401913083414 ], [ 126.91169142723083, 37.55267523449288 ], [ 126.91106915473938, 37.552598682705934 ], [ 126.91071510314941, 37.5527007517377 ], [ 126.9104254245758, 37.55368741183799 ] ] ] ], "label": { "latitude":"37.5532059116456", "longitude":"126.91110687330365" } } ]} | ||
+ | </source> | ||
+ | |||
+ | ===== place add ===== | ||
+ | |||
+ | ==== user locations (users.json) ==== | ||
+ | <source lang="javascript"> | ||
+ | { "users": [ { "user_id":"1", "town_id":"1", "user_name":"Dominik", "latitude":"37.55558042300999", "longitude":"126.9110805541277", "created":"2013-10-05 20:41:45", "gender": 1 }, { "user_id":"2", "town_id":"1", "user_name":"Susi", "latitude":"37.55255243262988", "longitude":"126.90893478691578", "created":"2013-10-05 20:41:45", "gender": 0 } ]} | ||
+ | </source> | ||
+ | |||
+ | ==== user projects (projects.json) ==== | ||
+ | <source lang="javascript"> | ||
+ | { "projects": [ { "id": 1, "name": "Users Project", "description": "Blablabl", "latitude":"37.5532059116456", "longitude":"126.91110687330365" } ]} | ||
+ | </source> | ||
+ | |||
+ | ==== complains.json ==== | ||
+ | <source lang="javascript"> | ||
+ | { "complains": [ { "id": 1, "town_id": 1, "name": "Complain", "description": "Description whats wrong in this complain", "image_path": "folder/image/upload/2013/11/1/complain.png", "latitude":"37.5532059116456", "longitude":"126.91110687330365", "rating": 0.6 } ]} | ||
+ | </source> | ||
+ | |||
+ | ==== place_complain.json ==== | ||
+ | <source lang="javascript"> | ||
+ | { "complains": [ { "id": 1, "town_id": 1, "place_id": 1, "name": "Complain", "description": "Description whats wrong in this complain", "coord_x":"37", "coord_y":"5", "rating": 0.6 } ]} | ||
+ | </source> | ||
+ | |||
+ | === CodeIgniter === | ||
+ | * http://www.codeigniter-kr.org/user_guide_2.1.0/helpers/email_helper.html | ||
+ | |||
+ | ==== test ==== | ||
* http://oht.junho85.pe.kr/test | * http://oht.junho85.pe.kr/test | ||
+ | |||
+ | ==== Helper ==== | ||
+ | * email 관련된거 | ||
+ | ** http://www.codeigniter-kr.org/user_guide_2.1.0/helpers/email_helper.html | ||
+ | ** 별로 쓸 일 없지 않을까 | ||
+ | |||
+ | == git 사용 == | ||
+ | * https://github.com/junho85/fingertown_server | ||
+ | * https://github.com/ddanninger/fingertown | ||
+ | |||
+ | === 사용법 === | ||
+ | * clone | ||
+ | 가져오기 | ||
+ | git clone 으로 가져 온다. | ||
+ | |||
+ | * add | ||
+ | 가져오기 | ||
+ | git addapplication/ license.txt system user_guide/ | ||
+ | |||
+ | * commit | ||
+ | 커밋. 하지만 바로 올라기지는 않는다. push 로 올려 준다. | ||
+ | git commit -m "test" | ||
+ | |||
+ | gitcommit -a | ||
+ | ? | ||
+ | 뭔가 잘 안되는듯? | ||
+ | |||
+ | * push | ||
+ | 서버에 올린다. | ||
+ | git push -u origin master |
2013년 11월 24일 (일) 21:10 기준 최신판
목차
FingerTown
Server
DB
- MySQL
API
- rule
- ex) http://oht.junho85.pe.kr/server/auth/register
- fixed server url: http://oht.junho85.pe.kr/server/
- big category: auth/
- action: register/
user
register api
- method: POST only
- url: http://oht.junho85.pe.kr/server/auth/register
- parameter
column | comment |
---|---|
avatar | character |
password | password |
- test:
jQuery.post( "http://oht.junho85.pe.kr/server/auth/register",{
email: "junho85@daum.net",
nickname: "my nick",
avatar: 2,
password: "1234", }).done(function( data ) {
console.log( "Data Loaded: " + data );
});
- return
- success
{"result":"success","message":"register success"}
- fail
- success
errcode | explanation |
---|---|
500 | undefined |
501 | duplicated email |
{"result":"fail","errcode":"501","message":"junho852@daum.net already exists"}
login api
- method: POST only
- url: http://oht.junho85.pe.kr/server/auth/login
- test:
jQuery.post( "http://oht.junho85.pe.kr/server/auth/login", { email:"junho85@gmail.com", password: "1234" }).done(function(data ) {
console.log( "Data Loaded: " + data );
});
logout api
- json - http://oht.junho85.pe.kr/server/auth/logout
- json - http://oht.junho85.pe.kr/server/auth/logout?callback=?
- user list api - just for testing
item
item (tree and others) data list api
- method: GET
- json - http://oht.junho85.pe.kr/server/item/get_list?town_id=1
- jsonp - http://oht.junho85.pe.kr/server/item/get_list?town_id=1&callback=?
- type (1 -tree, 2 - trashcan, 3 - streetlight, 4 - trafficlight)
- test: http://oht.junho85.pe.kr/server/item/get_list?town_id=1
[{"id":"1","user_id":"1","town_id":"1","detail":"testtree","type":"1","coord_x":"100","coord_y":"100","latitude":"0.000000","longitude":"0.000000","picture":"","likecount":"0","created":"2013-10-0520:41:45"},{"id":"2","user_id":"1","town_id":"1","detail":"testtree2","type":"1","coord_x":"150","co...
item data api (single data)
test1{"id":"1","user_id":"1","town_id":"1","detail":"testtree","type":"1","coord_x":"100","coord_y":"100","latitude":"0.000000","longitude":"0.000000","picture":"","likecount":"0","created":"2013-10-0520:41:45"}
item add api
item delete api
places (places.json)
- coffeshop, parks, ...
{ "places": [ { "id": 1, "name": "The Handmade Coffe", "type": "Coffeshop", "coordinates": [ [ [ [ 126.9104254245758, 37.55368741183799 ], [ 126.91045761108398, 37.55373844562581 ], [ 126.91132128238678, 37.55401913083414 ], [ 126.91169142723083, 37.55267523449288 ], [ 126.91106915473938, 37.552598682705934 ], [ 126.91071510314941, 37.5527007517377 ], [ 126.9104254245758, 37.55368741183799 ] ] ] ], "label": { "latitude":"37.5532059116456", "longitude":"126.91110687330365" } } ]}
place add
user locations (users.json)
{ "users": [ { "user_id":"1", "town_id":"1", "user_name":"Dominik", "latitude":"37.55558042300999", "longitude":"126.9110805541277", "created":"2013-10-05 20:41:45", "gender": 1 }, { "user_id":"2", "town_id":"1", "user_name":"Susi", "latitude":"37.55255243262988", "longitude":"126.90893478691578", "created":"2013-10-05 20:41:45", "gender": 0 } ]}
user projects (projects.json)
{ "projects": [ { "id": 1, "name": "Users Project", "description": "Blablabl", "latitude":"37.5532059116456", "longitude":"126.91110687330365" } ]}
complains.json
{ "complains": [ { "id": 1, "town_id": 1, "name": "Complain", "description": "Description whats wrong in this complain", "image_path": "folder/image/upload/2013/11/1/complain.png", "latitude":"37.5532059116456", "longitude":"126.91110687330365", "rating": 0.6 } ]}
place_complain.json
{ "complains": [ { "id": 1, "town_id": 1, "place_id": 1, "name": "Complain", "description": "Description whats wrong in this complain", "coord_x":"37", "coord_y":"5", "rating": 0.6 } ]}
CodeIgniter
test
Helper
- email 관련된거
git 사용
사용법
- clone
가져오기 git clone 으로 가져 온다.
- add
가져오기 git addapplication/ license.txt system user_guide/
- commit
커밋. 하지만 바로 올라기지는 않는다. push 로 올려 준다. git commit -m "test"
gitcommit -a ? 뭔가 잘 안되는듯?
- push
서버에 올린다. git push -u origin master