租户容量
This commit is contained in:
parent
03c44645c5
commit
6267fd5b5a
|
@ -44,7 +44,7 @@ public interface RegexConstants extends RegexPool {
|
||||||
/**
|
/**
|
||||||
* 密码:包含至少8个字符,包括大写字母、小写字母、数字和特殊字符
|
* 密码:包含至少8个字符,包括大写字母、小写字母、数字和特殊字符
|
||||||
*/
|
*/
|
||||||
String PASSWORD = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{8,}$";
|
String PASSWORD = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&;])[A-Za-z\\d@$!%*?&;]{8,}$";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用状态(0表示正常,1表示停用)
|
* 通用状态(0表示正常,1表示停用)
|
||||||
|
|
|
@ -3,9 +3,11 @@ package org.dromara.system.controller.system;
|
||||||
import cn.dev33.satoken.secure.BCrypt;
|
import cn.dev33.satoken.secure.BCrypt;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.utils.file.MimeTypeUtils;
|
import org.dromara.common.core.utils.file.MimeTypeUtils;
|
||||||
|
import org.dromara.common.core.utils.regex.RegexValidator;
|
||||||
import org.dromara.common.encrypt.annotation.ApiEncrypt;
|
import org.dromara.common.encrypt.annotation.ApiEncrypt;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
@ -19,9 +21,7 @@ import org.dromara.system.domain.vo.ProfileVo;
|
||||||
import org.dromara.system.domain.vo.SysOssVo;
|
import org.dromara.system.domain.vo.SysOssVo;
|
||||||
import org.dromara.system.domain.vo.SysUserVo;
|
import org.dromara.system.domain.vo.SysUserVo;
|
||||||
import org.dromara.system.service.ISysOssService;
|
import org.dromara.system.service.ISysOssService;
|
||||||
import org.dromara.system.service.ISysRoleService;
|
|
||||||
import org.dromara.system.service.ISysUserService;
|
import org.dromara.system.service.ISysUserService;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -86,6 +86,11 @@ public class SysProfileController extends BaseController {
|
||||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/updatePwd")
|
@PutMapping("/updatePwd")
|
||||||
public R<Void> updatePwd(@Validated @RequestBody SysUserPasswordBo bo) {
|
public R<Void> updatePwd(@Validated @RequestBody SysUserPasswordBo bo) {
|
||||||
|
|
||||||
|
String newPassword = bo.getNewPassword();
|
||||||
|
if (!RegexValidator.isPassword(newPassword)) {
|
||||||
|
return R.fail("修改密码失败,新密码复杂度不合规");
|
||||||
|
}
|
||||||
SysUserVo user = userService.selectUserById(LoginHelper.getUserId());
|
SysUserVo user = userService.selectUserById(LoginHelper.getUserId());
|
||||||
String password = user.getPassword();
|
String password = user.getPassword();
|
||||||
if (!BCrypt.checkpw(bo.getOldPassword(), password)) {
|
if (!BCrypt.checkpw(bo.getOldPassword(), password)) {
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
package org.dromara.system.domain.bo;
|
package org.dromara.system.domain.bo;
|
||||||
|
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
|
||||||
import org.dromara.system.domain.SysTenant;
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import jakarta.validation.constraints.*;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.system.domain.SysTenant;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 租户业务对象 sys_tenant
|
* 租户业务对象 sys_tenant
|
||||||
*
|
*
|
||||||
|
@ -109,6 +109,10 @@ public class SysTenantBo extends BaseEntity {
|
||||||
* 租户状态(0正常 1停用)
|
* 租户状态(0正常 1停用)
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
@NotNull(message = "我的空间总容量不能为空", groups = { AddGroup.class })
|
||||||
|
private Long personTotalVolume;
|
||||||
|
@NotNull(message = "学校资源总容量不能为空", groups = { AddGroup.class })
|
||||||
|
private Long schoolTotalVolume;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,18 +201,18 @@ public class SysTenantServiceImpl implements ISysTenantService {
|
||||||
catalogResource.setCreateDept(deptId);
|
catalogResource.setCreateDept(deptId);
|
||||||
catalogResourceMapper.insert(catalogResource);
|
catalogResourceMapper.insert(catalogResource);
|
||||||
//创建资源空间大小
|
//创建资源空间大小
|
||||||
long volume = 1024L * 1024L * 1024L * 1024L;
|
//long volume = 1073741824L * 1024L;
|
||||||
SysOssVolume personVolume = new SysOssVolume();
|
SysOssVolume personVolume = new SysOssVolume();
|
||||||
personVolume.setTenantId(tenantId);
|
personVolume.setTenantId(tenantId);
|
||||||
personVolume.setType(2);
|
personVolume.setType(2);
|
||||||
personVolume.setTotalVolume(volume);
|
personVolume.setTotalVolume(bo.getPersonTotalVolume());
|
||||||
personVolume.setCreateBy(user.getUserId());
|
personVolume.setCreateBy(user.getUserId());
|
||||||
personVolume.setCreateDept(deptId);
|
personVolume.setCreateDept(deptId);
|
||||||
ossVolumeMapper.insert(personVolume);
|
ossVolumeMapper.insert(personVolume);
|
||||||
SysOssVolume schoolVolume = new SysOssVolume();
|
SysOssVolume schoolVolume = new SysOssVolume();
|
||||||
schoolVolume.setTenantId(tenantId);
|
schoolVolume.setTenantId(tenantId);
|
||||||
schoolVolume.setType(1);
|
schoolVolume.setType(1);
|
||||||
schoolVolume.setTotalVolume(volume);
|
schoolVolume.setTotalVolume(bo.getSchoolTotalVolume());
|
||||||
schoolVolume.setCreateBy(user.getUserId());
|
schoolVolume.setCreateBy(user.getUserId());
|
||||||
schoolVolume.setCreateDept(deptId);
|
schoolVolume.setCreateDept(deptId);
|
||||||
ossVolumeMapper.insert(schoolVolume);
|
ossVolumeMapper.insert(schoolVolume);
|
||||||
|
|
Loading…
Reference in New Issue