refactor: admin
This commit is contained in:
parent
bd2c04d272
commit
22b9cb5b98
@ -1,6 +1,7 @@
|
|||||||
package com.yzt.common.request;
|
package com.yzt.common.request;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.yzt.common.constants.RegularConstants;
|
import com.yzt.common.constants.RegularConstants;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@ -38,6 +39,9 @@ public class SystemAdminAddRequest implements Serializable {
|
|||||||
@Length(max = 32, message = "密码长度不能超过32个字符")
|
@Length(max = 32, message = "密码长度不能超过32个字符")
|
||||||
private String pwd;
|
private String pwd;
|
||||||
|
|
||||||
|
@ApiModelProperty("租户tenantId")
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "后台管理员姓名", required = true)
|
@ApiModelProperty(value = "后台管理员姓名", required = true)
|
||||||
@NotNull(message = "管理姓名不能为空")
|
@NotNull(message = "管理姓名不能为空")
|
||||||
@Length(max = 16, message = "姓名长度不能超过16个字符")
|
@Length(max = 16, message = "姓名长度不能超过16个字符")
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.yzt.common.request;
|
package com.yzt.common.request;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -20,6 +21,9 @@ public class SystemAdminRequest implements Serializable {
|
|||||||
|
|
||||||
private static final long serialVersionUID=1L;
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("租户tenantId")
|
||||||
|
private Long tenantId;
|
||||||
@ApiModelProperty(value = "后台管理员姓名")
|
@ApiModelProperty(value = "后台管理员姓名")
|
||||||
private String realName;
|
private String realName;
|
||||||
|
|
||||||
|
|||||||
@ -59,4 +59,5 @@ public class SystemAdminUpdateRequest implements Serializable {
|
|||||||
@NotBlank(message = "手机号不能为空")
|
@NotBlank(message = "手机号不能为空")
|
||||||
@Pattern(regexp = RegularConstants.PHONE_TWO, message = "请填写正确的手机号")
|
@Pattern(regexp = RegularConstants.PHONE_TWO, message = "请填写正确的手机号")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.yzt.common.response;
|
package com.yzt.common.response;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -19,6 +20,12 @@ public class SystemAdminResponse implements Serializable {
|
|||||||
|
|
||||||
private String account;
|
private String account;
|
||||||
|
|
||||||
|
@ApiModelProperty("租户名称")
|
||||||
|
private String tenantName;
|
||||||
|
|
||||||
|
@ApiModelProperty("租户tenantId")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long tenantId;
|
||||||
// private String pwd;
|
// private String pwd;
|
||||||
|
|
||||||
private String realName;
|
private String realName;
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import com.yzt.common.utils.ValidateFormUtil;
|
|||||||
import com.yzt.service.mapper.SystemAdminMapper;
|
import com.yzt.service.mapper.SystemAdminMapper;
|
||||||
import com.yzt.service.service.SystemAdminService;
|
import com.yzt.service.service.SystemAdminService;
|
||||||
import com.yzt.service.service.SystemRoleService;
|
import com.yzt.service.service.SystemRoleService;
|
||||||
|
import com.yzt.service.service.TenantService;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -45,6 +46,8 @@ public class SystemAdminServiceImpl extends ServiceImpl<SystemAdminMapper, Syste
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SystemRoleService systemRoleService;
|
private SystemRoleService systemRoleService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TenantService tenantService;
|
||||||
/**
|
/**
|
||||||
* 后台管理员列表
|
* 后台管理员列表
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
@ -87,6 +90,7 @@ public class SystemAdminServiceImpl extends ServiceImpl<SystemAdminMapper, Syste
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sar.setRoleNames(StringUtils.join(roleNames,","));
|
sar.setRoleNames(StringUtils.join(roleNames,","));
|
||||||
|
sar.setTenantName(tenantService.getInfo(admin.getTenantId()).getTenantName());
|
||||||
systemAdminResponses.add(sar);
|
systemAdminResponses.add(sar);
|
||||||
}
|
}
|
||||||
return systemAdminResponses;
|
return systemAdminResponses;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user