예제 #1
0
 def post(self):
     token = token_parser.parse_args().token
     account_args = register_parser.parse_args()
     result = create_account(
         account_args.username, account_args.password, account_args.confirm, account_args.role,
         account_args.nickname, token=token
     )
     return result
예제 #2
0
 def get(self):
     token = token_parser.parse_args().token
     args = request.args
     if args:
         accounts = get_accounts(args, token=token)
     else:
         accounts = get_all_accounts(token=token)
     return {'accounts': accounts}
예제 #3
0
 def post(self):
     token = token_parser.parse_args().token
     vip_args = vip_post_parser.parse_args()
     result = create_vip(vip_args.username,
                         vip_args.nickname,
                         vip_args.phone,
                         token=token)
     return result
예제 #4
0
 def post(self):
     token = token_parser.parse_args().token
     account_args = register_parser.parse_args()
     result = create_account(
         account_args.username, account_args.password, account_args.confirm, account_args.role,
         account_args.nickname, token=token
     )
     return result
예제 #5
0
 def get(self):
     token = token_parser.parse_args().token
     args = request.args
     if args:
         vips = get_vips(args, token=token)
     else:
         vips = get_all_vips(token=token)
     return {'vips': vips}
 def get(self):
     token = token_parser.parse_args().token
     args = request.args
     if args:
         books_types = get_book_types(args, token=token)
     else:
         books_types = get_all_types(token=token)
     return {'books_types': books_types}
예제 #7
0
 def get(self):
     token = token_parser.parse_args().token
     args = request.args
     if args:
         books_types = get_book_types(args, token=token)
     else:
         books_types = get_all_types(token=token)
     return {'books_types': books_types}
예제 #8
0
 def get(self):
     token = token_parser.parse_args().token
     args = request.args
     if args:
         vips = get_vips(args, token=token)
     else:
         vips = get_all_vips(token=token)
     return {'vips': vips}
예제 #9
0
 def get(self):
     token = token_parser.parse_args().token
     args = request.args
     if args:
         accounts = get_accounts(args, token=token)
     else:
         accounts = get_all_accounts(token=token)
     return {'accounts': accounts}
예제 #10
0
 def post(self):
     token = token_parser.parse_args().token
     sales_args = sales_record_post_parser.parse_args()
     result = create_sales_record(sales_args.count,
                                  sales_args.seller_id,
                                  sales_args.book_id,
                                  sales_args.purchaser_id,
                                  token=token)
     return result
예제 #11
0
 def post(self):
     token = token_parser.parse_args().token
     book_args = book_post_parser.parse_args()
     result = create_book(book_args.name,
                          book_args.price,
                          book_args.count,
                          book_args.des,
                          token=token)
     return result
예제 #12
0
 def put(self, book_id):
     token = token_parser.parse_args().token
     book_args = book_put_parser.parse_args()
     result = update_book(book_id,
                          book_args.delta,
                          book_args.price,
                          book_args.des,
                          book_args.type_ids,
                          token=token)
     return result
예제 #13
0
 def put(self, account_id):
     token = token_parser.parse_args().token
     account_args = account_update_parser.parse_args()
     result = update_account(account_id,
                             account_args.nickname,
                             account_args.des,
                             account_args.old_password,
                             account_args.new_password,
                             account_args.confirm,
                             token=token)
     return result
예제 #14
0
 def get(self):
     token = token_parser.parse_args().token
     sales_records = get_all_sales_records(token=token)
     return {'sales_records': sales_records}
예제 #15
0
 def post(self):
     token = token_parser.parse_args().token
     sales_args = sales_record_post_parser.parse_args()
     result = create_sales_record(sales_args.count, sales_args.seller_id,
                                  sales_args.book_id, sales_args.purchaser_id, token=token)
     return result
예제 #16
0
 def get(self, account_id):
     token = token_parser.parse_args().token
     return get_account_by_id(account_id, token=token)
예제 #17
0
 def delete(self, account_id):
     token = token_parser.parse_args().token
     result = rm_account(account_id, token=token)
     return result
예제 #18
0
 def post(self):
     token = token_parser.parse_args().token
     vip_args = vip_post_parser.parse_args()
     result = create_vip(vip_args.username, vip_args.nickname, vip_args.phone, token=token)
     return result
예제 #19
0
 def delete(self, vip_id):
     token = token_parser.parse_args().token
     result = rm_vip(vip_id, token=token)
     return result
예제 #20
0
 def get(self):
     token = token_parser.parse_args().token
     sales_records = get_all_sales_records(token=token)
     return {'sales_records': sales_records}
예제 #21
0
 def get(self, book_type_id):
     token = token_parser.parse_args().token
     books = get_books_by_type(book_type_id, token=token)
     return {'books': books}
예제 #22
0
 def put(self, account_id):
     token = token_parser.parse_args().token
     account_args = account_update_parser.parse_args()
     result = update_account(account_id, account_args.nickname, account_args.des, account_args.old_password,
                             account_args.new_password, account_args.confirm, token=token)
     return result
예제 #23
0
 def post(self):
     token = token_parser.parse_args().token
     book_args = book_post_parser.parse_args()
     result = create_book(book_args.name, book_args.price, book_args.count, book_args.des, token=token)
     return result
예제 #24
0
 def get(self, book_id):
     token = token_parser.parse_args().token
     return get_book_by_id(book_id, token=token)
예제 #25
0
 def get(self, book_id):
     token = token_parser.parse_args().token
     sales_records = get_sales_records_by_book(book_id, token=token)
     return {'sales_records': sales_records}
예제 #26
0
 def get(self, account_id):
     token = token_parser.parse_args().token
     sales_records = get_sales_records_by_account(account_id, token=token)
     return {'sales_records': sales_records}
예제 #27
0
 def post(self):
     token = token_parser.parse_args().token
     book_args = book_type_post_parser.parse_args()
     result = create_book_type(book_args.name, token=token)
     return result
예제 #28
0
 def delete(self, book_type_id):
     token = token_parser.parse_args().token
     result = rm_book_type(book_type_id, token=token)
     return result
예제 #29
0
 def delete(self, book_type_id):
     token = token_parser.parse_args().token
     result = rm_book_type(book_type_id, token=token)
     return result
예제 #30
0
 def delete(self, vip_id):
     token = token_parser.parse_args().token
     result = rm_vip(vip_id, token=token)
     return result
예제 #31
0
 def post(self):
     token = token_parser.parse_args().token
     book_args = book_type_post_parser.parse_args()
     result = create_book_type(book_args.name, token=token)
     return result
예제 #32
0
 def delete(self):
     token = token_parser.parse_args().token
     result = logout(token)
     return result
예제 #33
0
 def get(self, vip_id):
     token = token_parser.parse_args().token
     sales_records = get_sales_records_by_vip(vip_id, token=token)
     return {'sales_records': sales_records}
예제 #34
0
 def put(self, book_id):
     token = token_parser.parse_args().token
     book_args = book_put_parser.parse_args()
     result = update_book(book_id, book_args.delta, book_args.price, book_args.des, book_args.type_ids, token=token)
     return result
예제 #35
0
 def get(self, account_id):
     token = token_parser.parse_args().token
     return get_account_by_id(account_id, token=token)
예제 #36
0
 def get(self, book_id):
     token = token_parser.parse_args().token
     return get_book_by_id(book_id, token=token)
예제 #37
0
 def delete(self, account_id):
     token = token_parser.parse_args().token
     result = rm_account(account_id, token=token)
     return result
예제 #38
0
 def delete(self):
     token = token_parser.parse_args().token
     result = logout(token)
     return result