93 lines
2.2 KiB
PHP
93 lines
2.2 KiB
PHP
<?php
|
|
namespace app\adminapi\controller\custom;
|
|
|
|
use app\adminapi\controller\BaseAdminController;
|
|
use app\adminapi\lists\custom\CustomFollowLists;
|
|
use app\adminapi\logic\custom\CustomFollowLogic;
|
|
use app\adminapi\validate\custom\CustomFollowValidate;
|
|
|
|
|
|
/**
|
|
* CustomFollow控制器
|
|
* Class CustomFollowController
|
|
* @package app\adminapi\controller\custom_follow
|
|
*/
|
|
class CustomFollowController extends BaseAdminController
|
|
{
|
|
|
|
|
|
/**
|
|
* @notes 获取列表
|
|
* @return \think\response\Json
|
|
* @author likeadmin
|
|
* @date 2023/11/12 13:40
|
|
*/
|
|
public function lists()
|
|
{
|
|
return $this->dataLists(new CustomFollowLists());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 添加
|
|
* @return \think\response\Json
|
|
* @author likeadmin
|
|
* @date 2023/11/12 13:40
|
|
*/
|
|
public function add()
|
|
{
|
|
$params = (new CustomFollowValidate())->post()->goCheck('add');
|
|
$result = CustomFollowLogic::add($params,$this->adminId);
|
|
if (true === $result) {
|
|
return $this->success('添加成功', [], 1, 1);
|
|
}
|
|
return $this->fail(CustomFollowLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 编辑
|
|
* @return \think\response\Json
|
|
* @author likeadmin
|
|
* @date 2023/11/12 13:40
|
|
*/
|
|
public function edit()
|
|
{
|
|
$params = (new CustomFollowValidate())->post()->goCheck('edit');
|
|
$result = CustomFollowLogic::edit($params,$this->adminId);
|
|
if (true === $result) {
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
}
|
|
return $this->fail(CustomFollowLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 删除
|
|
* @return \think\response\Json
|
|
* @author likeadmin
|
|
* @date 2023/11/12 13:40
|
|
*/
|
|
public function delete()
|
|
{
|
|
$params = (new CustomFollowValidate())->post()->goCheck('delete');
|
|
CustomFollowLogic::delete($params);
|
|
return $this->success('删除成功', [], 1, 1);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取详情
|
|
* @return \think\response\Json
|
|
* @author likeadmin
|
|
* @date 2023/11/12 13:40
|
|
*/
|
|
public function detail()
|
|
{
|
|
$params = (new CustomFollowValidate())->goCheck('detail');
|
|
$result = CustomFollowLogic::detail($params);
|
|
return $this->data($result);
|
|
}
|
|
|
|
|
|
} |