Compare commits
2 Commits
ed9d500e5d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| f7e3cad931 | |||
| 6a48299e12 |
@@ -53,6 +53,15 @@ public class TenantController extends BaseController {
|
||||
@Operation(summary = "分页查询租户")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Tenant>> page(TenantParam param) {
|
||||
// 如果传了 all=true,查询全部租户;否则自动用当前登录用户的 userId
|
||||
if (param.getAll() == null || !param.getAll()) {
|
||||
if (param.getUserId() == null) {
|
||||
final User loginUser = getLoginUser();
|
||||
if (loginUser != null && loginUser.getUserId() != null) {
|
||||
param.setUserId(loginUser.getUserId());
|
||||
}
|
||||
}
|
||||
}
|
||||
PageResult<Tenant> result = tenantService.pageRel(param);
|
||||
// 如果传入 mask=false,设置不脱敏
|
||||
if (param.getMask() != null && !param.getMask()) {
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
package com.gxwebsoft.common.system.param;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -56,4 +53,7 @@ public class TenantParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean mask;
|
||||
|
||||
@Schema(description = "查询全部租户,true时忽略userId条件")
|
||||
private Boolean all;
|
||||
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, Tenant> impleme
|
||||
|
||||
// 添加超级管理员
|
||||
User superAdmin = new User();
|
||||
superAdmin.setUsername(CommonUtil.randomUUID16()); // 使用随机用户名
|
||||
superAdmin.setUsername("superAdmin");
|
||||
superAdmin.setNickname(company.getShortName());
|
||||
superAdmin.setPhone(company.getPhone());
|
||||
superAdmin.setEmail(company.getEmail());
|
||||
|
||||
Reference in New Issue
Block a user