@@ -78,6 +78,7 @@ public class TenantController { | |||
/** | |||
* 更新租户状态(1 启用 0禁用) | |||
* | |||
* @return | |||
*/ | |||
@PostMapping("/status") | |||
@@ -85,4 +86,16 @@ public class TenantController { | |||
return tenantService.updateStatus(dto, loginUser); | |||
} | |||
/** | |||
* 重置密码 | |||
* @param dto | |||
* @param loginUser | |||
* @return | |||
*/ | |||
@PostMapping("/reset") | |||
public JsonResult resetPassward(@RequestBody CreateClientTenantDto dto, @CurrentUser LoginUser loginUser) { | |||
return tenantService.resetPassward(dto, loginUser); | |||
} | |||
} |
@@ -50,4 +50,6 @@ public interface TenantService { | |||
* @return | |||
*/ | |||
JsonResult updateStatus(CreateClientTenantDto dto, LoginUser loginUser); | |||
JsonResult resetPassward(CreateClientTenantDto dto, LoginUser loginUser); | |||
} |
@@ -414,6 +414,26 @@ public class TenantServiceImpl implements TenantService { | |||
return JsonResult.success(dto); | |||
} | |||
/** | |||
* 重置密码 | |||
* | |||
* @param dto | |||
* @param loginUser | |||
* @return | |||
*/ | |||
@Override | |||
public JsonResult resetPassward(CreateClientTenantDto dto, LoginUser loginUser) { | |||
if (ObjectUtil.isNull(dto.getId())) { | |||
return JsonResult.error("租户id不能为空"); | |||
} | |||
TenantPo tenantPo = tenantMapper.selectById(dto.getId()); | |||
UserPo userPo = clientUserMapper.selectByUserId(tenantPo.getUserId()); | |||
userPo.setPassword(passward); | |||
clientUserMapper.updatePass(userPo); | |||
return JsonResult.success(); | |||
} | |||
/** | |||
* 更新租户状态(1 启用 0禁用) | |||
* | |||
@@ -713,5 +733,4 @@ public class TenantServiceImpl implements TenantService { | |||
} | |||
return JsonResult.success(); | |||
} | |||
} |