系统用户管理
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.resp.CzgResult;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 店铺消息推送相关
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/shopMsgPush")
|
||||
public class ShopMsgPushController {
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.account.dto.user.SysUserAddDTO;
|
||||
import com.czg.account.dto.user.SysUserEditDTO;
|
||||
import com.czg.account.entity.SysUser;
|
||||
import com.czg.account.entity.SysUsersRoles;
|
||||
import com.czg.account.service.SysUserService;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.annotation.SaAdminCheckRole;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 系统用户管理
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/sysUser")
|
||||
public class SysController {
|
||||
@Resource
|
||||
private SysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 系统用户列表
|
||||
* @param key 名称或邮箱搜索
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param status 状态:1启用、0禁用
|
||||
* @return 分页数据
|
||||
*/
|
||||
// @SaAdminCheckPermission("sysUser:list")
|
||||
@SaAdminCheckRole("admin")
|
||||
@GetMapping
|
||||
public CzgResult<Page<SysUser>> list(String key, String startTime, String endTime, Integer status) {
|
||||
return CzgResult.success(sysUserService.getPage(key, startTime, endTime, status));
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统账号修改
|
||||
* @param sysUserEditDTO 修改信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
// @SaAdminCheckPermission("sysUser:edit")
|
||||
@SaAdminCheckRole("admin")
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit(@RequestBody @Validated SysUserEditDTO sysUserEditDTO) {
|
||||
return CzgResult.success(sysUserService.edit(sysUserEditDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统用户删除
|
||||
* @param id 用户id
|
||||
* @return 是否成功
|
||||
*/
|
||||
// @SaAdminCheckPermission("sysUser:del")
|
||||
@SaAdminCheckRole("admin")
|
||||
@DeleteMapping
|
||||
public CzgResult<Boolean> del(@RequestParam Integer id) {
|
||||
return CzgResult.success(sysUserService.delete(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统用户添加
|
||||
* @param sysUserAddDTO 添加信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckRole("admin")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> add(@RequestBody @Validated SysUserAddDTO sysUserAddDTO) {
|
||||
return CzgResult.success(sysUserService.add(sysUserAddDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统用户导出
|
||||
* @param key 名称或邮箱搜索
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param status 状态:1启用、0禁用
|
||||
* @throws IOException IO异常
|
||||
*/
|
||||
@SaAdminCheckRole("admin")
|
||||
@GetMapping("/download")
|
||||
public void download(String key, String startTime, String endTime, Integer status, HttpServletResponse response) throws IOException {
|
||||
sysUserService.download(key, startTime, endTime, status, response);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user