|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @remark :
|
|
|
|
* @name :NewsExtendController.php
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/5/26 15:05
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Bside\News;
|
|
|
|
|
|
|
|
use App\Http\Controllers\Bside\BaseController;
|
|
|
|
use App\Http\Logic\Bside\News\NewsExtendLogic;
|
|
|
|
use App\Models\News\NewsExtend;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
|
|
class NewsExtendController extends BaseController
|
|
|
|
{
|
|
|
|
public function __construct(Request $request)
|
|
|
|
{
|
|
|
|
parent::__construct($request);
|
|
|
|
$this->logic = new NewsExtendLogic();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取所有扩展字段
|
|
|
|
* @name :lists
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/5/26 15:08
|
|
|
|
*/
|
|
|
|
public function lists()
|
|
|
|
{
|
|
|
|
$lists = $this->logic->list($this->map);
|
|
|
|
$this->response('success', Code::SUCCESS, $lists);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存扩展字段
|
|
|
|
* @name :save
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/5/26 15:09
|
|
|
|
*/
|
|
|
|
public function save()
|
|
|
|
{
|
|
|
|
$this->request->validate([
|
|
|
|
'title' => 'required',
|
|
|
|
'type' => 'required',
|
|
|
|
], [
|
|
|
|
'title.required' => '字段名称不能为空',
|
|
|
|
'type.required' => '字段类型不能为空',
|
|
|
|
]);
|
|
|
|
$info = $this->logic->extendSave();
|
|
|
|
$this->response('success', Code::SUCCESS, $info);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|