正在显示
4 个修改的文件
包含
160 行增加
和
0 行删除
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :V6UpdateLogController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/5/9 16:04 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Aside\Com; | ||
| 11 | + | ||
| 12 | +use App\Enums\Common\Code; | ||
| 13 | +use App\Http\Controllers\Aside\BaseController; | ||
| 14 | +use App\Http\Logic\Aside\Com\V6UpdateLogLogic; | ||
| 15 | +use App\Models\Com\V6UpdateLog; | ||
| 16 | + | ||
| 17 | +class V6UpdateLogController extends BaseController | ||
| 18 | +{ | ||
| 19 | + /** | ||
| 20 | + * @remark :更新日志 | ||
| 21 | + * @name :lists | ||
| 22 | + * @author :lyh | ||
| 23 | + * @method :post | ||
| 24 | + * @time :2024/5/9 16:05 | ||
| 25 | + */ | ||
| 26 | + public function lists(V6UpdateLog $logModel){ | ||
| 27 | + $lists = $logModel->lists($this->map,$this->page,$this->row,$this->order); | ||
| 28 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * @remark :保存数据 | ||
| 33 | + * @name :save | ||
| 34 | + * @author :lyh | ||
| 35 | + * @method :post | ||
| 36 | + * @time :2024/5/9 16:23 | ||
| 37 | + */ | ||
| 38 | + public function save(V6UpdateLogLogic $logic){ | ||
| 39 | + $this->request->validate([ | ||
| 40 | + 'version_id' => 'required', | ||
| 41 | + 'remark' => 'required', | ||
| 42 | + 'updated_date' => 'required', | ||
| 43 | + ], [ | ||
| 44 | + 'version_id.required' => '版本号version_id不能为空', | ||
| 45 | + 'remark.required' => '更新内容不能为空', | ||
| 46 | + 'updated_date.required' => '更新时间不能为空', | ||
| 47 | + ]); | ||
| 48 | + $data = $logic->saveV6UpdateLog(); | ||
| 49 | + $this->response('success',Code::SUCCESS,$data); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * @remark :删除数据 | ||
| 54 | + * @name :del | ||
| 55 | + * @author :lyh | ||
| 56 | + * @method :post | ||
| 57 | + * @time :2024/5/9 16:30 | ||
| 58 | + */ | ||
| 59 | + public function del(V6UpdateLogLogic $logic){ | ||
| 60 | + $this->request->validate([ | ||
| 61 | + 'id' => 'required', | ||
| 62 | + ], [ | ||
| 63 | + 'id.required' => 'id不能为空', | ||
| 64 | + ]); | ||
| 65 | + $logic->delV6UpdateLog(); | ||
| 66 | + $this->response('success'); | ||
| 67 | + } | ||
| 68 | +} |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :V6UpdateLogLogic.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/5/9 16:06 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Logic\Aside\Com; | ||
| 11 | + | ||
| 12 | +use App\Http\Logic\Aside\BaseLogic; | ||
| 13 | +use App\Models\Com\V6UpdateLog; | ||
| 14 | + | ||
| 15 | +class V6UpdateLogLogic extends BaseLogic | ||
| 16 | +{ | ||
| 17 | + public function __construct() | ||
| 18 | + { | ||
| 19 | + parent::__construct(); | ||
| 20 | + $this->model = new V6UpdateLog(); | ||
| 21 | + $this->param = $this->requestAll; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * @remark :保存数据 | ||
| 26 | + * @name :saveV6UpdateLog | ||
| 27 | + * @author :lyh | ||
| 28 | + * @method :post | ||
| 29 | + * @time :2024/5/9 16:25 | ||
| 30 | + */ | ||
| 31 | + public function saveV6UpdateLog(){ | ||
| 32 | + $this->param['operator_id'] = $this->manager['id']; | ||
| 33 | + try { | ||
| 34 | + if(isset($this->param['id']) && !empty($this->param['id'])){ | ||
| 35 | + $id = $this->param['id']; | ||
| 36 | + $this->model->edit($this->param,['id'=>$id]); | ||
| 37 | + }else{ | ||
| 38 | + $id = $this->model->addReturnId($this->param); | ||
| 39 | + } | ||
| 40 | + }catch (\Exception $e){ | ||
| 41 | + $this->fail('保存失败,请联系管理员'); | ||
| 42 | + } | ||
| 43 | + return $this->success(['id'=>$id]); | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * @remark :删除更新记录 | ||
| 48 | + * @name :delV6UpdateLog | ||
| 49 | + * @author :lyh | ||
| 50 | + * @method :post | ||
| 51 | + * @time :2024/5/9 16:32 | ||
| 52 | + */ | ||
| 53 | + public function delV6UpdateLog(){ | ||
| 54 | + try { | ||
| 55 | + $this->model->del($this->param); | ||
| 56 | + }catch (\Exception $e){ | ||
| 57 | + $this->fail('删除失败,请联系管理员'); | ||
| 58 | + } | ||
| 59 | + return $this->success(); | ||
| 60 | + } | ||
| 61 | +} |
app/Models/Com/V6UpdateLog.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :V6UpdateLog.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/5/9 16:08 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Models\Com; | ||
| 11 | + | ||
| 12 | +use App\Models\Base; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * @remark : | ||
| 16 | + * @name :V6UpdateLog | ||
| 17 | + * @author :lyh | ||
| 18 | + * @method :post | ||
| 19 | + * @time :2024/5/9 16:09 | ||
| 20 | + */ | ||
| 21 | +class V6UpdateLog extends Base | ||
| 22 | +{ | ||
| 23 | + protected $table = 'gl_v6_update_log'; | ||
| 24 | +} |
| @@ -383,6 +383,13 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -383,6 +383,13 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 383 | Route::any('/reductionHtml', [Aside\Template\ReplaceHtmlController::class, 'reductionHtml'])->name('admin.replace_reductionHtml'); | 383 | Route::any('/reductionHtml', [Aside\Template\ReplaceHtmlController::class, 'reductionHtml'])->name('admin.replace_reductionHtml'); |
| 384 | }); | 384 | }); |
| 385 | 385 | ||
| 386 | + //可视化数据替换 | ||
| 387 | + Route::prefix('v6_update')->group(function () { | ||
| 388 | + Route::any('/', [Aside\Com\V6UpdateLogController::class, 'lists'])->name('admin.v6_update'); | ||
| 389 | + Route::any('/save', [Aside\Com\V6UpdateLogController::class, 'save'])->name('admin.v6_update_save'); | ||
| 390 | + Route::any('/del', [Aside\Com\V6UpdateLogController::class, 'del'])->name('admin.v6_update_del'); | ||
| 391 | + }); | ||
| 392 | + | ||
| 386 | Route::any('/generate_aicc_token', [Aside\Com\IndexController::class, 'generateAiCCToken'])->name('admin.generate_aicc_token'); | 393 | Route::any('/generate_aicc_token', [Aside\Com\IndexController::class, 'generateAiCCToken'])->name('admin.generate_aicc_token'); |
| 387 | Route::any('/getAutoToken', [Aside\Com\IndexController::class, 'getAutoToken'])->name('admin.getAutoToken'); | 394 | Route::any('/getAutoToken', [Aside\Com\IndexController::class, 'getAutoToken'])->name('admin.getAutoToken'); |
| 388 | }); | 395 | }); |
-
请 注册 或 登录 后发表评论