def get_comment(pid): form = Count().validate_for_api() comments = Comment.get_comment_by_pid(pid, form.count.data, form.page.data) return jsonify(comments)
def get_recent(): '''最新的商品''' count = Count().validate_for_api().count.data products = Product.get_most_recent(count=count) return Success(products)
def get_recent(): form = Count().validate_for_api() products = Product.get_most_recent(form.count.data, form.page.data) return jsonify(products)
def get_cart(): uid = g.user.uid form = Count().validate_for_api() carts = Cart.get_cart_by_uid(uid, form.count.data, form.page.data) return jsonify(carts)
def get_user_coupon(): uid = g.user.uid form = Count().validate_for_api() coupon = UserCoupon.get_user_coupon_all(uid, form.count.data, form.page.data) return jsonify(coupon)
def get_coupon(): form = Count().validate_for_api() coupon = Coupon.get_all_coupon(form.count.data, form.page.data) return jsonify(coupon)
def get_my_order(): uid = g.user.uid form = Count().validate_for_api() order = Order.get_user_order(uid, form.count.data, form.page.data, form.type.data) return jsonify(order)