示例#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}
 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
 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