|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @remark :
|
|
|
|
* @name :GeoArticleController.php
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/7/14 16:19
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Aside\Geo;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Http\Controllers\Aside\BaseController;
|
|
|
|
use App\Http\Logic\Aside\Geo\GeoArticleLogic;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :GEO文章列表数据
|
|
|
|
* @name :GeoArticleController
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/7/14 16:19
|
|
|
|
*/
|
|
|
|
class GeoArticleController extends BaseController
|
|
|
|
{
|
|
|
|
public function __construct(Request $request)
|
|
|
|
{
|
|
|
|
parent::__construct($request);
|
|
|
|
$this->logic = new GeoArticleLogic();
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @remark :文章列表数据
|
|
|
|
* @name :lists
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/7/14 16:22
|
|
|
|
*/
|
|
|
|
public function lists(){
|
|
|
|
$this->request->validate([
|
|
|
|
'project_id'=>'required',
|
|
|
|
],[
|
|
|
|
'project_id.required' => '项目ID不能为空',
|
|
|
|
]);
|
|
|
|
$lists = $this->logic->getArticleList($this->map,$this->page,$this->row,$this->order);
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取数据详情
|
|
|
|
* @name :info
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/7/14 17:05
|
|
|
|
*/
|
|
|
|
public function info(){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>'required',
|
|
|
|
],[
|
|
|
|
'id.required' => 'ID不能为空',
|
|
|
|
]);
|
|
|
|
$data = $this->logic->getArticleInfo();
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存数据
|
|
|
|
* @name :save
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/7/14 17:05
|
|
|
|
*/
|
|
|
|
public function save(){
|
|
|
|
$this->request->validate([
|
|
|
|
'project_id'=>'required',
|
|
|
|
'data'=>'required|array'
|
|
|
|
],[
|
|
|
|
'project_id.required' => '项目ID不能为空',
|
|
|
|
'data.required' => '数据详情不能为空',
|
|
|
|
'data.array' => '数据详情为数组',
|
|
|
|
]);
|
|
|
|
$data = $this->logic->saveArticle();
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :删除数据
|
|
|
|
* @name :del
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/7/14 17:05
|
|
|
|
*/
|
|
|
|
public function del(){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>'required',
|
|
|
|
],[
|
|
|
|
'id.required' => 'ID不能为空',
|
|
|
|
]);
|
|
|
|
$data = $this->logic->delArticle();
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|