"FingerTown"의 두 판 사이의 차이

김준호위키
이동: 둘러보기, 검색
(user)
(API)
 
(같은 사용자의 중간 판 6개는 보이지 않습니다)
10번째 줄: 10번째 줄:
  
 
=== API ===
 
=== 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 ====
 
==== user ====
* register api - POST only
+
===== register api =====
 +
* method: POST only
 
* url: http://oht.junho85.pe.kr/server/auth/register
 
* url: http://oht.junho85.pe.kr/server/auth/register
* test:  
+
* 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">
 
<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 ); });
+
{"result":"fail","errcode":"501","message":"junho852@daum.net already exists"}
 
</source>
 
</source>
  
 
+
===== login api =====
* login api - POST only
+
* method: POST only
 
* url: http://oht.junho85.pe.kr/server/auth/login
 
* url: http://oht.junho85.pe.kr/server/auth/login
 
* test:
 
* 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 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>
 
</source>
* logout api
+
===== logout api =====
** json - http://oht.junho85.pe.kr/server/auth/logout
+
* json - http://oht.junho85.pe.kr/server/auth/logout
** json - http://oht.junho85.pe.kr/server/auth/logout?callback=?
+
* json - http://oht.junho85.pe.kr/server/auth/logout?callback=?
  
 
* user list api - just for testing
 
* user list api - just for testing
34번째 줄: 83번째 줄:
  
 
==== item ====
 
==== item ====
* item (tree and others) data list api
+
===== item (tree and others) data list api =====
** json - http://oht.junho85.pe.kr/server/item/get_list?town_id=1
+
* method: GET
** jsonp - http://oht.junho85.pe.kr/server/item/get_list?town_id=1&callback=?
+
* json - http://oht.junho85.pe.kr/server/item/get_list?town_id=1
** type (1 -tree, 2 - trashcan, 3 - streetlight, 4 - trafficlight)
+
* jsonp - http://oht.junho85.pe.kr/server/item/get_list?town_id=1&callback=?
** test: http://oht.junho85.pe.kr/server/item/get_list?town_id=1
+
* 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...
 
[{"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) http://oht.junho85.pe.kr/server/item/get?item_id=1
+
===== item data api (single data) =====
** test: http://oht.junho85.pe.kr/server/item/get?item_id=1
+
* 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"}
 
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>
  
* item add api
+
==== complains.json ====
** 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
+
<source lang="javascript">
* item delete api
+
{ "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 }  ]}
** test: http://oht.junho85.pe.kr/server/item/delete?item_id=7
+
</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 ===
 
=== CodeIgniter ===

2013년 11월 24일 (일) 21:10 기준 최신판

FingerTown

Server

DB

  • MySQL

API

user

register api
column comment
email email
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
errcode explanation
500 undefined
501 duplicated email
{"result":"fail","errcode":"501","message":"junho852@daum.net already exists"}
login api
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

item

item (tree and others) data list api
[{"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

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