mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 07:03:53 +08:00
修复bug
--AdminController.java 重置密码添加返回新密码 --AdminPageUserDTO.java 取消参数验证 --SysUserServiceImpl.java 修改分页查询条件
This commit is contained in:
+4
-4
@@ -44,7 +44,7 @@ public class AdminController {
|
||||
AdminPageUserDTO dto = new AdminPageUserDTO();
|
||||
dto.setMobile((String) params.get("mobile"));
|
||||
dto.setLimit((String) params.get(Constant.LIMIT));
|
||||
dto.setPage((String) params.get(Constant.PAGE));
|
||||
dto.setPage((String) params.get("pages"));
|
||||
|
||||
ValidatorUtils.validateEntity(dto);
|
||||
PageData<AdminPageUserVO> page = sysUserService.page(dto);
|
||||
@@ -54,10 +54,10 @@ public class AdminController {
|
||||
@PutMapping("/users/{id}")
|
||||
@Operation(summary = "重置密码")
|
||||
@RequiresPermissions("sys:role:superAdmin")
|
||||
public Result<Void> update(
|
||||
public Result<String> update(
|
||||
@PathVariable Long id) {
|
||||
sysUserService.resetPassword(id);
|
||||
return new Result<>();
|
||||
String password = sysUserService.resetPassword(id);
|
||||
return new Result<String>().ok(password);
|
||||
}
|
||||
|
||||
@DeleteMapping("/users/{id}")
|
||||
|
||||
@@ -15,14 +15,11 @@ public class AdminPageUserDTO {
|
||||
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
@NotBlank(message = "")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "页数")
|
||||
@NotBlank(message = "")
|
||||
private String page;
|
||||
|
||||
@Schema(description = "显示列数")
|
||||
@NotBlank(message = "")
|
||||
private String limit;
|
||||
}
|
||||
|
||||
+4
-3
@@ -3,6 +3,7 @@ package xiaozhi.modules.sys.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import xiaozhi.common.constant.Constant;
|
||||
@@ -141,11 +142,11 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
|
||||
params.put(Constant.PAGE, dto.getPage());
|
||||
params.put(Constant.LIMIT,dto.getLimit());
|
||||
IPage<SysUserEntity> page = baseDao.selectPage(
|
||||
getPage(params, "sort", true),
|
||||
getPage(params, "id", true),
|
||||
//定义查询条件
|
||||
new QueryWrapper<SysUserEntity>()
|
||||
//必须按照ttsID查找
|
||||
.eq("username",dto.getMobile()));
|
||||
//必须按照手机号码查找
|
||||
.eq(StringUtils.isNotBlank(dto.getMobile()),"username",dto.getMobile()));
|
||||
List<AdminPageUserVO> list = page.getRecords().stream().map(user -> {
|
||||
AdminPageUserVO adminPageUserVO = new AdminPageUserVO();
|
||||
adminPageUserVO.setUserid(user.getId().toString());
|
||||
|
||||
Reference in New Issue
Block a user