67 lines
1.5 KiB
PHP
67 lines
1.5 KiB
PHP
<?php
|
|
|
|
|
|
namespace app\admin\controller\user;
|
|
|
|
|
|
use app\admin\controller\BaseAdminController;
|
|
use app\admin\lists\user\UserLists;
|
|
use app\admin\logic\user\UserLogic;
|
|
use app\admin\validate\user\UserValidate;
|
|
|
|
class UserController extends BaseAdminController
|
|
{
|
|
/**
|
|
* @notes 用户列表
|
|
* @author 乔峰
|
|
* @date 2022//22 16:16
|
|
*/
|
|
public function lists()
|
|
{
|
|
return $this->dataLists(new UserLists());
|
|
}
|
|
|
|
/**
|
|
* @notes 添加用户列表
|
|
* @return \think\response\Json
|
|
* @author likeadmin
|
|
* @date 2024/04/25 10:20
|
|
*/
|
|
public function add()
|
|
{
|
|
$params = (new UserValidate())->post()->goCheck('add');
|
|
$result = UserLogic::add($params);
|
|
if (true === $result) {
|
|
return $this->success('添加成功', [], 1, 1);
|
|
}
|
|
return $this->fail(UserLogic::getError());
|
|
}
|
|
|
|
/**
|
|
* @notes 获取用户详情
|
|
* @author 乔峰
|
|
* @date 2022/9/22 16:34
|
|
*/
|
|
public function detail()
|
|
{
|
|
$params = (new UserValidate())->goCheck('detail');
|
|
$detail = UserLogic::detail($params['id']);
|
|
return $this->success('', $detail);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 编辑用户信息
|
|
* @author 乔峰
|
|
* @date 2022/9/22 16:34
|
|
*/
|
|
public function edit()
|
|
{
|
|
$params = (new UserValidate())->post()->goCheck('edit');
|
|
$result = UserLogic::edit($params);
|
|
if (true === $result) {
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
}
|
|
return $this->fail(UserLogic::getError());
|
|
}
|
|
} |