合并分支 'lyh-server' 到 'master'
gx添加随机模块 查看合并请求 !2053
正在显示
4 个修改的文件
包含
29 行增加
和
6 行删除
| @@ -71,17 +71,28 @@ class BTemplateModuleRandomController extends BaseController | @@ -71,17 +71,28 @@ class BTemplateModuleRandomController extends BaseController | ||
| 71 | */ | 71 | */ |
| 72 | public function getRandomInfo(){ | 72 | public function getRandomInfo(){ |
| 73 | $this->request->validate([ | 73 | $this->request->validate([ |
| 74 | - 'module_id'=>'required', | ||
| 75 | 'uuid'=>'required', | 74 | 'uuid'=>'required', |
| 76 | - 'project_id'=>'required', | ||
| 77 | ],[ | 75 | ],[ |
| 78 | - 'module_id.required' => '左侧模块id不能为空', | ||
| 79 | 'uuid.required' => 'uuid唯一不能为空', | 76 | 'uuid.required' => 'uuid唯一不能为空', |
| 80 | - 'project_id.required' => 'project_id不能为空', | ||
| 81 | ]); | 77 | ]); |
| 82 | $data = $this->logic->getRandomInfo(); | 78 | $data = $this->logic->getRandomInfo(); |
| 83 | $this->response('success',Code::SUCCESS,$data); | 79 | $this->response('success',Code::SUCCESS,$data); |
| 84 | } | 80 | } |
| 85 | 81 | ||
| 86 | - | 82 | + /** |
| 83 | + * @remark :删除随机模块 | ||
| 84 | + * @name :delRandom | ||
| 85 | + * @author :lyh | ||
| 86 | + * @method :post | ||
| 87 | + * @time :2025/5/27 17:59 | ||
| 88 | + */ | ||
| 89 | + public function delRandom(){ | ||
| 90 | + $this->request->validate([ | ||
| 91 | + 'uuid'=>'required', | ||
| 92 | + ],[ | ||
| 93 | + 'uuid.required' => 'uuid唯一不能为空', | ||
| 94 | + ]); | ||
| 95 | + $data = $this->logic->delRandom(); | ||
| 96 | + $this->response('success',Code::SUCCESS,$data); | ||
| 97 | + } | ||
| 87 | } | 98 | } |
| @@ -71,4 +71,16 @@ class BTemplateModuleRandomLogic extends BaseLogic | @@ -71,4 +71,16 @@ class BTemplateModuleRandomLogic extends BaseLogic | ||
| 71 | } | 71 | } |
| 72 | return $this->success($info); | 72 | return $this->success($info); |
| 73 | } | 73 | } |
| 74 | + | ||
| 75 | + /** | ||
| 76 | + * @remark :删除数据 | ||
| 77 | + * @name :delRandom | ||
| 78 | + * @author :lyh | ||
| 79 | + * @method :post | ||
| 80 | + * @time :2025/5/27 18:04 | ||
| 81 | + */ | ||
| 82 | + public function delRandom(){ | ||
| 83 | + $res = $this->model->del(['uuid'=>$this->param['uuid']]); | ||
| 84 | + return $this->success($res); | ||
| 85 | + } | ||
| 74 | } | 86 | } |
| @@ -55,7 +55,6 @@ class AiCommandService | @@ -55,7 +55,6 @@ class AiCommandService | ||
| 55 | $data = preg_replace('/\s*```$/', '', $data); // 去除结尾 | 55 | $data = preg_replace('/\s*```$/', '', $data); // 去除结尾 |
| 56 | $data = str_replace("\\n", "\n", $data); | 56 | $data = str_replace("\\n", "\n", $data); |
| 57 | $data = str_replace('\"', '"', $data); | 57 | $data = str_replace('\"', '"', $data); |
| 58 | - | ||
| 59 | return ['data'=>$data]; | 58 | return ['data'=>$data]; |
| 60 | } | 59 | } |
| 61 | 60 |
| @@ -449,6 +449,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -449,6 +449,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 449 | Route::any('/getRandomList', [\App\Http\Controllers\Bside\Template\BTemplateModuleRandomController::class, 'getRandomList'])->name('template_random_getRandomList'); | 449 | Route::any('/getRandomList', [\App\Http\Controllers\Bside\Template\BTemplateModuleRandomController::class, 'getRandomList'])->name('template_random_getRandomList'); |
| 450 | Route::any('/getRandomInfo', [\App\Http\Controllers\Bside\Template\BTemplateModuleRandomController::class, 'getRandomInfo'])->name('template_random_getRandomInfo'); | 450 | Route::any('/getRandomInfo', [\App\Http\Controllers\Bside\Template\BTemplateModuleRandomController::class, 'getRandomInfo'])->name('template_random_getRandomInfo'); |
| 451 | Route::any('/saveRandomModule', [\App\Http\Controllers\Bside\Template\BTemplateModuleRandomController::class, 'saveRandomModule'])->name('template_random_saveRandomModule'); | 451 | Route::any('/saveRandomModule', [\App\Http\Controllers\Bside\Template\BTemplateModuleRandomController::class, 'saveRandomModule'])->name('template_random_saveRandomModule'); |
| 452 | + Route::any('/delRandom', [\App\Http\Controllers\Bside\Template\BTemplateModuleRandomController::class, 'delRandom'])->name('template_random_delRandom'); | ||
| 452 | }); | 453 | }); |
| 453 | //编辑记录 | 454 | //编辑记录 |
| 454 | Route::prefix('log')->group(function () { | 455 | Route::prefix('log')->group(function () { |
-
请 注册 或 登录 后发表评论