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