init
This commit is contained in:
63
blade-common/src/main/java/org/springblade/common/cache/CacheNames.java
vendored
Normal file
63
blade-common/src/main/java/org/springblade/common/cache/CacheNames.java
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.common.cache;
|
||||
|
||||
/**
|
||||
* 缓存名
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface CacheNames {
|
||||
|
||||
/**
|
||||
* 返回拼接后的key
|
||||
*
|
||||
* @param cacheKey 缓存key
|
||||
* @param cacheKeyValue 缓存key值
|
||||
* @return tenantKey
|
||||
*/
|
||||
static String cacheKey(String cacheKey, String cacheKeyValue) {
|
||||
return cacheKey.concat(cacheKeyValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回租户格式的key
|
||||
*
|
||||
* @param tenantId 租户编号
|
||||
* @param cacheKey 缓存key
|
||||
* @param cacheKeyValue 缓存key值
|
||||
* @return tenantKey
|
||||
*/
|
||||
static String tenantKey(String tenantId, String cacheKey, String cacheKeyValue) {
|
||||
return tenantId.concat(":").concat(cacheKey).concat(cacheKeyValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证码key
|
||||
*/
|
||||
String CAPTCHA_KEY = "blade:auth::blade:captcha:";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.common.config;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* 公共封装包配置类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@AllArgsConstructor
|
||||
public class BladeCommonConfiguration {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.common.constant;
|
||||
|
||||
/**
|
||||
* 通用常量
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface CommonConstant {
|
||||
|
||||
/**
|
||||
* sword 系统名
|
||||
*/
|
||||
String SWORD_NAME = "sword";
|
||||
|
||||
/**
|
||||
* saber 系统名
|
||||
*/
|
||||
String SABER_NAME = "saber";
|
||||
|
||||
/**
|
||||
* 顶级父节点id
|
||||
*/
|
||||
Long TOP_PARENT_ID = 0L;
|
||||
|
||||
/**
|
||||
* 顶级父节点名称
|
||||
*/
|
||||
String TOP_PARENT_NAME = "顶级";
|
||||
|
||||
/**
|
||||
* 未封存状态值
|
||||
*/
|
||||
Integer NOT_SEALED_ID = 0;
|
||||
|
||||
/**
|
||||
* 默认排序字段
|
||||
*/
|
||||
String SORT_FIELD = "sort";
|
||||
|
||||
/**
|
||||
* 数据权限类型
|
||||
*/
|
||||
Integer DATA_SCOPE_CATEGORY = 1;
|
||||
|
||||
/**
|
||||
* 接口权限类型
|
||||
*/
|
||||
Integer API_SCOPE_CATEGORY = 2;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.common.constant;
|
||||
|
||||
import org.springblade.core.launch.constant.AppConstant;
|
||||
|
||||
/**
|
||||
* 启动常量
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface LauncherConstant {
|
||||
|
||||
/**
|
||||
* nacos 用户名
|
||||
*/
|
||||
String NACOS_USERNAME = "nacos";
|
||||
|
||||
/**
|
||||
* nacos 密码
|
||||
*/
|
||||
String NACOS_PASSWORD = "nacos";
|
||||
|
||||
/**
|
||||
* nacos dev 地址
|
||||
*/
|
||||
String NACOS_DEV_ADDR = "127.0.0.1:8848";
|
||||
|
||||
/**
|
||||
* nacos prod 地址
|
||||
*/
|
||||
String NACOS_PROD_ADDR = "172.30.0.48:8848";
|
||||
|
||||
/**
|
||||
* nacos test 地址
|
||||
*/
|
||||
String NACOS_TEST_ADDR = "172.30.0.48:8848";
|
||||
|
||||
/**
|
||||
* sentinel dev 地址
|
||||
*/
|
||||
String SENTINEL_DEV_ADDR = "127.0.0.1:8858";
|
||||
|
||||
/**
|
||||
* sentinel prod 地址
|
||||
*/
|
||||
String SENTINEL_PROD_ADDR = "172.30.0.58:8858";
|
||||
|
||||
/**
|
||||
* sentinel test 地址
|
||||
*/
|
||||
String SENTINEL_TEST_ADDR = "172.30.0.58:8858";
|
||||
|
||||
/**
|
||||
* seata dev 地址
|
||||
*/
|
||||
String SEATA_DEV_ADDR = "127.0.0.1:8091";
|
||||
|
||||
/**
|
||||
* seata prod 地址
|
||||
*/
|
||||
String SEATA_PROD_ADDR = "172.30.0.68:8091";
|
||||
|
||||
/**
|
||||
* seata test 地址
|
||||
*/
|
||||
String SEATA_TEST_ADDR = "172.30.0.68:8091";
|
||||
|
||||
/**
|
||||
* zipkin dev 地址
|
||||
*/
|
||||
String ZIPKIN_DEV_ADDR = "http://127.0.0.1:9411";
|
||||
|
||||
/**
|
||||
* zipkin prod 地址
|
||||
*/
|
||||
String ZIPKIN_PROD_ADDR = "http://172.30.0.71:9411";
|
||||
|
||||
/**
|
||||
* zipkin test 地址
|
||||
*/
|
||||
String ZIPKIN_TEST_ADDR = "http://172.30.0.71:9411";
|
||||
|
||||
/**
|
||||
* elk dev 地址
|
||||
*/
|
||||
String ELK_DEV_ADDR = "127.0.0.1:9000";
|
||||
|
||||
/**
|
||||
* elk prod 地址
|
||||
*/
|
||||
String ELK_PROD_ADDR = "172.30.0.72:9000";
|
||||
|
||||
/**
|
||||
* elk test 地址
|
||||
*/
|
||||
String ELK_TEST_ADDR = "172.30.0.72:9000";
|
||||
|
||||
/**
|
||||
* seata file模式
|
||||
*/
|
||||
String FILE_MODE = "file";
|
||||
|
||||
/**
|
||||
* seata nacos模式
|
||||
*/
|
||||
String NACOS_MODE = "nacos";
|
||||
|
||||
/**
|
||||
* seata default模式
|
||||
*/
|
||||
String DEFAULT_MODE = "default";
|
||||
|
||||
/**
|
||||
* seata group后缀
|
||||
*/
|
||||
String GROUP_NAME = "-group";
|
||||
|
||||
/**
|
||||
* seata 服务组格式
|
||||
*
|
||||
* @param appName 服务名
|
||||
* @return group
|
||||
*/
|
||||
static String seataServiceGroup(String appName) {
|
||||
return appName.concat(GROUP_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* 动态获取nacos地址
|
||||
*
|
||||
* @param profile 环境变量
|
||||
* @return addr
|
||||
*/
|
||||
static String nacosAddr(String profile) {
|
||||
return switch (profile) {
|
||||
case (AppConstant.PROD_CODE) -> NACOS_PROD_ADDR;
|
||||
case (AppConstant.TEST_CODE) -> NACOS_TEST_ADDR;
|
||||
default -> NACOS_DEV_ADDR;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 动态获取sentinel地址
|
||||
*
|
||||
* @param profile 环境变量
|
||||
* @return addr
|
||||
*/
|
||||
static String sentinelAddr(String profile) {
|
||||
return switch (profile) {
|
||||
case (AppConstant.PROD_CODE) -> SENTINEL_PROD_ADDR;
|
||||
case (AppConstant.TEST_CODE) -> SENTINEL_TEST_ADDR;
|
||||
default -> SENTINEL_DEV_ADDR;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 动态获取seata地址
|
||||
*
|
||||
* @param profile 环境变量
|
||||
* @return addr
|
||||
*/
|
||||
static String seataAddr(String profile) {
|
||||
return switch (profile) {
|
||||
case (AppConstant.PROD_CODE) -> SEATA_PROD_ADDR;
|
||||
case (AppConstant.TEST_CODE) -> SEATA_TEST_ADDR;
|
||||
default -> SEATA_DEV_ADDR;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 动态获取zipkin地址
|
||||
*
|
||||
* @param profile 环境变量
|
||||
* @return addr
|
||||
*/
|
||||
static String zipkinAddr(String profile) {
|
||||
return switch (profile) {
|
||||
case (AppConstant.PROD_CODE) -> ZIPKIN_PROD_ADDR;
|
||||
case (AppConstant.TEST_CODE) -> ZIPKIN_TEST_ADDR;
|
||||
default -> ZIPKIN_DEV_ADDR;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 动态获取elk地址
|
||||
*
|
||||
* @param profile 环境变量
|
||||
* @return addr
|
||||
*/
|
||||
static String elkAddr(String profile) {
|
||||
return switch (profile) {
|
||||
case (AppConstant.PROD_CODE) -> ELK_PROD_ADDR;
|
||||
case (AppConstant.TEST_CODE) -> ELK_TEST_ADDR;
|
||||
default -> ELK_DEV_ADDR;
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.common.constant;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统参数常量
|
||||
* 统一管理所有通过 ParamCache 读取的参数key及其默认值
|
||||
*
|
||||
* @author BladeX
|
||||
*/
|
||||
public interface ParamConstant {
|
||||
|
||||
// ==================== 账号相关 ====================
|
||||
|
||||
/**
|
||||
* 是否开启注册参数key
|
||||
*/
|
||||
String REGISTER_USER_VALUE = "account.registerUser";
|
||||
/**
|
||||
* 账号默认密码参数key
|
||||
*/
|
||||
String DEFAULT_PARAM_PASSWORD = "account.initPassword";
|
||||
/**
|
||||
* 账号默认密码
|
||||
*/
|
||||
String DEFAULT_PASSWORD = "123456";
|
||||
/**
|
||||
* 账号锁定错误次数参数key
|
||||
*/
|
||||
String FAIL_COUNT_VALUE = "account.failCount";
|
||||
/**
|
||||
* 账号锁定默认错误次数
|
||||
*/
|
||||
Integer FAIL_COUNT = 5;
|
||||
/**
|
||||
* 账号锁定时长参数key(单位:分钟)
|
||||
*/
|
||||
String LOCK_DURATION_VALUE = "account.lockDuration";
|
||||
/**
|
||||
* 账号锁定默认时长(单位:分钟)
|
||||
*/
|
||||
Integer LOCK_DURATION = 30;
|
||||
|
||||
// ==================== 租户相关 ====================
|
||||
|
||||
/**
|
||||
* 租户默认密码参数key
|
||||
*/
|
||||
String TENANT_PASSWORD_KEY = "tenant.default.password";
|
||||
/**
|
||||
* 租户默认密码
|
||||
*/
|
||||
String TENANT_DEFAULT_PASSWORD = "123456";
|
||||
/**
|
||||
* 租户默认账号额度参数key
|
||||
*/
|
||||
String TENANT_ACCOUNT_NUMBER_KEY = "tenant.default.accountNumber";
|
||||
/**
|
||||
* 租户默认账号额度
|
||||
*/
|
||||
Integer TENANT_DEFAULT_ACCOUNT_NUMBER = -1;
|
||||
/**
|
||||
* 租户默认菜单集合参数key
|
||||
*/
|
||||
String TENANT_MENU_CODE_KEY = "tenant.default.menuCode";
|
||||
/**
|
||||
* 租户默认菜单集合
|
||||
*/
|
||||
List<String> TENANT_MENU_CODES = Arrays.asList(
|
||||
"desk", "flow", "work", "monitor", "resource", "role", "user", "dept", "dictbiz", "topmenu"
|
||||
);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.common.constant;
|
||||
|
||||
/**
|
||||
* 租户常量
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface TenantConstant {
|
||||
|
||||
/**
|
||||
* 租户授权码默认16位密钥
|
||||
*/
|
||||
String DES_KEY = "0000000000000000";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.common.launch;
|
||||
|
||||
import org.springblade.common.constant.LauncherConstant;
|
||||
import org.springblade.core.auto.service.AutoService;
|
||||
import org.springblade.core.launch.service.LauncherService;
|
||||
import org.springblade.core.launch.utils.PropsUtil;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* 启动参数拓展
|
||||
*
|
||||
* @author smallchil
|
||||
*/
|
||||
@AutoService(LauncherService.class)
|
||||
public class LauncherServiceImpl implements LauncherService {
|
||||
|
||||
@Override
|
||||
public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) {
|
||||
Properties props = System.getProperties();
|
||||
|
||||
// nacos注册中心配置
|
||||
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.username", LauncherConstant.NACOS_USERNAME);
|
||||
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.password", LauncherConstant.NACOS_PASSWORD);
|
||||
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.server-addr", LauncherConstant.nacosAddr(profile));
|
||||
// nacos配置中心配置
|
||||
PropsUtil.setProperty(props, "spring.cloud.nacos.config.username", LauncherConstant.NACOS_USERNAME);
|
||||
PropsUtil.setProperty(props, "spring.cloud.nacos.config.password", LauncherConstant.NACOS_PASSWORD);
|
||||
PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile));
|
||||
// sentinel配置
|
||||
PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile));
|
||||
// 多数据源配置
|
||||
PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "false");
|
||||
|
||||
// 开启elk日志
|
||||
// PropsUtil.setProperty(props, "blade.log.elk.destination", LauncherConstant.elkAddr(profile));
|
||||
|
||||
// seata注册地址
|
||||
// PropsUtil.setProperty(props, "seata.service.grouplist.default", LauncherConstant.seataAddr(profile));
|
||||
// seata注册group格式
|
||||
// PropsUtil.setProperty(props, "seata.tx-service-group", LauncherConstant.seataServiceGroup(appName));
|
||||
// seata配置服务group
|
||||
// PropsUtil.setProperty(props, "seata.service.vgroup-mapping.".concat(LauncherConstant.seataServiceGroup(appName)), LauncherConstant.DEFAULT_MODE);
|
||||
// seata注册模式配置
|
||||
// PropsUtil.setProperty(props, "seata.registry.type", LauncherConstant.NACOS_MODE);
|
||||
// PropsUtil.setProperty(props, "seata.registry.nacos.server-addr", LauncherConstant.nacosAddr(profile));
|
||||
// PropsUtil.setProperty(props, "seata.config.type", LauncherConstant.NACOS_MODE);
|
||||
// PropsUtil.setProperty(props, "seata.config.nacos.server-addr", LauncherConstant.nacosAddr(profile));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.common.utils;
|
||||
|
||||
/**
|
||||
* 通用工具类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public class CommonUtil {
|
||||
|
||||
}
|
||||
8
blade-common/src/main/resources/banner.txt
Normal file
8
blade-common/src/main/resources/banner.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
${AnsiColor.BLUE} ______ _ _ ___ ___
|
||||
${AnsiColor.BLUE} | ___ \| | | | \ \ / /
|
||||
${AnsiColor.BLUE} | |_/ /| | __ _ __| | ___ \ V /
|
||||
${AnsiColor.BLUE} | ___ \| | / _` | / _` | / _ \ > <
|
||||
${AnsiColor.BLUE} | |_/ /| || (_| || (_| || __/ / . \
|
||||
${AnsiColor.BLUE} \____/ |_| \__,_| \__,_| \___|/__/ \__\
|
||||
|
||||
${AnsiColor.BLUE}:: BladeX ${blade.service.version} :: ${spring.application.name}:${AnsiColor.RED}${blade.env}${AnsiColor.BLUE} :: Running SpringBoot ${spring-boot.version} :: ${AnsiColor.BRIGHT_BLACK}
|
||||
24
blade-common/src/main/resources/i18n/errors.properties
Normal file
24
blade-common/src/main/resources/i18n/errors.properties
Normal file
@@ -0,0 +1,24 @@
|
||||
# 验证错误
|
||||
error.validation.default=参数校验失败。
|
||||
user.name.required=请输入姓名。
|
||||
user.name.size=姓名长度需在{min}到{max}个字符之间。
|
||||
user.email.invalid=请输入有效的邮箱地址。
|
||||
user.description.size=描述不能超过{max}个字符。
|
||||
|
||||
# 业务错误
|
||||
error.biz.denied=不允许的操作:{0}。
|
||||
error.auth.unauthorized=请先登录。
|
||||
error.permission.denied=您没有访问{0}的权限。
|
||||
error.resource.notfound={0} ID {1} 不存在。
|
||||
error.user.delete.admin=不能删除管理员用户。
|
||||
error.unknown=未知错误类型:{0}
|
||||
|
||||
# 服务器错误
|
||||
error.server.internal=服务器内部错误,请稍后重试。
|
||||
error.server.busy=服务器繁忙,请稍后重试。
|
||||
error.server.maintenance=系统维护中。
|
||||
|
||||
# 数据错误
|
||||
error.data.duplicate=数据已存在。
|
||||
error.data.invalid=数据格式无效。
|
||||
error.data.notfound=数据不存在。
|
||||
24
blade-common/src/main/resources/i18n/errors_de_DE.properties
Normal file
24
blade-common/src/main/resources/i18n/errors_de_DE.properties
Normal file
@@ -0,0 +1,24 @@
|
||||
# Validierungsfehler
|
||||
error.validation.default=Parametervalidierung fehlgeschlagen.
|
||||
user.name.required=Bitte geben Sie einen Namen ein.
|
||||
user.name.size=Der Name muss zwischen {min} und {max} Zeichen lang sein.
|
||||
user.email.invalid=Bitte geben Sie eine gültige E-Mail-Adresse ein.
|
||||
user.description.size=Die Beschreibung darf {max} Zeichen nicht überschreiten.
|
||||
|
||||
# Geschäftsfehler
|
||||
error.biz.denied=Operation nicht erlaubt: {0}.
|
||||
error.auth.unauthorized=Bitte melden Sie sich zuerst an.
|
||||
error.permission.denied=Sie haben keine Berechtigung für den Zugriff auf {0}.
|
||||
error.resource.notfound={0} mit ID {1} existiert nicht.
|
||||
error.user.delete.admin=Administrator-Benutzer kann nicht gelöscht werden.
|
||||
error.unknown=Unbekannter Fehlertyp: {0}
|
||||
|
||||
# Serverfehler
|
||||
error.server.internal=Interner Serverfehler. Bitte versuchen Sie es später erneut.
|
||||
error.server.busy=Server ist ausgelastet. Bitte versuchen Sie es später erneut.
|
||||
error.server.maintenance=System wird gewartet.
|
||||
|
||||
# Datenfehler
|
||||
error.data.duplicate=Daten existieren bereits.
|
||||
error.data.invalid=Ungültiges Datenformat.
|
||||
error.data.notfound=Daten nicht gefunden.
|
||||
24
blade-common/src/main/resources/i18n/errors_en_GB.properties
Normal file
24
blade-common/src/main/resources/i18n/errors_en_GB.properties
Normal file
@@ -0,0 +1,24 @@
|
||||
# Validation Errors
|
||||
error.validation.default=Parameter validation failed.
|
||||
user.name.required=Please enter a name.
|
||||
user.name.size=Name must be between {min} and {max} characters.
|
||||
user.email.invalid=Please enter a valid email address.
|
||||
user.description.size=Description cannot exceed {max} characters.
|
||||
|
||||
# Business Errors
|
||||
error.biz.denied=Operation not permitted: {0}.
|
||||
error.auth.unauthorized=Please log in first.
|
||||
error.permission.denied=You do not have permission to access {0}.
|
||||
error.resource.notfound={0} with ID {1} does not exist.
|
||||
error.user.delete.admin=Cannot delete administrator user.
|
||||
error.unknown=Unknown error type: {0}
|
||||
|
||||
# Server Errors
|
||||
error.server.internal=Internal server error. Please try again later.
|
||||
error.server.busy=Server is busy. Please try again later.
|
||||
error.server.maintenance=System is under maintenance.
|
||||
|
||||
# Data Errors
|
||||
error.data.duplicate=Data already exists.
|
||||
error.data.invalid=Invalid data format.
|
||||
error.data.notfound=Data not found.
|
||||
24
blade-common/src/main/resources/i18n/errors_en_US.properties
Normal file
24
blade-common/src/main/resources/i18n/errors_en_US.properties
Normal file
@@ -0,0 +1,24 @@
|
||||
# Validation errors
|
||||
error.validation.default=Validation failed.
|
||||
user.name.required=Name is required.
|
||||
user.name.size=Name length must be between {min} and {max} characters.
|
||||
user.email.invalid=Please provide a valid email address.
|
||||
user.description.size=Description cannot exceed {max} characters.
|
||||
|
||||
# Business errors
|
||||
error.biz.denied=Operation {0} is not allowed.
|
||||
error.auth.unauthorized=Authentication required.
|
||||
error.permission.denied=You don't have permission to access {0}.
|
||||
error.resource.notfound={0} with ID {1} not found.
|
||||
error.user.delete.admin=Cannot delete admin user.
|
||||
error.unknown=Unknown error type: {0}
|
||||
|
||||
# Server errors
|
||||
error.server.internal=Internal server error. Please try again later.
|
||||
error.server.busy=Server is busy. Please try again later.
|
||||
error.server.maintenance=System is under maintenance.
|
||||
|
||||
# Data errors
|
||||
error.data.duplicate=Duplicate data found.
|
||||
error.data.invalid=Invalid data format.
|
||||
error.data.notfound=Data not found.
|
||||
24
blade-common/src/main/resources/i18n/errors_fr_FR.properties
Normal file
24
blade-common/src/main/resources/i18n/errors_fr_FR.properties
Normal file
@@ -0,0 +1,24 @@
|
||||
# Erreurs de validation
|
||||
error.validation.default=Échec de la validation des paramètres.
|
||||
user.name.required=Veuillez saisir un nom.
|
||||
user.name.size=Le nom doit contenir entre {min} et {max} caractères.
|
||||
user.email.invalid=Veuillez saisir une adresse e-mail valide.
|
||||
user.description.size=La description ne peut pas dépasser {max} caractères.
|
||||
|
||||
# Erreurs métier
|
||||
error.biz.denied=Opération non autorisée : {0}.
|
||||
error.auth.unauthorized=Veuillez vous connecter d'abord.
|
||||
error.permission.denied=Vous n'avez pas l'autorisation d'accéder à {0}.
|
||||
error.resource.notfound={0} avec l'ID {1} n'existe pas.
|
||||
error.user.delete.admin=Impossible de supprimer l'utilisateur administrateur.
|
||||
error.unknown=Type d'erreur inconnu : {0}
|
||||
|
||||
# Erreurs serveur
|
||||
error.server.internal=Erreur interne du serveur. Veuillez réessayer plus tard.
|
||||
error.server.busy=Le serveur est occupé. Veuillez réessayer plus tard.
|
||||
error.server.maintenance=Système en maintenance.
|
||||
|
||||
# Erreurs de données
|
||||
error.data.duplicate=Les données existent déjà.
|
||||
error.data.invalid=Format de données invalide.
|
||||
error.data.notfound=Données introuvables.
|
||||
24
blade-common/src/main/resources/i18n/errors_it_IT.properties
Normal file
24
blade-common/src/main/resources/i18n/errors_it_IT.properties
Normal file
@@ -0,0 +1,24 @@
|
||||
# Errori di validazione
|
||||
error.validation.default=Validazione dei parametri fallita.
|
||||
user.name.required=Inserisci il nome.
|
||||
user.name.size=La lunghezza del nome deve essere tra {min} e {max} caratteri.
|
||||
user.email.invalid=Inserisci un indirizzo email valido.
|
||||
user.description.size=La descrizione non può superare {max} caratteri.
|
||||
|
||||
# Errori di business
|
||||
error.biz.denied=Operazione non consentita: {0}.
|
||||
error.auth.unauthorized=Effettua il login prima di procedere.
|
||||
error.permission.denied=Non hai i permessi per accedere a {0}.
|
||||
error.resource.notfound={0} con ID {1} non esiste.
|
||||
error.user.delete.admin=Non è possibile eliminare l'utente amministratore.
|
||||
error.unknown=Tipo di errore sconosciuto: {0}
|
||||
|
||||
# Errori del server
|
||||
error.server.internal=Errore interno del server, riprova più tardi.
|
||||
error.server.busy=Il server è occupato, riprova più tardi.
|
||||
error.server.maintenance=Sistema in manutenzione.
|
||||
|
||||
# Errori di dati
|
||||
error.data.duplicate=I dati esistono già.
|
||||
error.data.invalid=Formato dati non valido.
|
||||
error.data.notfound=I dati non esistono.
|
||||
24
blade-common/src/main/resources/i18n/errors_ru_RU.properties
Normal file
24
blade-common/src/main/resources/i18n/errors_ru_RU.properties
Normal file
@@ -0,0 +1,24 @@
|
||||
# Ошибки валидации
|
||||
error.validation.default=Ошибка проверки параметров.
|
||||
user.name.required=Пожалуйста, введите имя.
|
||||
user.name.size=Имя должно быть от {min} до {max} символов.
|
||||
user.email.invalid=Пожалуйста, введите действительный адрес электронной почты.
|
||||
user.description.size=Описание не может превышать {max} символов.
|
||||
|
||||
# Бизнес-ошибки
|
||||
error.biz.denied=Операция не разрешена: {0}.
|
||||
error.auth.unauthorized=Пожалуйста, сначала войдите в систему.
|
||||
error.permission.denied=У вас нет разрешения на доступ к {0}.
|
||||
error.resource.notfound={0} с ID {1} не существует.
|
||||
error.user.delete.admin=Невозможно удалить пользователя-администратора.
|
||||
error.unknown=Неизвестный тип ошибки: {0}
|
||||
|
||||
# Ошибки сервера
|
||||
error.server.internal=Внутренняя ошибка сервера. Пожалуйста, попробуйте позже.
|
||||
error.server.busy=Сервер занят. Пожалуйста, попробуйте позже.
|
||||
error.server.maintenance=Система на обслуживании.
|
||||
|
||||
# Ошибки данных
|
||||
error.data.duplicate=Данные уже существуют.
|
||||
error.data.invalid=Недопустимый формат данных.
|
||||
error.data.notfound=Данные не найдены.
|
||||
24
blade-common/src/main/resources/i18n/errors_zh_CN.properties
Normal file
24
blade-common/src/main/resources/i18n/errors_zh_CN.properties
Normal file
@@ -0,0 +1,24 @@
|
||||
# 验证错误
|
||||
error.validation.default=参数校验失败。
|
||||
user.name.required=请输入姓名。
|
||||
user.name.size=姓名长度需在{min}到{max}个字符之间。
|
||||
user.email.invalid=请输入有效的邮箱地址。
|
||||
user.description.size=描述不能超过{max}个字符。
|
||||
|
||||
# 业务错误
|
||||
error.biz.denied=不允许的操作:{0}。
|
||||
error.auth.unauthorized=请先登录。
|
||||
error.permission.denied=您没有访问{0}的权限。
|
||||
error.resource.notfound={0} ID {1} 不存在。
|
||||
error.user.delete.admin=不能删除管理员用户。
|
||||
error.unknown=未知错误类型:{0}
|
||||
|
||||
# 服务器错误
|
||||
error.server.internal=服务器内部错误,请稍后重试。
|
||||
error.server.busy=服务器繁忙,请稍后重试。
|
||||
error.server.maintenance=系统维护中。
|
||||
|
||||
# 数据错误
|
||||
error.data.duplicate=数据已存在。
|
||||
error.data.invalid=数据格式无效。
|
||||
error.data.notfound=数据不存在。
|
||||
24
blade-common/src/main/resources/i18n/errors_zh_TW.properties
Normal file
24
blade-common/src/main/resources/i18n/errors_zh_TW.properties
Normal file
@@ -0,0 +1,24 @@
|
||||
# 驗證錯誤
|
||||
error.validation.default=參數校驗失敗。
|
||||
user.name.required=請輸入姓名。
|
||||
user.name.size=姓名長度需在{min}到{max}個字元之間。
|
||||
user.email.invalid=請輸入有效的電子郵件地址。
|
||||
user.description.size=描述不能超過{max}個字元。
|
||||
|
||||
# 業務錯誤
|
||||
error.biz.denied=不允許的操作:{0}。
|
||||
error.auth.unauthorized=請先登入。
|
||||
error.permission.denied=您沒有存取{0}的權限。
|
||||
error.resource.notfound={0} ID {1} 不存在。
|
||||
error.user.delete.admin=不能刪除管理員使用者。
|
||||
error.unknown=未知錯誤類型:{0}
|
||||
|
||||
# 伺服器錯誤
|
||||
error.server.internal=伺服器內部錯誤,請稍後重試。
|
||||
error.server.busy=伺服器忙碌中,請稍後重試。
|
||||
error.server.maintenance=系統維護中。
|
||||
|
||||
# 資料錯誤
|
||||
error.data.duplicate=資料已存在。
|
||||
error.data.invalid=資料格式無效。
|
||||
error.data.notfound=資料不存在。
|
||||
14
blade-common/src/main/resources/i18n/messages.properties
Normal file
14
blade-common/src/main/resources/i18n/messages.properties
Normal file
@@ -0,0 +1,14 @@
|
||||
# 问候消息
|
||||
greeting.message=你好,{0}!
|
||||
greeting.welcome=欢迎使用我们的应用
|
||||
|
||||
# 用户消息
|
||||
user.create.success=用户 {0} 创建成功。
|
||||
user.update.success=ID为 {1} 的用户 {0} 更新成功。
|
||||
user.delete.success=ID为 {0} 的用户删除成功。
|
||||
user.notfound=用户未找到
|
||||
|
||||
# 成功消息
|
||||
operation.success=操作成功完成
|
||||
save.success=数据保存成功
|
||||
delete.success=数据删除成功
|
||||
@@ -0,0 +1,14 @@
|
||||
# Begrüßungsnachrichten
|
||||
greeting.message=Hallo, {0}!
|
||||
greeting.welcome=Willkommen in unserer Anwendung
|
||||
|
||||
# Benutzernachrichten
|
||||
user.create.success=Benutzer {0} wurde erfolgreich erstellt.
|
||||
user.update.success=Benutzer {0} mit ID {1} wurde erfolgreich aktualisiert.
|
||||
user.delete.success=Benutzer mit ID {0} wurde erfolgreich gelöscht.
|
||||
user.notfound=Benutzer nicht gefunden
|
||||
|
||||
# Erfolgsmeldungen
|
||||
operation.success=Vorgang erfolgreich abgeschlossen
|
||||
save.success=Daten erfolgreich gespeichert
|
||||
delete.success=Daten erfolgreich gelöscht
|
||||
@@ -0,0 +1,14 @@
|
||||
# Greeting Messages
|
||||
greeting.message=Hello, {0}!
|
||||
greeting.welcome=Welcome to our application
|
||||
|
||||
# User Messages
|
||||
user.create.success=User {0} has been successfully created.
|
||||
user.update.success=User {0} with ID {1} has been successfully updated.
|
||||
user.delete.success=User with ID {0} has been successfully deleted.
|
||||
user.notfound=User not found
|
||||
|
||||
# Success Messages
|
||||
operation.success=Operation completed successfully
|
||||
save.success=Data saved successfully
|
||||
delete.success=Data deleted successfully
|
||||
@@ -0,0 +1,14 @@
|
||||
# Greeting messages
|
||||
greeting.message=Hello, {0}!
|
||||
greeting.welcome=Welcome to our application
|
||||
|
||||
# User messages
|
||||
user.create.success=User {0} created successfully.
|
||||
user.update.success=User {0} with ID {1} updated successfully.
|
||||
user.delete.success=User with ID {0} deleted successfully.
|
||||
user.notfound=User not found
|
||||
|
||||
# Success messages
|
||||
operation.success=Operation completed successfully
|
||||
save.success=Data saved successfully
|
||||
delete.success=Data deleted successfully
|
||||
@@ -0,0 +1,14 @@
|
||||
# Messages de salutation
|
||||
greeting.message=Bonjour, {0} !
|
||||
greeting.welcome=Bienvenue dans notre application
|
||||
|
||||
# Messages utilisateur
|
||||
user.create.success=L'utilisateur {0} a été créé avec succès.
|
||||
user.update.success=L'utilisateur {0} avec l'ID {1} a été mis à jour avec succès.
|
||||
user.delete.success=L'utilisateur avec l'ID {0} a été supprimé avec succès.
|
||||
user.notfound=Utilisateur introuvable
|
||||
|
||||
# Messages de succès
|
||||
operation.success=Opération terminée avec succès
|
||||
save.success=Données enregistrées avec succès
|
||||
delete.success=Données supprimées avec succès
|
||||
@@ -0,0 +1,14 @@
|
||||
# Messaggi di saluto
|
||||
greeting.message=Ciao, {0}!
|
||||
greeting.welcome=Benvenuto nella nostra applicazione
|
||||
|
||||
# Messaggi utente
|
||||
user.create.success=L'utente {0} è stato creato con successo.
|
||||
user.update.success=L'utente {0} con ID {1} è stato aggiornato con successo.
|
||||
user.delete.success=L'utente con ID {0} è stato eliminato con successo.
|
||||
user.notfound=Utente non trovato
|
||||
|
||||
# Messaggi di successo
|
||||
operation.success=Operazione completata con successo
|
||||
save.success=Dati salvati con successo
|
||||
delete.success=Dati eliminati con successo
|
||||
@@ -0,0 +1,14 @@
|
||||
# Приветственные сообщения
|
||||
greeting.message=Здравствуйте, {0}!
|
||||
greeting.welcome=Добро пожаловать в наше приложение
|
||||
|
||||
# Сообщения пользователя
|
||||
user.create.success=Пользователь {0} успешно создан.
|
||||
user.update.success=Пользователь {0} с ID {1} успешно обновлен.
|
||||
user.delete.success=Пользователь с ID {0} успешно удален.
|
||||
user.notfound=Пользователь не найден
|
||||
|
||||
# Сообщения об успехе
|
||||
operation.success=Операция успешно завершена
|
||||
save.success=Данные успешно сохранены
|
||||
delete.success=Данные успешно удалены
|
||||
@@ -0,0 +1,14 @@
|
||||
# 问候消息
|
||||
greeting.message=你好,{0}!
|
||||
greeting.welcome=欢迎使用我们的应用
|
||||
|
||||
# 用户消息
|
||||
user.create.success=用户 {0} 创建成功。
|
||||
user.update.success=ID为 {1} 的用户 {0} 更新成功。
|
||||
user.delete.success=ID为 {0} 的用户删除成功。
|
||||
user.notfound=用户未找到
|
||||
|
||||
# 成功消息
|
||||
operation.success=操作成功完成
|
||||
save.success=数据保存成功
|
||||
delete.success=数据删除成功
|
||||
@@ -0,0 +1,14 @@
|
||||
# 問候訊息
|
||||
greeting.message=你好,{0}!
|
||||
greeting.welcome=歡迎使用我們的應用
|
||||
|
||||
# 使用者訊息
|
||||
user.create.success=使用者 {0} 建立成功。
|
||||
user.update.success=ID為 {1} 的使用者 {0} 更新成功。
|
||||
user.delete.success=ID為 {0} 的使用者刪除成功。
|
||||
user.notfound=使用者未找到
|
||||
|
||||
# 成功訊息
|
||||
operation.success=操作成功完成
|
||||
save.success=資料儲存成功
|
||||
delete.success=資料刪除成功
|
||||
Reference in New Issue
Block a user