refactor: admin

This commit is contained in:
pengsz 2025-12-09 16:24:00 +08:00
parent bd2c04d272
commit 22b9cb5b98
5 changed files with 20 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package com.yzt.common.request;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yzt.common.constants.RegularConstants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -38,6 +39,9 @@ public class SystemAdminAddRequest implements Serializable {
@Length(max = 32, message = "密码长度不能超过32个字符")
private String pwd;
@ApiModelProperty("租户tenantId")
private Long tenantId;
@ApiModelProperty(value = "后台管理员姓名", required = true)
@NotNull(message = "管理姓名不能为空")
@Length(max = 16, message = "姓名长度不能超过16个字符")

View File

@ -1,5 +1,6 @@
package com.yzt.common.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -20,6 +21,9 @@ public class SystemAdminRequest implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty("租户tenantId")
private Long tenantId;
@ApiModelProperty(value = "后台管理员姓名")
private String realName;

View File

@ -59,4 +59,5 @@ public class SystemAdminUpdateRequest implements Serializable {
@NotBlank(message = "手机号不能为空")
@Pattern(regexp = RegularConstants.PHONE_TWO, message = "请填写正确的手机号")
private String phone;
}

View File

@ -1,6 +1,7 @@
package com.yzt.common.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -19,6 +20,12 @@ public class SystemAdminResponse implements Serializable {
private String account;
@ApiModelProperty("租户名称")
private String tenantName;
@ApiModelProperty("租户tenantId")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long tenantId;
// private String pwd;
private String realName;

View File

@ -21,6 +21,7 @@ import com.yzt.common.utils.ValidateFormUtil;
import com.yzt.service.mapper.SystemAdminMapper;
import com.yzt.service.service.SystemAdminService;
import com.yzt.service.service.SystemRoleService;
import com.yzt.service.service.TenantService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -45,6 +46,8 @@ public class SystemAdminServiceImpl extends ServiceImpl<SystemAdminMapper, Syste
@Autowired
private SystemRoleService systemRoleService;
@Autowired
private TenantService tenantService;
/**
* 后台管理员列表
* @param request 请求参数
@ -87,6 +90,7 @@ public class SystemAdminServiceImpl extends ServiceImpl<SystemAdminMapper, Syste
}
}
sar.setRoleNames(StringUtils.join(roleNames,","));
sar.setTenantName(tenantService.getInfo(admin.getTenantId()).getTenantName());
systemAdminResponses.add(sar);
}
return systemAdminResponses;