Skip to content

jacobKKK/IMnight2018_Backend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IMnight2018_Backend

switch to "api" branch before edit README.md

API ENDPOINT

Authentication

Basic

Login

URL : /rest-auth/login/

Method : POST

Parameter :

username
email
password

Data constraints :

{
"key" : ""
}

Logout

URL : /rest-auth/logout/

Method : POST

Data constraints :

Note :

ACCOUNT_LOGOUT_ON_GET = True to allow logout using GET - this is the exact same configuration from allauth. NOT recommended, see: http://django-allauth.readthedocs.io/en/latest/views.html#logout

Password reset

URL : /rest-auth/password/reset/

Method : POST

Parameter :

email

Data constraints :

Password reset confirm

URL : /rest-auth/password/reset/confirm/

Method : POST

Parameter :

uid   token   new_password1   new_password2

Data constraints :

Note :

uid and token are sent in email after calling /rest-auth/password/reset/

Password change

URL : /rest-auth/password/change/

Method : POST

Parameter :

new_password1   new_password2   old_password

Data constraints :

Note :

OLD_PASSWORD_FIELD_ENABLED = True to use old_password. LOGOUT_ON_PASSWORD_CHANGE = False to keep the user logged in after password change

user

URL : /rest-auth/user/

Method : GET, PUT, PATCH

Parameter :

username   first_name   last_name

Data constraints :

Returns pk, username, email, first_name, last_name

Registration

Registration

URL : /rest-auth/registration/

Method : POST

Parameter :

username   password1   password2   email

Data constraints :

Registration verify email

URL : /rest-auth/registration/verify-email/

Method : POST

Parameter :

key  

Data constraints :

Social Media Authentication

用 access_token 登入 facebook

URL : /rest-auth/facebook/

Method : POST

Parameter :

access_token   code

Data constraints :

Note :

access_token OR code can be used as standalone arguments, see https://github.com/Tivix/django-rest-auth/blob/master/rest_auth/registration/views.py

Redirect 到 Facebook 登入

URL : /socail-auth/facebook/login/

Method : GET

User

取得自己資料

URL : /users/self

Method : GET

Auth Require : YES

Data constraints :

{
  "data":{
    用戶資料
  }
}

取得某用戶資料

URL : /users/user-id:

Method : GET

Auth Require : YES

Data constraints :

{
  "data":{
    用戶資料
  }
}

Human

抽取本日人物

URL : /human/list

Method : GET

Auth Require : YES

Data constraints :

{
  "data":{
    表演者資料
  }
}
if 當天抽的人 == null:  
  抽一個人  
  把他加到表演者清單  
  更新當天狀態  
return 當天表演者

用戶擁有的表演者清單

URL : /human/list

Method : GET

Auth Require : YES

Data constraints :

{
  "data":[
      {
        表演者資料
      },
      {
        表演者資料
      }
  ]
}
表演者清單 = client.db.col.find
return 表演者清單

取得某表演者資料

URL : /human/performer-id:

Method : GET

Auth Require : YES

Data constraints :

{
  "data":{
    表演者資料
  }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 83.4%
  • JavaScript 13.5%
  • CSS 1.9%
  • HTML 0.9%
  • C 0.2%
  • GAP 0.1%