Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ai
/
ai-workflow
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ab76ac94
authored
Jul 08, 2026
by
sunqi02
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: 更新课程推荐链接,优化推送消息内容生成逻辑
1 parent
e3853e3a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
workspace/agent-admin/backend/.env.example
workspace/agent-admin/backend/app/jobs/runner.py
workspace/agent-admin/backend/.env.example
View file @
ab76ac9
...
@@ -9,7 +9,7 @@ IM_API_KEY=
...
@@ -9,7 +9,7 @@ IM_API_KEY=
# 课程推荐(course-recommend skill)
# 课程推荐(course-recommend skill)
COURSE_DATABASE_URL=mysql://<MYSQL_USER>:<PASSWORD>@<HOST>:3307/dj_smartcarlife
COURSE_DATABASE_URL=mysql://<MYSQL_USER>:<PASSWORD>@<HOST>:3307/dj_smartcarlife
COURSE_BASE_URL=http://l
ocalhost:5173
COURSE_BASE_URL=http://l
essonjump.test.glsx.com.cn/
# 检索接口(query)
# 检索接口(query)
QUERY_URL=http://192.168.1.71:8104/wiki/query/json
QUERY_URL=http://192.168.1.71:8104/wiki/query/json
...
...
workspace/agent-admin/backend/app/jobs/runner.py
View file @
ab76ac9
from
__future__
import
annotations
from
__future__
import
annotations
import
logging
import
logging
import
os
import
time
import
time
from
datetime
import
datetime
from
datetime
import
datetime
...
@@ -22,6 +23,14 @@ from app.customer_info.service import CustomerInfoService
...
@@ -22,6 +23,14 @@ from app.customer_info.service import CustomerInfoService
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
_COURSE_BASE_URL
=
os
.
environ
.
get
(
"COURSE_BASE_URL"
,
""
)
.
rstrip
(
"/"
)
def
_push_content
(
record
)
->
str
:
"""生成推送消息内容,包含填写链接。"""
url
=
f
"{_COURSE_BASE_URL}/save?group_id={record.group_id}"
return
f
"【系统提醒】您还未绑定手机号,请点击下方链接完成绑定:
\n\n
{url}
\n
"
def
_build_services
():
def
_build_services
():
db
=
SessionLocal
()
db
=
SessionLocal
()
...
@@ -90,9 +99,8 @@ def _run_sync_customer_group_phones(service: CustomerInfoService) -> int:
...
@@ -90,9 +99,8 @@ def _run_sync_customer_group_phones(service: CustomerInfoService) -> int:
"""执行同步 + 同步触发推送。"""
"""执行同步 + 同步触发推送。"""
affected
=
service
.
sync_from_customer_groups
()
affected
=
service
.
sync_from_customer_groups
()
candidates
=
service
.
get_push_candidates
(
mode
=
"sync"
)
candidates
=
service
.
get_push_candidates
(
mode
=
"sync"
)
content
=
"【系统推送】推送信息填写链接"
for
record
in
candidates
:
for
record
in
candidates
:
if
_do_push
(
record
,
content
):
if
_do_push
(
record
,
_push_content
(
record
)
):
service
.
mark_pushed
(
record
)
service
.
mark_pushed
(
record
)
logger
.
info
(
"同步触发推送: candidates=
%
s"
,
len
(
candidates
))
logger
.
info
(
"同步触发推送: candidates=
%
s"
,
len
(
candidates
))
return
affected
return
affected
...
@@ -101,9 +109,8 @@ def _run_sync_customer_group_phones(service: CustomerInfoService) -> int:
...
@@ -101,9 +109,8 @@ def _run_sync_customer_group_phones(service: CustomerInfoService) -> int:
def
_run_daily_phone_push
(
service
:
CustomerInfoService
)
->
int
:
def
_run_daily_phone_push
(
service
:
CustomerInfoService
)
->
int
:
"""执行每日 9 点推送。"""
"""执行每日 9 点推送。"""
candidates
=
service
.
get_push_candidates
(
mode
=
"daily"
)
candidates
=
service
.
get_push_candidates
(
mode
=
"daily"
)
content
=
"【系统推送】推送信息填写链接"
for
record
in
candidates
:
for
record
in
candidates
:
if
_do_push
(
record
,
content
):
if
_do_push
(
record
,
_push_content
(
record
)
):
service
.
mark_pushed
(
record
)
service
.
mark_pushed
(
record
)
logger
.
info
(
"每日推送: pushed=
%
s"
,
len
(
candidates
))
logger
.
info
(
"每日推送: pushed=
%
s"
,
len
(
candidates
))
return
len
(
candidates
)
return
len
(
candidates
)
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment