Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
A
aidso-data
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yaowentong
aidso-data
Commits
51904b4e
Commit
51904b4e
authored
Jun 23, 2026
by
Yaowentong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大盘接口
parent
43aeefeb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
dashboard.py
aidso_geo/core/routes/dashboard.py
+51
-0
feishu_interface.py
aidso_geo/core/routes/feishu_interface.py
+3
-0
No files found.
aidso_geo/core/routes/dashboard.py
View file @
51904b4e
...
...
@@ -3,6 +3,7 @@ from datetime import datetime
from
flask
import
jsonify
,
Blueprint
,
render_template
,
request
import
requests
from
aidso_geo.config.base_config
import
init_redis
from
aidso_geo.utils
import
bh_utils
dashboard_app
=
Blueprint
(
"dashboard"
,
__name__
)
...
...
@@ -82,6 +83,56 @@ def get_req_trend():
}),
500
@
dashboard_app
.
route
(
"/api/third/usage/latest"
,
methods
=
[
"GET"
])
def
third_usage_latest
():
latest_rows
=
bh_utils
.
query_data
(
"""
select sync_time
from geo_third_usage_snapshot
where sync_time is not null and sync_time != ''
order by sync_time desc
limit 1
"""
)
if
latest_rows
is
None
:
return
jsonify
({
"code"
:
500
,
"msg"
:
"query latest sync_time failed"
,
"data"
:
[]
}),
500
if
not
latest_rows
:
return
jsonify
({
"code"
:
200
,
"msg"
:
"ok"
,
"sync_time"
:
""
,
"data"
:
[]
})
sync_time
=
latest_rows
[
0
]
.
get
(
"sync_time"
)
data
=
bh_utils
.
query_data
(
"""
select channel, pt, daily_limit, total_limit, today_used, total_used,
today_remain, total_remain, sync_time, insertime
from geo_third_usage_snapshot
where sync_time =
%
s
order by channel asc
"""
,
(
sync_time
,))
if
data
is
None
:
return
jsonify
({
"code"
:
500
,
"msg"
:
"query third usage snapshot failed"
,
"sync_time"
:
sync_time
,
"data"
:
[]
}),
500
return
jsonify
({
"code"
:
200
,
"msg"
:
"ok"
,
"sync_time"
:
sync_time
,
"data"
:
data
})
def
normalize_date_to_datetime
(
value
,
default_time
):
date_value
=
value
.
replace
(
"T"
,
" "
)
.
strip
()[:
10
]
datetime
.
strptime
(
date_value
,
"
%
Y-
%
m-
%
d"
)
...
...
aidso_geo/core/routes/feishu_interface.py
View file @
51904b4e
...
...
@@ -331,7 +331,10 @@ def qian_report():
if
platform
and
not
isinstance
(
platform
,
list
):
return
fail
(
"platform必须是数组"
)
req_list
=
get_req_id
(
phone
,
begin
,
end
)
if
not
req_list
:
return
fail
(
"未查询到请求记录"
)
try
:
req_time_map
=
{}
req_brand_map
=
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment