代码拉取完成,页面将自动刷新
基于SpringBoot2.x、SpringCloud并采用前后端分离的企业级微服务,多租户系统架构微服务开发平台 mPaaS(Microservice PaaS)为租户业务开发、测试、运营及运维开源框架,能有效降低技术门槛、减少研发成本、提升开发效率,协助企业快速搭建稳定高质量的微服务应用;同时还集合各种微服务治理功能和监控功能。模块包括:企业级的认证系统、开发平台、应用监控、慢sql监控、统一日志、单点登录、Redis分布式高速缓存、配置中心、分布式任务调度、接口文档、代码生成等等
[TOC]
______ ___ ________
___ |/ / ___ __ \_____ _______________
__ /|_/ /________ /_/ / __ `/_ ___/_ ___/
_ / / /_/_____/ ____// /_/ /_(__ )_(__ )
/_/ /_/ /_/ \__,_/ /____/ /____/
作者:iByte (码哥 or 李尚志)
系统处于开发阶段, 预计两个月时间完成整体架构体系
核心功能:
依赖包 | 说明 |
---|---|
JDK | 1.8 |
Spring-Cloud | Greenwich.SR2 |
Spring-Boot | 2.1.6.RELEASE |
Spring-Boot-admmin | 2.1.6 |
druid | 1.1.10 |
netty-all | RELEASE |
h2database | 1.4.197 |
mysql | 5.1.46 |
oracle | 12.1.0.1.0 |
sqlserver | 6.0.8112.200 |
arangodb | 4.2.2 |
elasticsearch | 6.1 |
jedis | 2.9.0 |
logstash | 6.1 |
guava | 20.0 |
reflections | 0.9.11 |
swagger2 | 2.9.2 |
lombok | 1.18.8 |
查看更新记录请移步 目前进度
SpringBoot SPI拓展
org.springframework.boot.SpringApplicationRunListener=\
com.ibyte.component.config.DefaultConfigListener,com.ibyte.component.logback.LogbackListener,com.ibyte.component.banner.BannerListener
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.ibyte.component.spring.PackageScanAutoConfig,com.ibyte.component.redis.RedissonAutoConfiguration
com.ibyte.component.config.DefaultConfigFactory=\
com.ibyte.component.config.InitPropConfigFactory
ID生成器
/**
* 生成主键,36位,[0-9a-w]:时间+w+jvmId+w+流水号+w+随机数填充+w+tenantId
*/
public static String generateID() {
return generateID(System.currentTimeMillis(), TenantUtil.getTenantId());
}
/**
* 根据指定时间生成主键
*/
public static String generateID(long time) {
return generateID(time, TenantUtil.getTenantId());
}
/**
* 根据指定时间,租户生成主键
*/
public static String generateID(long time, int tenant) {
StringBuilder id = new StringBuilder(LEN);
id.append(Long.toUnsignedString(time, 32)).append(SPLIT)
.append(Long.toUnsignedString(jvmId, 32)).append(SPLIT);
String tenantId = Integer.toUnsignedString(tenant, 32);
// 除去租户ID长度
int length = LEN - tenantId.length() - 1;
// 序列号填充,若填充完超过指定长度,则取后半部分
String seqNum = Long.toUnsignedString(SEQ.incrementAndGet(), 32);
if (id.length() + seqNum.length() > length) {
seqNum = seqNum.substring(id.length() + seqNum.length() - length,
seqNum.length());
}
id.append(seqNum).append(SPLIT);
// 随机数填充,不超过leng长度
while (id.length() < length) {
id.append(Integer.toUnsignedString(RANDOM.nextInt(), 32));
}
id.delete(length, id.length());
return id.append(SPLIT).append(tenantId).toString();
}
RuntimeException 拓展类处理
public KmssRuntimeException(String messageKey) {
super(ResourceUtil.getString(messageKey));
this.code = messageKey;
}
/**
* 本地扩展点的声明采用注解的方式声明,并在注解上使用LocalExtensionPoint的注解<br>
*
* <li>若定义了manager类,插件工厂在初始化时会自动往manager中注入Provider的信息,configurable强制为false。</li>
* <li>若定义了config类,则Plugin.getProvider的class参数为config,返回值为config类的实例。</li>
* <li>若未定义了config类,但定义了baseOn,则Plugin.getProvider的class参数为baseOn,返回值为注解所在类的实例(优先Spring的Bean)。</li>
* <li>未定义config,未定义baseOn,则扩展点无效</li>
*
* @author li.Shangzhi
* @Date: 2019-10-17
*/
@Target({ ElementType.ANNOTATION_TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface LocalExtensionPoint {
//...
}
@EnableConfigurationProperties 与 @ConfigurationProperties 处理
@Configuration
@EnableConfigurationProperties({SystemConfig.class, TenantConfig.class, LicenseConfig.class, LanguageConfig.class, CorsConfig.class})
// 多语言配置信息
@ConfigurationProperties("kmss.lang")
public class LanguageConfig {
//...
}
// 系统配置
@ConfigurationProperties("kmss.system")
public class SystemConfig {
//...
}
交流群
QQ交流群:877056205 mPaaS | 微信交流群:iByte_Li(备注拉群要求) | 微信公众号:码农架构 |
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。