|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Aside;
|
|
|
|
namespace App\Http\Controllers\Aside\Ai;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Http\Controllers\Aside\BaseController;
|
|
|
|
use App\Http\Logic\Aside\Ai\AiCommandLogic;
|
|
|
|
use App\Http\Requests\Aside\Ai\AiCommandRequest;
|
|
|
|
use App\Models\AiCommand as AiCommandModel;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use function App\Helper\send_openai_msg;
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -24,13 +27,30 @@ class AiCommandController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :详情
|
|
|
|
* @return void
|
|
|
|
* @author :liyuhang
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public function info(Request $request,AiCommandLogic $aiCommandLogic){
|
|
|
|
$request->validate([
|
|
|
|
'id'=>'required'
|
|
|
|
],[
|
|
|
|
'id.required' => 'ID不能为空'
|
|
|
|
]);
|
|
|
|
$aiCommandLogic->ai_info();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @name
|
|
|
|
* @return void
|
|
|
|
* @author :liyuhang
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public function add(){
|
|
|
|
|
|
|
|
public function add(AiCommandRequest $request,AiCommandLogic $aiCommandLogic){
|
|
|
|
$request->validated();
|
|
|
|
$aiCommandLogic->ai_add();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -39,8 +59,14 @@ class AiCommandController extends BaseController |
|
|
|
* @author :liyuhang
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public function edit(){
|
|
|
|
|
|
|
|
public function edit(AiCommandRequest $request,AiCommandLogic $aiCommandLogic){
|
|
|
|
$request->validate([
|
|
|
|
'id'=>'required'
|
|
|
|
],[
|
|
|
|
'id.required' => 'ID不能为空'
|
|
|
|
]);
|
|
|
|
$aiCommandLogic->ai_edit();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -49,7 +75,13 @@ class AiCommandController extends BaseController |
|
|
|
* @author :liyuhang
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public function del(){
|
|
|
|
|
|
|
|
public function del(Request $request,AiCommandLogic $aiCommandLogic){
|
|
|
|
$request->validate([
|
|
|
|
'id'=>'required'
|
|
|
|
],[
|
|
|
|
'id.required' => 'ID不能为空'
|
|
|
|
]);
|
|
|
|
$aiCommandLogic->ai_del();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|