Merge remote-tracking branch 'ztcloud/main' into main-ztcloud

# Conflicts:
#	zt-module-system/zt-module-system-server/src/main/java/com/zt/plat/module/system/service/dept/DeptService.java
This commit is contained in:
hewencai
2025-12-24 11:15:23 +08:00
46 changed files with 1539 additions and 1266 deletions

View File

@@ -4,6 +4,7 @@ import com.zt.plat.framework.common.biz.system.permission.PermissionCommonApi;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.system.api.permission.dto.*;
import com.zt.plat.module.system.enums.ApiConstants;
import com.zt.plat.module.system.enums.permission.DataScopeEnum;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
@@ -50,4 +51,9 @@ public interface PermissionApi extends PermissionCommonApi {
@Parameter(name = "userId", description = "用户编号", example = "1", required = true)
CommonResult<Set<Long>> getUserRoleIdListByUserId(@RequestParam("userId") Long userId);
@GetMapping(PREFIX + "/user-data-permission-level")
@Operation(summary = "获得用户的数据权限级别")
@Parameter(name = "userId", description = "用户编号", example = "1", required = true)
CommonResult<DataScopeEnum> getUserDataPermissionLevel(@RequestParam("userId") Long userId);
}

View File

@@ -127,8 +127,8 @@ public interface ErrorCodeConstants {
ErrorCode SMS_CODE_NOT_FOUND = new ErrorCode(1_002_014_000, "验证码不存在");
ErrorCode SMS_CODE_EXPIRED = new ErrorCode(1_002_014_001, "验证码已过期");
ErrorCode SMS_CODE_USED = new ErrorCode(1_002_014_002, "验证码已使用");
ErrorCode SMS_CODE_EXCEED_SEND_MAXIMUM_QUANTITY_PER_DAY = new ErrorCode(1_002_014_004, "超过每日短信发送数量");
ErrorCode SMS_CODE_SEND_TOO_FAST = new ErrorCode(1_002_014_005, "短信发送过于频繁");
ErrorCode SMS_CODE_EXCEED_SEND_MAXIMUM_QUANTITY_PER_DAY = new ErrorCode(1_002_014_004, "超过每日短信发送数量:{}次");
ErrorCode SMS_CODE_SEND_TOO_FAST = new ErrorCode(1_002_014_005, "短信发送过于频繁,请于{}分钟后再试");
// ========== 租户信息 1-002-015-000 ==========
ErrorCode TENANT_NOT_EXISTS = new ErrorCode(1_002_015_000, "租户不存在");

View File

@@ -1,10 +1,12 @@
package com.zt.plat.module.system.enums.permission;
import com.fasterxml.jackson.annotation.JsonValue;
import com.zt.plat.framework.common.core.ArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
import java.util.Objects;
/**
* 数据范围枚举类
@@ -33,6 +35,26 @@ public enum DataScopeEnum implements ArrayValuable<Integer> {
public static final Integer[] ARRAYS = Arrays.stream(values()).map(DataScopeEnum::getScope).toArray(Integer[]::new);
/**
* Jackson 序列化时输出整数 code兼容旧客户端
*/
@JsonValue
public Integer getScope() {
return scope;
}
public static DataScopeEnum findByScope(Integer scope) {
if (scope == null) {
return null;
}
for (DataScopeEnum value : values()) {
if (Objects.equals(value.scope, scope)) {
return value;
}
}
return null;
}
@Override
public Integer[] array() {
return ARRAYS;