Skip to content

Commit

Permalink
🔨 统一通用流量变量名 genera→common
Browse files Browse the repository at this point in the history
  • Loading branch information
Cp0204 committed May 12, 2024
1 parent 58f7bf3 commit 006ed15
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ docker run -d \
"voiceTotal": 2250, // 语音通话总时长(单位:分钟)
"flowUse": 7366923, // 总流量已使用量(单位:KB)
"flowTotal": 7366923, // 总流量总量(单位:KB)
"generalUse": 7273962, // 通用流量已使用量(单位:KB)
"generalTotal": 25550446, // 通用流量总量(单位:KB)
"commonUse": 7273962, // 通用流量已使用量(单位:KB)
"commonTotal": 25550446, // 通用流量总量(单位:KB)
"specialUse": 92961, // 专用流量已使用量(单位:KB)
"specialTotal": 215265280, // 专用流量总量(单位:KB)
"createTime": "2024-05-12 14:13:28", // 数据创建时间
"flowItems": [ // 流量包列表
"flowItems": [ // 流量类型列表
{
"name": "国内通用流量(达量降速)", // 流量包名称
"name": "国内通用流量(达量降速)", // 流量类型名称
"use": 10241024, // 流量包已使用量(单位:KB)
"balance": 0, // 流量包剩余量(单位:KB)
"total": 10241024 // 流量包总量(单位:KB)
Expand Down
2 changes: 1 addition & 1 deletion app/api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def user_flux_package():

@app.route("/summary", methods=["POST", "GET"])
def summary():
"""查询流量包接口"""
"""查询重要数据简化接口"""
important_data, status_code = query_data(telecom.qry_important_data)
print(important_data.data)
if status_code == 200:
Expand Down
10 changes: 5 additions & 5 deletions telecom_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ def to_summary(self, data, phonenum=""):
flow_balance = int(data["flowInfo"]["totalAmount"]["balance"])
flow_total = flow_use + flow_balance
# 通用流量
general_use = int(data["flowInfo"]["commonFlow"]["used"])
general_balance = int(data["flowInfo"]["commonFlow"]["balance"])
general_total = general_use + general_balance
common_use = int(data["flowInfo"]["commonFlow"]["used"])
common_balance = int(data["flowInfo"]["commonFlow"]["balance"])
common_total = common_use + common_balance
# 专用流量
special_use = int(data["flowInfo"]["specialAmount"]["used"])
special_balance = int(data["flowInfo"]["specialAmount"]["balance"])
Expand Down Expand Up @@ -225,8 +225,8 @@ def to_summary(self, data, phonenum=""):
"voiceTotal": voice_total,
"flowUse": flow_use,
"flowTotal": flow_total,
"generalUse": general_use,
"generalTotal": general_total,
"commonUse": common_use,
"commonTotal": common_total,
"specialUse": special_use,
"specialTotal": special_total,
"createTime": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
Expand Down
2 changes: 1 addition & 1 deletion telecom_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def auto_login():
💰 余额:{summary['balance']}
📞 通话:{summary['voiceUsage']} / {summary['voiceTotal']} min
🌐 总流量
- 通用:{telecom.convert_flow(summary['generalUse'],"GB",2)} / {telecom.convert_flow(summary['generalTotal'],"GB",2)} GB
- 通用:{telecom.convert_flow(summary['commonUse'],"GB",2)} / {telecom.convert_flow(summary['commonTotal'],"GB",2)} GB
- 专用:{telecom.convert_flow(summary['specialUse'],"GB",2)} / {telecom.convert_flow(summary['specialTotal'],"GB",2)} GB
【流量包明细】
Expand Down

0 comments on commit 006ed15

Please sign in to comment.