2023-03-23 14:31:05 +00:00
|
|
|
import cqwu
|
|
|
|
from cqwu.errors.auth import CookieError
|
|
|
|
from cqwu.types.epay import PayBillPage
|
|
|
|
|
|
|
|
|
|
|
|
class GetPayBill:
|
|
|
|
async def get_pay_bill(
|
|
|
|
self: "cqwu.Client",
|
|
|
|
page_number: int = 1,
|
|
|
|
) -> PayBillPage:
|
|
|
|
"""
|
|
|
|
获取校园卡消费账单
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
PayBillPage: 消费账单
|
|
|
|
"""
|
|
|
|
url = "http://218.194.176.214:8382/epay/thirdapp/bill"
|
|
|
|
html = await self.oauth(url)
|
|
|
|
if not html:
|
|
|
|
raise CookieError()
|
|
|
|
if html.url != url:
|
|
|
|
raise CookieError()
|
|
|
|
data = await self.request.post(
|
|
|
|
"http://218.194.176.214:8382/epay/thirdapp/loadbill.json",
|
2023-12-29 10:04:00 +00:00
|
|
|
data={"pageno": page_number},
|
2023-03-23 14:31:05 +00:00
|
|
|
)
|
|
|
|
return PayBillPage(**data.json())
|