正在显示
3 个修改的文件
包含
30 行增加
和
0 行删除
| @@ -23,6 +23,23 @@ class BTemplateModuleRandomController extends BaseController | @@ -23,6 +23,23 @@ class BTemplateModuleRandomController extends BaseController | ||
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | + * @remark :获取当前项目所有随机模块 | ||
| 27 | + * @name :getRandomList | ||
| 28 | + * @author :lyh | ||
| 29 | + * @method :post | ||
| 30 | + * @time :2025/5/27 16:00 | ||
| 31 | + */ | ||
| 32 | + public function getRandomList(){ | ||
| 33 | + $this->request->validate([ | ||
| 34 | + 'project_id'=>'required', | ||
| 35 | + ],[ | ||
| 36 | + 'project_id.required' => 'project_id不能为空', | ||
| 37 | + ]); | ||
| 38 | + $data = $this->logic->getRandomList(); | ||
| 39 | + $this->response('success',Code::SUCCESS,$data); | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + /** | ||
| 26 | * @remark :设置为随机模块 | 43 | * @remark :设置为随机模块 |
| 27 | * @name :saveRandomModule | 44 | * @name :saveRandomModule |
| 28 | * @author :lyh | 45 | * @author :lyh |
| @@ -46,6 +46,18 @@ class BTemplateModuleRandomLogic extends BaseLogic | @@ -46,6 +46,18 @@ class BTemplateModuleRandomLogic extends BaseLogic | ||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | /** | 48 | /** |
| 49 | + * @remark :获取当前项目的所有随机模块 | ||
| 50 | + * @name :getRandomList | ||
| 51 | + * @author :lyh | ||
| 52 | + * @method :post | ||
| 53 | + * @time :2025/5/27 15:59 | ||
| 54 | + */ | ||
| 55 | + public function getRandomList(){ | ||
| 56 | + $data = $this->model->list(['project_id'=>$this->user['project_id']],'id',['id','uuid','project_id','module_id']); | ||
| 57 | + return $this->success($data); | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + /** | ||
| 49 | * @remark :获取当前模块是否为随机模块 | 61 | * @remark :获取当前模块是否为随机模块 |
| 50 | * @name :getIsRandomModule | 62 | * @name :getIsRandomModule |
| 51 | * @author :lyh | 63 | * @author :lyh |
| @@ -446,6 +446,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -446,6 +446,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 446 | //随机模块 | 446 | //随机模块 |
| 447 | Route::prefix('random')->group(function () { | 447 | Route::prefix('random')->group(function () { |
| 448 | //获取所有左侧模版 | 448 | //获取所有左侧模版 |
| 449 | + Route::any('/getRandomList', [\App\Http\Controllers\Bside\Template\BTemplateModuleRandomController::class, 'getRandomList'])->name('template_random_getRandomList'); | ||
| 449 | 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'); |
| 450 | 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'); |
| 451 | }); | 452 | }); |
-
请 注册 或 登录 后发表评论