Esempio n. 1
0
def registered_account_request(request):
    data = request.POST
    return before_send_dispose(
        registered_account(bytes.decode(base64.b64decode(data["mail"])),
                           bytes.decode(base64.b64decode(data["password"])),
                           bytes.decode(base64.b64decode(data["address"])),
                           bytes.decode(base64.b64decode(data["name"]))))
Esempio n. 2
0
def register_used_book_request(request):
    data = request.POST
    register_ret = register_used_book(
        uuid.UUID(bytes=base64.b64decode(data["book_uuid"])),
        uuid.UUID(bytes=base64.b64decode(data["seller_uuid"])), data["price"],
        data["description"])

    ret = {"code": True if register_ret else False}
    return before_send_dispose(ret)
Esempio n. 3
0
def get_message_count(uuid):
    return before_send_dispose(Message.get_message_count_by_account_uuid(uuid))
Esempio n. 4
0
def get_messages(uuid, bg_index, ed_index):
    return before_send_dispose(Message.get_messages_by_account_uuid(uuid, bg_index, ed_index))
Esempio n. 5
0
def login_request(request):
    data = request.POST
    return before_send_dispose(
        login(bytes.decode(base64.b64decode(data["mail"])),
              bytes.decode(base64.b64decode(data["password"]))))
Esempio n. 6
0
def get_search_book_request(request):
    data = request.POST
    return before_send_dispose(search_book(data["keywords"]))
Esempio n. 7
0
def get_server_fee_request(request):
    data = request.POST
    return before_send_dispose(get_server_fee(data["price"]))
Esempio n. 8
0
def get_book_detail_request(request):
    data = request.POST
    _uuid = uuid.UUID(bytes=base64.b64decode(data["uuid"]))
    ret = get_book_detail(_uuid)
    ret["used_books"] = get_on_selling_used_book_of_book(_uuid)
    return before_send_dispose(ret)