作者 lyh

gx

  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :TutorialController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2024/5/13 17:36
  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\Tutorial\TutorialLogic;
  15 +use App\Models\Tutorial\Tutorial;
  16 +
  17 +/**
  18 + * @remark :oa教程
  19 + * @name :TutorialController
  20 + * @author :lyh
  21 + * @method :post
  22 + * @time :2024/5/13 17:36
  23 + */
  24 +class TutorialController extends BaseController
  25 +{
  26 + /**
  27 + * @remark :oa列表
  28 + * @name :lists
  29 + * @author :lyh
  30 + * @method :post
  31 + * @time :2024/5/13 17:36
  32 + */
  33 + public function lists(Tutorial $tutorial){
  34 + $this->map['status'] = 0;
  35 + $data = $tutorial->lists($this->map,$this->page,$this->row,$this->order);
  36 + $this->response('success',Code::SUCCESS,$data);
  37 + }
  38 +
  39 + /**
  40 + * @remark :保存数据
  41 + * @name :save
  42 + * @author :lyh
  43 + * @method :post
  44 + * @time :2024/5/13 17:39
  45 + */
  46 + public function save(TutorialLogic $logic){
  47 + $this->request->validate([
  48 + 'name'=>'required',
  49 + 'url'=>'required',
  50 + ], [
  51 + 'name.required' => '标识name不为空',
  52 + 'url.required' => '标识url不为空',
  53 + ]);
  54 + $data = $logic->saveTutorial();
  55 + $this->response('success',Code::SUCCESS,$data);
  56 + }
  57 +
  58 + /**
  59 + * @remark :修改状态
  60 + * @name :status
  61 + * @author :lyh
  62 + * @method :post
  63 + * @time :2024/5/13 17:40
  64 + */
  65 + public function status(TutorialLogic $logic){
  66 + $this->request->validate([
  67 + 'id'=>'required',
  68 + 'status'=>'required',
  69 + ], [
  70 + 'id.required' => '标识id不为空',
  71 + 'status.required' => '标识status不为空',
  72 + ]);
  73 + $data = $logic->statusTutorial();
  74 + $this->response('success',Code::SUCCESS,$data);
  75 + }
  76 +
  77 + /**
  78 + * @remark :删除数据
  79 + * @name :del
  80 + * @author :lyh
  81 + * @method :post
  82 + * @time :2024/5/13 17:40
  83 + */
  84 + public function del(TutorialLogic $logic){
  85 + $this->request->validate([
  86 + 'id'=>'required',
  87 + ], [
  88 + 'id.required' => '标识id不为空',
  89 + ]);
  90 + $data = $logic->delTutorial();
  91 + $this->response('success',Code::SUCCESS,$data);
  92 + }
  93 +}
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :TutorialLogic.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2024/5/13 17:38
  8 + */
  9 +
  10 +namespace App\Http\Logic\Aside\Tutorial;
  11 +
  12 +use App\Http\Logic\Aside\BaseLogic;
  13 +use App\Models\Tutorial\Tutorial;
  14 +
  15 +class TutorialLogic extends BaseLogic
  16 +{
  17 + public function __construct()
  18 + {
  19 + parent::__construct();
  20 + $this->model = new Tutorial();
  21 + $this->param = $this->requestAll;
  22 + }
  23 +
  24 + /**
  25 + * @remark :保存数据
  26 + * @name :saveTutorial
  27 + * @author :lyh
  28 + * @method :post
  29 + * @time :2024/5/13 17:39
  30 + */
  31 + public function saveTutorial(){
  32 + return $this->success();
  33 + }
  34 +
  35 + /**
  36 + * @remark :修改状态
  37 + * @name :statusTutorial
  38 + * @author :lyh
  39 + * @method :post
  40 + * @time :2024/5/13 17:42
  41 + */
  42 + public function statusTutorial(){
  43 + return $this->success();
  44 + }
  45 +
  46 + /**
  47 + * @remark :删除数据
  48 + * @name :delTutorial
  49 + * @author :lyh
  50 + * @method :post
  51 + * @time :2024/5/13 17:41
  52 + */
  53 + public function delTutorial(){
  54 + return $this->success();
  55 + }
  56 +}
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :Tutorial.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2024/5/13 17:34
  8 + */
  9 +
  10 +namespace App\Models\Tutorial;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +/**
  15 + * @remark :oa教程
  16 + * @name :Tutorial
  17 + * @author :lyh
  18 + * @method :post
  19 + * @time :2024/5/13 17:34
  20 + */
  21 +class Tutorial extends Base
  22 +{
  23 + protected $table = 'gl_tutorial';
  24 +}