feat:更新智能体工具
This commit is contained in:
40
domain/bill.py
Normal file
40
domain/bill.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import requests
|
||||
|
||||
from config.domain import MetricConfig
|
||||
|
||||
BILL_BASE_URL = "https://cxx0822.s.3q.hair/home-api/"
|
||||
USERNAME = "Cxx0822"
|
||||
PASSWORD = "19940822Cxx"
|
||||
|
||||
_BILL_RAW_CACHE = None
|
||||
_BILL_FILTERED_CACHE = None
|
||||
|
||||
|
||||
def get_bill_token():
|
||||
resp = requests.post(
|
||||
f"{BILL_BASE_URL}session",
|
||||
params={"name": USERNAME, "password": PASSWORD},
|
||||
timeout=10,
|
||||
)
|
||||
resp.raise_for_status()
|
||||
return resp.json()["saToken"]["tokenValue"]
|
||||
|
||||
|
||||
BILL_FIELD_NAME_MAP = {
|
||||
"date": "账单日期",
|
||||
"bookName": "账本名称",
|
||||
"type": "账单类型",
|
||||
"category": "账单类别",
|
||||
"location": "账单地点",
|
||||
"payAccount": "支付账户",
|
||||
"amount": "金额",
|
||||
"content": "账单内容",
|
||||
"remark": "备注",
|
||||
}
|
||||
|
||||
BILL_DETAIL_FIELDS = ["date", "bookName", "type", "customer", "category",
|
||||
"location", "payAccount", "amount", "content", "remark"]
|
||||
|
||||
BILL_SEARCH_FIELDS = ["location", "content", "remark"]
|
||||
|
||||
BILL_METRICS = [MetricConfig("amount", "金额", agg="sum", format="money")]
|
||||
Reference in New Issue
Block a user