add 基地列表

This commit is contained in:
chenbo 2024-01-15 17:10:07 +08:00
parent 12b0e98a1c
commit 0d7e569cf8
1 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,49 @@
<?php
namespace app\api\controller;
use app\adminapi\lists\fence_house\FenceHouseLists;
use app\adminapi\logic\fence_house\FenceHouseLogic;
use app\adminapi\validate\fence_house\FenceHouseValidate;
class FenceHouseController extends BaseApiController
{
public function lists()
{
return $this->dataLists(new FenceHouseLists());
}
public function add()
{
$params = (new FenceHouseValidate())->post()->goCheck('add');
$result = FenceHouseLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(FenceHouseLogic::getError());
}
/**
* @notes 编辑
* @return \think\response\Json
* @author likeadmin
* @date 2024/01/10 15:15
*/
public function edit()
{
$params = (new FenceHouseValidate())->post()->goCheck('edit');
$result = FenceHouseLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(FenceHouseLogic::getError());
}
public function detail()
{
$params = (new FenceHouseValidate())->goCheck('detail');
$result = FenceHouseLogic::detail($params);
return $this->data($result);
}
}