|
@@ -11,12 +11,14 @@ namespace App\Http\Controllers\Api\WorkOrder; |
|
@@ -11,12 +11,14 @@ namespace App\Http\Controllers\Api\WorkOrder; |
|
11
|
|
11
|
|
|
12
|
use App\Enums\Common\Code;
|
12
|
use App\Enums\Common\Code;
|
|
13
|
use App\Http\Controllers\Api\BaseController;
|
13
|
use App\Http\Controllers\Api\BaseController;
|
|
|
|
14
|
+use App\Models\Ai\AiCommand;
|
|
14
|
use App\Models\Blog\BlogCategory;
|
15
|
use App\Models\Blog\BlogCategory;
|
|
15
|
use App\Models\News\NewsCategory;
|
16
|
use App\Models\News\NewsCategory;
|
|
16
|
use App\Models\Product\Category;
|
17
|
use App\Models\Product\Category;
|
|
17
|
use App\Models\Product\Keyword;
|
18
|
use App\Models\Product\Keyword;
|
|
18
|
use App\Models\RouteMap\RouteMap;
|
19
|
use App\Models\RouteMap\RouteMap;
|
|
19
|
use App\Models\Ticket\TicketUploadData;
|
20
|
use App\Models\Ticket\TicketUploadData;
|
|
|
|
21
|
+use App\Services\AiCommandService;
|
|
20
|
use App\Services\ProjectServer;
|
22
|
use App\Services\ProjectServer;
|
|
21
|
use Illuminate\Http\Request;
|
23
|
use Illuminate\Http\Request;
|
|
22
|
use Illuminate\Support\Facades\DB;
|
24
|
use Illuminate\Support\Facades\DB;
|
|
@@ -431,4 +433,30 @@ class TicketUploadDataController extends BaseController |
|
@@ -431,4 +433,30 @@ class TicketUploadDataController extends BaseController |
|
431
|
return ['id'=>$id,'title'=>$title];
|
433
|
return ['id'=>$id,'title'=>$title];
|
|
432
|
}
|
434
|
}
|
|
433
|
}
|
435
|
}
|
|
|
|
436
|
+
|
|
|
|
437
|
+ /**
|
|
|
|
438
|
+ * @remark :根据指令获取内容
|
|
|
|
439
|
+ * @name :sendLayoutDesign
|
|
|
|
440
|
+ * @author :lyh
|
|
|
|
441
|
+ * @method :post
|
|
|
|
442
|
+ * @time :2025/5/26 17:39
|
|
|
|
443
|
+ */
|
|
|
|
444
|
+ public function sendLayoutDesign(){
|
|
|
|
445
|
+ $this->request->validate([
|
|
|
|
446
|
+ 'html'=>['required'],
|
|
|
|
447
|
+ 'project_id'=>['project_id']
|
|
|
|
448
|
+ ],[
|
|
|
|
449
|
+ 'html.required' => 'html不能为空',
|
|
|
|
450
|
+ 'project_id.required' => '项目ID不能为空',
|
|
|
|
451
|
+ ]);
|
|
|
|
452
|
+ $aiCommonModel = new AiCommand();
|
|
|
|
453
|
+ $info = $aiCommonModel->read(['key'=>'ai_layout_design','project_id'=>$this->param['project_id']],['ai']);
|
|
|
|
454
|
+ if($info === false){
|
|
|
|
455
|
+ $info = $aiCommonModel->read(['key'=>'ai_layout_design','project_id'=>0],['ai']);
|
|
|
|
456
|
+ }
|
|
|
|
457
|
+ $aiCommandService = new AiCommandService();
|
|
|
|
458
|
+ $ai = str_replace('{html}',$this->param['html'],$info['ai']);
|
|
|
|
459
|
+ $result = $aiCommandService->send_layout_design($ai);
|
|
|
|
460
|
+ $this->response('success', Code::SUCCESS, $result);
|
|
|
|
461
|
+ }
|
|
434
|
} |
462
|
} |