first commit
This commit is contained in:
94
app/adminapi/controller/user/UserGroupRuleController.php
Normal file
94
app/adminapi/controller/user/UserGroupRuleController.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
namespace app\adminapi\controller\user;
|
||||
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\user\UserGroupRuleLists;
|
||||
use app\adminapi\logic\user\UserGroupRuleLogic;
|
||||
use app\adminapi\validate\user\UserGroupRuleValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 分组规则控制器
|
||||
* Class UserGroupRuleController
|
||||
* @package app\adminapi\controller\user
|
||||
*/
|
||||
class UserGroupRuleController extends BaseAdminController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取分组规则列表
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2024/04/25 01:30
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new UserGroupRuleLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加分组规则
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2024/04/25 01:30
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new UserGroupRuleValidate())->post()->goCheck('add');
|
||||
$result = UserGroupRuleLogic::add($params);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(UserGroupRuleLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑分组规则
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2024/04/25 01:30
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new UserGroupRuleValidate())->post()->goCheck('edit');
|
||||
$result = UserGroupRuleLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(UserGroupRuleLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除分组规则
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2024/04/25 01:30
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new UserGroupRuleValidate())->post()->goCheck('delete');
|
||||
UserGroupRuleLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取分组规则详情
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2024/04/25 01:30
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new UserGroupRuleValidate())->goCheck('detail');
|
||||
$result = UserGroupRuleLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user