Skip to content

bobbyliujb/TBB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project for Android and Database courses.

Register

  • Url: /sign_up
  • Method: GET/POST
  • Para:
{
    "username": String,
    "password": String,
    "nickname": String
}
  • Return: rescode
{
    "rescode": String
}

Sign in

  • Url: /sign_in
  • Method: POST
  • Para:
{
    "username": String,
    "password": String
}
  • Return: rescode
{
    "rescode": String
}

Pictures Util

upload avatar

  • Url: /pict
  • Method: POST
  • Para:
{
    "username": String,
    "head": String(utf-8)
    "request": "uploadHead"
}
  • Return: rescode
{
    "rescode": String
}

download avatar

  • Url: /pict
  • Method: POST
  • Para:
{
    "username": String,
    "request": "downloadHead"
}
  • Return: rescode
{
    "rescode": String
    "head": String(utf-8)
}

Upload item pic

  • Url: /pict
  • Method: POST
  • Para:
{
    "username": String,
    "item_id": int,
    "image": String(utf-8)
    "request": "uploadItem"
}
  • Return: rescode
{
    "rescode": String
}

Downlod item pic

  • Url: /pict
  • Method: POST
  • Para:
{
    "username": String,
    "item_id": int, 
    "request": "downloadItem"
}
  • Return: rescode
{
    "rescode": String
    "image": String(utf-8)
}

Personal information

Modify personal info

  • Url: /personal_msg
  • Method: POST
  • Para:
{
    "username": String,
    "request": "updateMessage",
    "college": String,
    "qq": String,
    "grade", String,
    "phone": String
}
  • Return: rescode
{
    "rescode": String
}

Get personal info

  • Url: /personal_msg
  • Method: POST
  • Para:
{
    "username": String,
    "request": "getMessage"
}
  • Return: rescode
{
    "rescode": String,
    "college": String,
    "qq": String,
    "grade", String,
    "phone": String
}

Change password

  • Url: /personal_msg
  • Method: POST
  • Para:
{
    "username": String,
    "oldpassword": String,
    "newpassword": String,
    "request": "updatePassword"
}
  • Return: rescode
{
    "rescode": String
}

Change nickname

  • Url: /personal_msg
  • Method: POST
  • Para:
{
    "username": String,
    "request": "updateNickname",
    "nickname": String
}
  • Return: rescode
{
    "rescode": String
}

Item category, unused!!!

Add category

  • Url: /item_type
  • Method: POST
  • Para:
{
    "typename": String,
    "typetext": String(default ""),
    "request": "addType"
}
  • Return: rescode
{
    "rescode": String
}

Get category

  • Url: /item_type
  • Method: POST
  • Para:
{
    "typename": String,
    "request": "getType"
}
  • Return: rescode
{
    "rescode": String
}

Update category

  • Url: /item_type
  • Method: POST
  • Para:
{
    "typename": String,
    "typetext": String,
    "request": "getType"
}
  • Return: rescode
{
    "rescode": String
}

Delete category

  • Url: /item_type
  • Method: POST
  • Para:
{
    "typename": String,
    "request": "getType"
}
  • Return: rescode
{
    "rescode": String
}

Sellers Utils

Add item

  • Url: /seller
  • Method: POST
  • Para:
{
    "username": String,
    "request": "addItem",
    "item_name": String,
    "item_text": String,
    "item_time": String (milisecond),
    "item_price": String,
    "typename": String
}
  • Return: rescode
{
    "rescode": String,
    "item_id": int (if success)
}

Get selling item id

  • Url: /seller
  • Method: POST
  • Para:
{
    "username": String,
    "request": "getItemId",
    "item_name": String,
    "item_text": String,
    "item_time": String,
    "item_price": String,
}
  • Return: rescode
{
    "rescode": String,
    "item_id": int (if success)
}

Get selling item info by id

  • Url: /seller
  • Method: POST
  • Para:
{
    "username": String,
    "request": "getItem",
    "item_id": String,
}
  • Return: rescode
{
    "rescode": String,
    "item_name": String,
    "item_text": String,
    "item_time": String,
    "item_price": String, 
    "typename": String,
    "buy_flag": bool,
    "username": String
}

Delete selling item

  • Url: /seller
  • Method: POST
  • Para:
{
    "username": String,
    "request": "delItem"
    "item_id": int
}
  • Return: rescode
{
    "rescode": String
}

Update selling item info

  • Url: /seller
  • Method: POST
  • Para:
{
    "username": String,
    "request": "updateItem",
    "item_id": int, 
    "item_name": String,
    "item_text": String,
    "item_time": String (milisecond),
    "item_price": String,
}
  • Return: rescode
{
    "rescode": String,
}

Update selling item category

  • Url: /seller
  • Method: POST
  • Para:
{
    "username": String,
    "request": "updateItemType",
    "item_id": int, 
    "typename": String
}
  • Return: rescode
{
    "rescode": String,
}

Get seller of item

  • Url: /seller
  • Method: POST
  • Para:
{
    "username": String,
    "request": "getSeller"
    "item_id": int
}
  • Return: rescode
{
    "rescode": String,
    "username": String,
}

Resell item

  • Url: /seller
  • Method: POST
  • Para:
{
    "username": String,
    "request": "resellItem",
    "item_id": int
}
  • Return: rescode
{
    "rescode": String,
    "username": String,
}

Get all items in sale

  • Url: /seller
  • Method: POST
  • Para:
{
    "username": String,
    "request": "getSellingItems"
}
  • Return: rescode
{
    "rescode": String,
    "item_num": int,
    "item_list": String,
}

Get my items in sale(including sold ones)

  • Url: /seller
  • Method: POST
  • Para:
{
    "username": String,
    "request": "getOwnItems"
}
  • Return: rescode
{
    "rescode": String,
    "item_num": int,
    "item_list": String,
}

Get my items in sale(only still in sale)

  • Url: /seller
  • Method: POST
  • Para:
{
    "username": String,
    "request": "getOwnItems",
    "other": String(the username of user)
}
  • Return: rescode
{
    "rescode": String,
    "item_num": int,
    "item_list": String,
}

Customer Utils

Purchase item

  • Url: /buyer
  • Method: POST
  • Para:
{
    "username": String,
    "request": "buyItem",
    "item_id": int
}
  • Return: rescode
{
    "rescode": String
}

Get buyer of item

  • Url: /buyer
  • Method: POST
  • Para:
{
    "username": String,
    "request": "getBuyer",
    "item_id": int,
}
  • Return: rescode
{
    "rescode": String,
    "username": String
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages