Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
open_ai_api
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
open_ai_api
Commits
5ac69d48
Commit
5ac69d48
authored
Apr 13, 2023
by
wangfa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务发送,下载回调完成
parent
fbe013a5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
app/Console/Commands/ReadDiscordMessageCommand.php
+1
-0
app/Jobs/DownloadImageJob.php
+2
-2
app/Jobs/ReadDiscordMessageJob.php
+2
-2
app/Service/TaskService.php
+3
-2
No files found.
app/Console/Commands/ReadDiscordMessageCommand.php
View file @
5ac69d48
...
...
@@ -22,6 +22,7 @@ public function handle()
if
(
filled
(
$data
))
{
$data
=
json_decode
(
$data
[
1
],
true
);
if
(
filled
(
$data
))
{
$this
->
info
(
"开始处理消息
{
$data
[
'message_content'
]
}
"
);
dispatch
(
new
ReadDiscordMessageJob
(
$data
));
}
}
...
...
app/Jobs/DownloadImageJob.php
View file @
5ac69d48
...
...
@@ -30,8 +30,8 @@ public function handle()
$data
=
$result
[
'data'
];
$updateData
=
[
'
result_img
_status'
=>
TaskService
::
STATUS_SUCCESS
,
'
resul
t_img'
=>
$data
[
0
]
??
''
,
'
cut
_status'
=>
TaskService
::
STATUS_SUCCESS
,
'
cu
t_img'
=>
$data
[
0
]
??
''
,
];
PromptTask
::
where
(
'id'
,
$this
->
data
[
'prompt_id'
])
->
update
(
$updateData
);
...
...
app/Jobs/ReadDiscordMessageJob.php
View file @
5ac69d48
...
...
@@ -33,8 +33,8 @@ public function handle()
$cachePrompt
=
Cache
::
get
(
$key
);
if
(
!
empty
(
$cachePrompt
))
{
$updateData
=
[
'
cut
_status'
=>
TaskService
::
STATUS_SUCCESS
,
'
cu
t_img'
=>
$data
[
'attachment_url'
],
'
result_img
_status'
=>
TaskService
::
STATUS_SUCCESS
,
'
resul
t_img'
=>
$data
[
'attachment_url'
],
];
PromptTask
::
where
(
'id'
,
$cachePrompt
[
'prompt_task_id'
])
->
update
(
$updateData
);
...
...
app/Service/TaskService.php
View file @
5ac69d48
...
...
@@ -350,9 +350,10 @@ public function create_split_img_task(int $user_id = 0, $data = [])
Redis
::
rpush
(
'discord_img_split'
,
json_encode
(
$list
));
}
else
{
$downloadData
=
[
'url'
=>
$prompt
->
cu
t_img
,
'url'
=>
$prompt
->
resul
t_img
,
'name'
=>
Str
::
uuid
()
->
toString
(),
'index'
=>
$cut_id
'index'
=>
$cut_id
,
'prompt_id'
=>
$prompt_id
,
];
dispatch
(
new
DownloadImageJob
(
$downloadData
));
}
...
...
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