Giter Club home page Giter Club logo

bdf3's Introduction

BDF3

BDF3 是基于 Spring Boot 组件化的渐进式企业级开发框架。 提供一系列企业级通用模块功能,使用 BDF3 框架在业务项目,我们可以直接专注到业务功能模块的开发。

欢迎大家联系我们:技术交流、商业合作、共建开源等。

非多租户模式: 演示 BDF3 框架.gif

多租户模式: 演示 BDF3 框架(多租户).gif

特征

  • 零配置,开箱即用。基于 Spring Boot 自动配置机制实现
  • 前端界面可视化开发,基于 Dorado 展现中间件实现
  • 前端组件标准化,后端开发者也能轻松开发前端
  • 抽象业务通用能力,提供通用功能模块,这些通用模块开箱即用,如权限管理、多租户、工作流、报表、实时通信、公众号、微程序、云数据库管理、规则引擎、日志、菜单、认证、字典、数据导入和导出等等
  • 基于角色的权限授权,权限粒度为组件级别
  • 开发企业管理系统效率极高
  • 多数据源智能切换、开启事务
  • 多租户支持,横向无限扩展,传统项目零代码切换为多租户项目
  • 提供丰富多样的主页面选择
  • 功能组件化,自由选择需要的组件
  • 基于 JPA 实现的极简、可读性高的结构化查询 Linq,与 Dorado 无缝集成
  • 基于 Spring Security 实现的认证与授权,开箱即用

在线演示

其中,公司 ID 为 master,用户名/密码为 admin/123456

开发文档

请使用手机扫描本文章最后的 QQ(609822297)群二维码,加群获取开发文档。

快速开始

BDF3 基于 Spring Boot 自动配置机制实现,做到了零配置,开箱即用,没有额外学习成本,BDF3 也提供了一系列 pom 类型的 Starter 模块,也 Spring Boot 提供的 Starter 模块类似,Starter 模块简化了 BDF3 的模块依赖管理,让项目依赖变得更为简单,好维护。

第一步:初始化一个标准的 Maven 项目

创建一个标准的 Maven 项目,名称为 bdf3-sample,项目打包类型为 jar,项目的父项目指向 bdf3-starter-parent。最终生成的 pom文件如下:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <!-- 继承的 BDF3 提供的依赖管理的父项目 -->
  <parent>
    <groupId>com.bstek.bdf3</groupId>
    <artifactId>bdf3-starter-parent</artifactId>
    <version>1.1.0-SNAPSHOT</version>
  </parent>
  <artifactId>bdf3-sample</artifactId>
  <dependencies>
    <!-- 添加 BDF3 提供的预定义依赖 Starter,BDF3 还提供了其他的 Starter -->
    <dependency>
      <groupId>com.bstek.bdf3</groupId>
      <artifactId>bdf3-starter</artifactId>
    </dependency>
    <!-- 开发测试工具 -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-devtools</artifactId>
      <scope>provided</scope>
    </dependency>
    <!-- 数据库驱动,正式场景改为 mysql、oracle 等等数据库驱动 -->
    <dependency> 
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId> 
    </dependency>
  </dependencies>
  <!-- BDF3 提供的模块存放的 maven 私服仓库 -->
  <repositories>
    <repository>
      <id>bsdn-maven-repository</id>
      <url>http://nexus.bsdn.org/content/groups/public/</url>
    </repository>
  </repositories>
</project>

第二步:启动类

package com.bstek.bdf3.sample;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;

/**
 * @author Kevin Yang (mailto:[email protected])
 * @since 2016年12月10日
 */
@SpringBootApplication  // Spring Boot 启动类注解
@EnableCaching          // 开启缓存功能注解
public class SampleApplication {

    public static void main(String[] args) throws Exception {
		    SpringApplication.run(SampleApplication.class, args);
    }
  
}

通过以上两个步骤,一个基本的BDF3 框架的项目就搭建好了。直接运行项目的启动类(运行 main 静态方法)示例下载

数据源与 JPA 配置

在 Spring 的配置中,如下配置:

# 文件 application.properties
# 服务器端口设置
server.port = 8080
# 项目上下文路由
server.context-path=/bdf
# 是否打印sql语句
spring.jpa.showSql=true
#hibernate 反向创建表设置,update启动时更新表结构,create 启动时重新创建表结构,none 启动时不检查
spring.jpa.hibernate.ddl-auto=update
# Spring Boot 热部署设置,添加以下文件匹配规则,改动不重启。
spring.devtools.restart.additional-exclude=com/**
#数据库脚本的编码设置为 UTF-8
spring.datasource.sql-script-encoding=UTF-8

# 数据源配置,pom 中需要引入对应的数据库 jdbc 依赖,以下使用 mysql 数据库为例
spring.datasource.continue-on-error=true
spring.datasource.url=jdbc:mysql://localhost:3306/bdf3
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
# 如果数据库为非嵌入式数据库,这个属性第一次启动的时候一定要设置为ALWAYS,用于初始化数据,初始化好后,可以关闭,也可以不关闭,有自己决定
spring.datasource.initialization-mode=ALWAYS

Spring Boot 文档教程

Spring Boot 文档教程

交流群

bdf3's People

Contributors

cnxobo avatar dependabot[bot] avatar j-cafe avatar lucasyue avatar muxiangqiu avatar williamsese avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bdf3's Issues

与uflo集成失败,不支持吗?

这个工程是不是无法和uflo2集成了,注入uflo需要的sessionfactory就会启动失败。

以下是错误详情:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uflo.instanceDetection' defined in class path resource [uflo-context-configs.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Already value [org.springframework.orm.jpa.EntityManagerHolder@407985b8] for key [org.hibernate.internal.SessionFactoryImpl@52063be6] bound to thread [restartedMain]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1710) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:583) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:388) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1234) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at com.hthj.starvastweb.StarvastWebApplication.main(StarvastWebApplication.java:14) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_144]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_144]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_144]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_144]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.0.0.RELEASE.jar:2.0.0.RELEASE]
Caused by: java.lang.IllegalStateException: Already value [org.springframework.orm.jpa.EntityManagerHolder@407985b8] for key [org.hibernate.internal.SessionFactoryImpl@52063be6] bound to thread [restartedMain]
at org.springframework.transaction.support.TransactionSynchronizationManager.bindResource(TransactionSynchronizationManager.java:193) ~[spring-tx-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.orm.hibernate5.SpringSessionContext.currentSession(SpringSessionContext.java:131) ~[spring-orm-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:464) ~[hibernate-core-5.2.14.Final.jar:5.2.14.Final]
at com.bstek.uflo.env.impl.ContextImpl.getSession(ContextImpl.java:44) ~[uflo-core-2.1.5.jar:na]
at com.bstek.uflo.command.impl.GetTaskReminderCommand.execute(GetTaskReminderCommand.java:38) ~[uflo-core-2.1.5.jar:na]
at com.bstek.uflo.command.impl.GetTaskReminderCommand.execute(GetTaskReminderCommand.java:31) ~[uflo-core-2.1.5.jar:na]
at com.bstek.uflo.command.impl.SpringTransactionCommandService$1.doInTransaction(SpringTransactionCommandService.java:53) ~[uflo-core-2.1.5.jar:na]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at com.bstek.uflo.command.impl.SpringTransactionCommandService.executeCommand(SpringTransactionCommandService.java:51) ~[uflo-core-2.1.5.jar:na]
at com.bstek.uflo.service.impl.DefaultTaskService.getAllTaskReminders(DefaultTaskService.java:358) ~[uflo-core-2.1.5.jar:na]
at com.bstek.uflo.service.impl.SchedulerServiceImpl.initTaskReminders(SchedulerServiceImpl.java:193) ~[uflo-core-2.1.5.jar:na]
at com.bstek.uflo.service.impl.SchedulerServiceImpl.resetScheduer(SchedulerServiceImpl.java:172) ~[uflo-core-2.1.5.jar:na]
at com.bstek.uflo.heartbeat.InstanceDetection.startDaemonJob(InstanceDetection.java:61) ~[uflo-core-2.1.5.jar:na]
at com.bstek.uflo.heartbeat.InstanceDetection.afterPropertiesSet(InstanceDetection.java:116) ~[uflo-core-2.1.5.jar:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1769) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1706) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
... 21 common frames omitted

bdf3的权限管理有bug

  1. 创建不同的角色,给不同角色分配不同的菜单权限。 然后用某一角色A下的用户登陆,出来的菜单是另外一个角色B下的菜单。
  2. 为了验证1,接着测试的时候,删除了角色B,然后查看角色A下用户的菜单权限,看到的还是角色B的菜单权限,重启服务后会更新,但是又会跑到另一个角色C下面,反正就是不匹配角色A的菜单。 这至少证明两个问题:再次证明问题1, 二就是你们的代码里面的Cache控制没有做好,删除角色B的时候就应该当时清理Cache,而不是重启服务。

定义WebSecurityConfigurer太困难

项目中使用@configuration定义WebSecurityConfigurer会跟DoradoWebSecurityConfigurer冲突,项目改为继承DoradoWebSecurityConfigurer会导致自定义的AuthenticationProvider无法正常使用。
希望能提供再配置的扩展方案
//目前项目是去掉的DoradoWebSecurityConfigurer的@component注解解决冲突问题

spring cloud中如何使用

同spring boot一样.spring cloud需要自己的parent定义,而maven不能同时有多个parent定义
<parent> <groupId>com.bstek.bdf3</groupId> <artifactId>bdf3-starter-parent</artifactId> <version>0.0.1-SNAPSHOT</version> </parent>

无法自定义欢迎页面

#登陆页面地址
bdf3.loginPath=com.xxx.core.view.Login.d
登录后页面空白,后台报错,找不到com.xxx.core.view.Login.d
但是单独打开com.xxx.core.view.Login.d是正常的欢迎页面

能否在用户登录相关增加几项安全性限制

数据安全要求越来越高了,是否可以增加如下功能:
1、用户过期限制,设定过期天数后,对于过期用户登陆后强制修改密码;
2、管理用户可强制某用户退出
3、新用户登录后,强制修改密码
4、强密码策略,系统运维人员可配置强密码内容,包含大小写、数字、特殊字符等
5、限制一个用户只能在一个页面打开,不允许多页面登录
6、指定某账户只能有指定的mac或者ip登录
其中3、4、5、6项最好能有一张系统表进行配置,修改后刷新缓存生效

产品新思路建议

先感谢一下锐道的各位大神,从各位大神的代码中我学到了无数的知识.让我成功的从一个混饭吃的成长为一个能养家糊口的汉子.

一直想和你们谈谈我最近工作,我觉得能给你们更多启发,让我们这些程序员更受益

最近换了一家公司,公司引进了一种新的开发模式.能够让产品经理在界面简单配置就能完成产品原型(从需求角度出发而不是技术),开发的主力从程序员变成了需求人员甚至是实习生,一般的项目,他们能完成80%以上的开发工作,而我们开发人员的开发工作变成了实现他们按钮上需要实现的逻辑就好了.所以一个项目组的配置变成了:一个产品经理+2-4个需求人员+1个开发+2-4个实习生,效率就不说了,我们一个陆陆续续达到10人的技术团队在半年内同时完成了10个项目的研发.

当然这个框架唯一让我吐槽的就是他们的技术框架太落后,还是jsp时代产物,连事物管理都没有.

产品思路参考下图,模板的地位比较重要

https://wiki.ling2.cn/images/e/e6/Ling-cloud.png

关于importer.excelUploadFileProcessor方法

调用这个方法的时候,能不能传入参数赋值给实体的某个字段,而不是通过excel读取赋值。比如这个实体的外键,需要传入参数赋值,而不是从excel中读取

如何集成echart?

已经添加了dorado-echart-1.0.0 的jar包,但是找不到echart控件。这一块如何处理?谢谢。

关于dataGrid的操作

有没有类似索引的属性,在dataGrid的数据更新后,指定当前行。现在的状况是更新dataSet后,dataGrid会自动选中第一行为当前行(这个当前行是操作前的当前行)。@J-cafe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.