|
@@ -371,7 +371,7 @@ class DeepSeekService
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private function getArtStylePromptByInput($inputArtStyle): string
|
|
|
|
|
|
|
+ public function getArtStylePromptByInput($inputArtStyle): string
|
|
|
{
|
|
{
|
|
|
$normalizedInput = $this->normalizeArtStyleInput($inputArtStyle);
|
|
$normalizedInput = $this->normalizeArtStyleInput($inputArtStyle);
|
|
|
if ($normalizedInput === '') {
|
|
if ($normalizedInput === '') {
|
|
@@ -2177,6 +2177,10 @@ class DeepSeekService
|
|
|
*/
|
|
*/
|
|
|
public function addChat($data) {
|
|
public function addChat($data) {
|
|
|
$uid = Site::getUid();
|
|
$uid = Site::getUid();
|
|
|
|
|
+ $anime_id = getProp($data, 'anime_id');
|
|
|
|
|
+ if (!$anime_id) Utils::throwError('20003:请选择对话');
|
|
|
|
|
+ $anime = DB::table('mp_animes')->where('id', $anime_id)->where('is_deleted', 0)->first();
|
|
|
|
|
+ if (!$anime) Utils::throwError('20003:对话不存在');
|
|
|
$file = getProp($data, 'file');
|
|
$file = getProp($data, 'file');
|
|
|
$content = getProp($data, 'content', '');
|
|
$content = getProp($data, 'content', '');
|
|
|
$bid = getProp($data, 'bid', 0);
|
|
$bid = getProp($data, 'bid', 0);
|
|
@@ -2480,6 +2484,7 @@ class DeepSeekService
|
|
|
$table_data = [
|
|
$table_data = [
|
|
|
'user_id' => $uid,
|
|
'user_id' => $uid,
|
|
|
'anime_name' => $anime_name,
|
|
'anime_name' => $anime_name,
|
|
|
|
|
+ 'model' => $model,
|
|
|
'intro' => isset($script_arr['intro']) ? $script_arr['intro'] : '',
|
|
'intro' => isset($script_arr['intro']) ? $script_arr['intro'] : '',
|
|
|
'highlights' => isset($script_arr['highlights']) ? $script_arr['highlights'] : '',
|
|
'highlights' => isset($script_arr['highlights']) ? $script_arr['highlights'] : '',
|
|
|
'role_relationship' => isset($script_arr['role_relationship']) ? $script_arr['role_relationship'] : '',
|
|
'role_relationship' => isset($script_arr['role_relationship']) ? $script_arr['role_relationship'] : '',
|
|
@@ -2494,7 +2499,7 @@ class DeepSeekService
|
|
|
// 'episode_num' => count($script_arr['episodes']),
|
|
// 'episode_num' => count($script_arr['episodes']),
|
|
|
'is_multi' => $is_multi,
|
|
'is_multi' => $is_multi,
|
|
|
'generate_status' => '待执行',
|
|
'generate_status' => '待执行',
|
|
|
- 'created_at' => date('Y-m-d H:i:s'),
|
|
|
|
|
|
|
+ // 'created_at' => date('Y-m-d H:i:s'),
|
|
|
'updated_at' => date('Y-m-d H:i:s')
|
|
'updated_at' => date('Y-m-d H:i:s')
|
|
|
];
|
|
];
|
|
|
|
|
|
|
@@ -2502,9 +2507,9 @@ class DeepSeekService
|
|
|
try {
|
|
try {
|
|
|
DB::beginTransaction();
|
|
DB::beginTransaction();
|
|
|
$now = date('Y-m-d H:i:s');
|
|
$now = date('Y-m-d H:i:s');
|
|
|
- // 新建动漫大纲
|
|
|
|
|
- $anime_id = DB::table('mp_animes')->insertGetId($table_data);
|
|
|
|
|
- if (!$anime_id) {
|
|
|
|
|
|
|
+ // 更新动漫大纲
|
|
|
|
|
+ $boolen = DB::table('mp_animes')->where('id', $anime_id)->update($table_data);
|
|
|
|
|
+ if (!$boolen) {
|
|
|
dLog('deepseek')->info('对话保存失败', $table_data);
|
|
dLog('deepseek')->info('对话保存失败', $table_data);
|
|
|
Utils::throwError('20003:对话保存失败');
|
|
Utils::throwError('20003:对话保存失败');
|
|
|
}
|
|
}
|