Coder Social home page Coder Social logo

hs-web / hsweb-framework Goto Github PK

View Code? Open in Web Editor NEW
8.3K 714.0 3.0K 32.94 MB

hsweb (haʊs wɛb) 是一个基于spring-boot 2.x开发 ,首个使用全响应式编程的企业级后台管理系统基础项目。

Home Page: http://hsweb.me

License: Apache License 2.0

Java 99.75% JavaScript 0.24% Shell 0.01%
spring-boot javaweb mybatis java java8 hsweb reactor reactive-streams spring-webflux r2dbc

hsweb-framework's Introduction

hsweb4 基于spring-boot2,全响应式的后台管理框架

Codecov Build Status License

功能,特性

  • 基于r2dbc ,easy-orm 的通用响应式CRUD
    • H2,Mysql,SqlServer,PostgreSQL
  • 响应式r2dbc事务控制
  • 响应式权限控制,以及权限信息获取
    • RBAC权限控制
    • 数据权限控制
    • 双因子验证
  • 多维度权限管理功能
  • 响应式缓存
  • 非响应式支持(mvc,jdbc)
  • 内置业务功能
    • 权限管理
      • 用户管理
      • 权限设置
      • 权限分配
    • 文件上传
      • 静态文件上传
      • 文件秒传
    • 数据字典

示例

https://github.com/zhou-hao/hsweb4-examples

应用场景

  1. 完全开源的后台管理系统.
  2. 模块化的后台管理系统.
  3. 功能可拓展的后台管理系统.
  4. 集成各种常用功能的后台管理系统.
  5. 前后分离的后台管理系统.

注意: 项目主要基于spring-boot,spring-webflux. 在使用hsweb之前,你应该对 project-reactor , spring-boot 有一定的了解.

项目模块太多?不要被吓到.我们不推荐将本项目直接clone后修改,运行.而是使用maven依赖的方式使用hsweb. 选择自己需要的模块进行依赖,正式版发布后,所有模块都将发布到maven**仓库.

文档

各个模块的使用方式查看对应模块下的 README.md,在使用之前, 你可以先粗略浏览一下各个模块,对每个模块的作用有大致的了解.

核心技术选型

  1. Java 8
  2. Maven3
  3. Spring Boot 2.x
  4. Project Reactor 响应式编程框架
  5. hsweb easy orm 对r2dbc的orm封装

模块简介

模块 说明
hsweb-authorization 权限控制
hsweb-commons 基础通用功能
hsweb-concurrent 并发包,缓存,等
hsweb-core 框架核心,基础工具类
hsweb-datasource 数据源
hsweb-logging 日志
hsweb-starter 模块启动器
hsweb-system 系统常用功能

核心特性

  1. 响应式,首个基于spring-webflux,r2dbc,从头到位的响应式.
  2. DSL风格,可拓展的通用curd,支持前端直接传参数,无需担心任何sql注入.
  //where name = #{name}
  createQuery()
          .where("name",name)
          .fetch();

          //update s_user set name = #{user.name} where id = #{user.id}
          createUpdate()
          .set(user::getName)
          .where(user::getId)
          .execute();
  1. 类JPA增删改
@Table(name = "s_entity")
public class MyEntity {
    
    @Id
    private String id;
    
    @Column
    private String name;

    @Column
    private Long createTime;
}

直接注入即可实现增删改查

@Autowire
private ReactiveRepository<MyEntity, String> repository;
  1. 灵活的权限控制
@PostMapping("/account")
@SaveAction
public Mono<String> addAccount(@RequestBody Mono<Account> account){
     return accountService.doSave(account);
}

License

Apache 2.0

Stargazers over time

hsweb-framework's People

Contributors

asiaon123 avatar cayre avatar chaozhang03 avatar chongzhe avatar dependabot[bot] avatar eddychao avatar gitter-badger avatar gmle avatar goten7 avatar jiarg avatar just-a-stone avatar kyouji avatar lianganjian avatar liangshishen avatar liu4410 avatar longfeizheng avatar ningqingsheng avatar wangzheng0723 avatar wujun8 avatar wwang222 avatar zeje avatar zhou-hao 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  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

hsweb-framework's Issues

功能完善建议

能不能提前完善机构组织功能,以及机构组织的权限控制问题

使用反馈

我想使用你这套开源的项目搭建基础框架。但是发现项目引用太多。很难运行起来。各种自家的项目。非常麻烦。既然是后台管理基础框架。为什么不把你的自家项目需要的放在hsweb-framework下,大不了新增一个module。现在很痛苦弄起来。希望能够交流。

配置多数据源的时候遇到的错误

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'datasource' defined in class path resource [org/hswebframework/web/datasource/jta/AtomikosDataSourceAutoConfiguration.class]: Invocation of init method failed; nested exception is com.atomikos.jdbc.AtomikosSQLException: Property 'xaDataSourceClassName' cannot be null

代码风格,比如 if {}

看了些代码,有些单行 if 没 {} 倒是显得方法体简介。不过大块代码的 if 没有 {} 括起来还有点不习惯。

后续我希望能贡献贡献代码。

mvn install 报错

  1. Bugs,如果你发现了项目中存在bug,请详细描述bug存在的位置,复现的条件,以及bug引起的问题.如果可能,尽量提供复现代码.
  2. 新特性,如果你觉得项目中的某些功能不够好,或者不能满足您的需求,你可以对需求进行详细描述,我会酌情改进.
  3. 项目中遇到疑问,请确定已经看过wiku中的内容,并且在issues中未找到你需要的答案,你可以加入qq群515649185询问或者直接提issue.

image

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project hsweb-authorization-basic: Compilation failure
[ERROR] /Users/user/Code/hsweb-framework/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/handler/access/OwnCreatedDataAccessHandler.java:[148,21] 对于collect(java.util.stream.Collector<java.lang.Object,capture#1, 共 ?,java.util.List<java.lang.Object>>), 找不到合适的方法
[ERROR]     方法 java.util.stream.Stream.<R>collect(java.util.function.Supplier<R>,java.util.function.BiConsumer<R,? super capture#2, 共 ?>,java.util.function.BiConsumer<R,R>)不适用
[ERROR]       (无法推断类型变量 R
[ERROR]         (实际参数列表和形式参数列表长度不同))
[ERROR]     方法 java.util.stream.Stream.<R,A>collect(java.util.stream.Collector<? super capture#2, 共 ?,A,R>)不适用
[ERROR]       (无法推断类型变量 R,A,capture#3, 共 ?,T
[ERROR]         (参数不匹配; java.util.stream.Collector<capture#2, 共 ?,capture#4, 共 ?,java.util.List<capture#2, 共 ?>>无法转换为java.util.stream.Collector<? super capture#2, 共 ?,capture#4, 共 ?,java.util.List<capture#2, 共 ?>>))
java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
javac -version
javac 1.8.0_25

欢迎使用hsweb

hsweb发展已经近2年,即将推出pro版,此版本依然将开源下去,后期将提供付费模式帮助hsweb更好的发展.

  • 全新的ui,使用layui作为新的ui框架,并对其封装 (layui不太适用,放弃之)
  • 全新的表单设计器,可拖拽设计表单
  • 多种权限设置方式
  • 更多的模板项目

更多想要的功能,特性? comment 吧. 我会酌情加入到hsweb中

lombok导入

看到项目中并没有使用lombok。是否考虑使用?为了减少代码量和增强可读性。

ezorm和util的代码能否公开,学习一下

这几天在github上溜达,看到这个项目,感觉框架不错,检出来发现有几个内部功能模块是没有代码的,以jar包的形式提供依赖,布置能否给共享一下,学习整体框架。多谢!
以下这三处的代码没有找到,不知是我是我的遗漏,没找到地方:
<hsweb.ezorm.version>3.0.1-SNAPSHOT</hsweb.ezorm.version>
<hsweb.utils.version>3.0.2</hsweb.utils.version>
<hsweb.expands.version>3.0.2-SNAPSHOT</hsweb.expands.version>

logback-spring

项目中使用到了logback.xml。
为了方便更换profiles,是否考虑将logback更换成logback-spring?

maven 循环依赖

image

你好,clone下来的代码,idea提示maven循环依赖了
Project hsweb-framework: there is circular dependency between 'hsweb-commons-controller' module, 'hsweb-authorization-shiro' module

mac下运行报错

java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:804) [spring-boot-1.4.5.RELEASE.jar:1.4.5.RELEASE]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:785) [spring-boot-1.4.5.RELEASE.jar:1.4.5.RELEASE]
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:772) [spring-boot-1.4.5.RELEASE.jar:1.4.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:317) [spring-boot-1.4.5.RELEASE.jar:1.4.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1187) [spring-boot-1.4.5.RELEASE.jar:1.4.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1176) [spring-boot-1.4.5.RELEASE.jar:1.4.5.RELEASE]
at org.hswebframework.web.demo.Application.main(Application.java:41) [classes/:na]
Caused by: java.lang.RuntimeException: java.lang.UnsupportedOperationException: format version ${project.version} error
at org.hswebframework.web.starter.init.SystemInitialize.initReadyToInstallDependencies(SystemInitialize.java:140) ~[hsweb-spring-boot-starter-3.0-SNAPSHOT.jar:na]
at org.hswebframework.web.starter.init.SystemInitialize.install(SystemInitialize.java:176) ~[hsweb-spring-boot-starter-3.0-SNAPSHOT.jar:na]
at org.hswebframework.web.starter.SystemInitializeAutoConfiguration.run(SystemInitializeAutoConfiguration.java:154) ~[hsweb-spring-boot-starter-3.0-SNAPSHOT.jar:na]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:801) [spring-boot-1.4.5.RELEASE.jar:1.4.5.RELEASE]
... 6 common frames omitted
Caused by: java.lang.UnsupportedOperationException: format version ${project.version} error
at org.hswebframework.web.starter.Version.setVersion(SystemVersion.java:209) ~[hsweb-spring-boot-starter-3.0-SNAPSHOT.jar:na]
at org.hswebframework.web.starter.SystemVersion$Dependency.setVersion(SystemVersion.java:128) ~[hsweb-spring-boot-starter-3.0-SNAPSHOT.jar:na]
at org.hswebframework.web.starter.SystemVersion$Dependency.fromMap(SystemVersion.java:162) ~[hsweb-spring-boot-starter-3.0-SNAPSHOT.jar:na]
at org.hswebframework.web.starter.init.DependencyInstaller.setup(DependencyInstaller.java:35) ~[hsweb-spring-boot-starter-3.0-SNAPSHOT.jar:na]
at jdk.nashorn.internal.scripts.Script$Recompilation$1$11$^eval_.L:1(:280) ~[na:na]
at jdk.nashorn.internal.scripts.Script$^eval_.:program(:1) ~[na:na]
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637) ~[nashorn.jar:na]
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494) ~[nashorn.jar:na]
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) ~[nashorn.jar:na]
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:421) ~[nashorn.jar:na]
at jdk.nashorn.api.scripting.NashornScriptEngine.access$300(NashornScriptEngine.java:73) ~[nashorn.jar:na]
at jdk.nashorn.api.scripting.NashornScriptEngine$3.eval(NashornScriptEngine.java:514) ~[nashorn.jar:na]
at org.hswebframework.expands.script.engine.common.CommonScriptEngine.execute(CommonScriptEngine.java:110) ~[hsweb-expands-script-3.0.0.jar:na]
at org.hswebframework.web.starter.init.SystemInitialize.initReadyToInstallDependencies(SystemInitialize.java:135) ~[hsweb-spring-boot-starter-3.0-SNAPSHOT.jar:na]
... 9 common frames omitted

SimpleAuthenticationBuilder.java

方法
public AuthenticationBuilder permission(String permissionJson) {
循环创建权限 代码
JSONObject jsonObject = jsonArray.getJSONObject(0);
这个0不对

岗位删除后sql异常

岗位中新建一个人,然后在把人员的岗位信息删除,此用户在登录会出现登录sql异常

cache换成redis,key保存类型转换错误

@Override
@Cacheable(key = "'ids:'+#id==null?'0':#id.hashCode()")
public List<MenuEntity> selectByPk(List<String> id) {
return super.selectByPk(id);
}

java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
修改为
@Cacheable(key = "'ids:'+(#id==null?'0':#id.hashCode())") 正常

访问日志监控@AccessLogger(value = "xxxxxxxxxxx", ignore = true)注解不生效问题

  1. 问题描述:
    我这边使用中发现ctrl中的方法无论是否加@AccessLogger(value = "xxxxxxxxxxx", ignore = true) 方法都会被监控,且value值没有被放到监控结果中。
  2. 复现步骤:
  3. 日志内容:

"method": "create(ReqObject data,HttpServletRequest request,HttpServletResponse response)",
"target": "cn.lz.xilaimanager.mongo.web.AddressBookController",
"parameters": {},
"httpHeaders": {},
"httpMethod": "POST",
"ip": "0:0:0:0:0:0:0:1",
"url": "http://localhost:1882/addressBook/create",
"response": {},
"requestTime": 1528448140997,
"responseTime": 1528448141654,
"id": "9be78109694ab97614236f61cd6bcc6a",
"useTime": 657

后台执行groovy脚本写入数据库内容出错

使用版本: 2.2
根据文档,我在后台生成了一个Owner的模块,然后生成了一个脚本需要写入s_modules表中,但是我再后台管理界面无法执行,当我执行的时候报错,错误原因为:

Caused by: groovy.lang.MissingPropertyException: No such property: database for class: Script6
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
	at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:52)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:307)
	at Script6.run(Script6.groovy:4)

我的代码是:

def owner_module= [u_id: 'owner', name: '管理员', uri: 'admin/owner/list.html', icon: '', parent_id: '-1', remark: '', status: 1, optional: '[{"id":"M","text":"菜单可见","checked":true},{"id":"import","text":"导入excel","checked":true},{"id":"export","text":"导出excel","checked":true},{"id":"R","text":"查询","checked":true},{"id":"C","text":"新增","checked":true},{"id":"U","text":"修改","checked":true},{"id":"D","text":"删除","checked":false}]', sort_index: 1];
database.getTable("s_modules").createInsert().value(owner_module).exec();

,是因为模板里面没有注入database变量吗? 然后我在启动的时候写了一个脚本可以执行,但是执行后无法在数据库表中看到数据插入了.

oauth

使用simple中的 server和client在AuthenticationHolder中无法获取用户id,用户id是什么时候赋值到threadlocal中的?

HttpTokenRequest 这个类貌似有点问题

protected ClientCredentials getClientCredentials(String principal, String credentials, String authorization) {
if ((principal == null || credentials == null) && authorization == null) {
return null;
}
if (authorization != null && !authorization.isEmpty()) {
String[] decodeCredentials = decodeClientAuthenticationHeader(authorization);
if (decodeCredentials.length > 1) {
principal = decodeCredentials[0];
credentials = decodeCredentials[1];
} else {
credentials = decodeCredentials[0];
}
}
return new ClientCredentials(principal, credentials);
}

protected String[] decodeClientAuthenticationHeader(String authenticationHeader) {
    if (StringUtils.isNullOrEmpty(authenticationHeader)) {
        return null;
    } else {
        String[] tokens = authenticationHeader.split(" ");
        if (tokens.length != 2) {
            return null;
        } else {
            String authType = tokens[0];
            if (!"basic".equalsIgnoreCase(authType)) {
                return ErrorType.OTHER.throwThis(GrantTokenException::new, "authentication " + authType + " not support!");
            } else {
                String encodedCreds = tokens[1];
                return decodeBase64EncodedCredentials(encodedCreds);
            }
        }
    }
}

我的问题是
if (authorization != null && !authorization.isEmpty()) {
String[] decodeCredentials = decodeClientAuthenticationHeader(authorization);
if (decodeCredentials.length > 1) {
principal = decodeCredentials[0];
credentials = decodeCredentials[1];
} else {
credentials = decodeCredentials[0];
}
这段代码中,如果decodeClientAuthenticationHeader函数获取到的结果为null,那么获取decodeCredentials[0]不是会有问题吗?

自己搭了一个框架集成hsweb-2.2的时候遇到了MybatisProperties重复注入bean的问题

我自己框架里面集成hsweb启动的时候遇到了Mybatis官方的AutoConfiguration 会找到两个bean,不知道用哪一个注入的问题,错误原因:

Description:

Field properties in org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration required a single bean, but 2 were found:
	- mybatis-org.hsweb.web.mybatis.MybatisProperties: defined in null
	- mybatis-org.mybatis.spring.boot.autoconfigure.MybatisProperties: defined in null


Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed

是否Mybatis的AutoConfiguration应该在hsweb的MybatisAutoConfiguration之前?他们的启动逻辑是怎样的?
我找到了一个解决办法就是org.hsweb.web.mybatis.MybatisProperties不继承 org.mybatis.spring.boot.autoconfigure.MybatisProperties,这样在Mybatis官方自动装配的时候便不会找到两个properties了。有没有什么办法把官方的MyBatiesProperties屏蔽了呢?

我的pom文件如下:
story-admin

<?xml version="1.0" encoding="UTF-8"?>
<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>

	<artifactId>admin</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>story-admin</name>
	<description>Demo project for Spring Boot</description>

	<parent>
		<groupId>org.yoqu</groupId>
		<artifactId>story-magic</artifactId>
		<version>0.0.1-SNAPSHOT</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<java.version>1.8</java.version>
	</properties>

	<dependencies>

		<!--<dependency>-->
			<!--<groupId>org.springframework.boot</groupId>-->
			<!--<artifactId>spring-boot-starter-web</artifactId>-->
		<!--</dependency>-->

		<!--<dependency>-->
			<!--<groupId>org.springframework.boot</groupId>-->
			<!--<artifactId>spring-boot-starmappers.testtest</artifactId>-->
			<!--<scmappers.testtest</scope>-->
		<!--</dependency>-->
		<dependency>
			<groupId>org.fusesource</groupId>
			<artifactId>sigar</artifactId>
			<version>1.6.4</version>
			<exclusions>
				<exclusion>
					<groupId>log4j</groupId>
					<artifactId>log4j</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!--
        ui模块,目前仅提供了一个ui实现
        https://github.com/hs-web/hsweb-platform/tree/master/hsweb-platform-ui-miniui
        -->
		<dependency>
			<groupId>org.hsweb</groupId>
			<artifactId>hsweb-platform-ui-miniui</artifactId>
			<version>2.2-SNAPSHOT</version>
			<exclusions>
				<exclusion>
					<groupId>org.hsweb</groupId>
					<artifactId>hsweb-web-core</artifactId>
				</exclusion>
			</exclusions>
		</dependency>



		<dependency>
			<groupId>org.yoqu</groupId>
			<artifactId>story-dao</artifactId>
			<version>${story.framework.version}</version>
		</dependency>

	</dependencies>

	<dependencyManagement>
		<!--统一依赖,有没有发现上面不需要写版本号了-->
		<dependencies>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-dependencies</artifactId>
				<version>${spring.boot.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.hsweb</groupId>
				<artifactId>hsweb-framework</artifactId>
				<version>${hsweb.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<finalName>${project.artifactId}</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<source>${java.version}</source>
					<target>${java.version}</target>
					<encoding>${project.build.sourceEncoding}</encoding>
				</configuration>
			</plugin>
			<!--spring-boot插件,有了它才能执行 mvn spring-boot:run命令,以及mvn package 打可运行jar包-->
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<version>${spring.boot.version}</version>
				<configuration>
					<mainClass>org.yoqu.story.admin.StoryAdminApplication</mainClass>
					<layout>ZIP</layout>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

</project>

story-dao:

<?xml version="1.0" encoding="UTF-8"?>
<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>

	<artifactId>story-dao</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>story-dao</name>
	<description>Demo project for Spring Boot</description>
	<parent>
		<groupId>org.yoqu</groupId>
		<artifactId>story-magic</artifactId>
		<version>0.0.1-SNAPSHOT</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<java.version>1.8</java.version>
	</properties>

	<dependencies>
		<!--
              1、动态数据源支持,如果不引入此依赖,动态数据源将无法使用。
              2、配置application.yml -> hsweb.dynamic-datasource失效。
              3、请自行配置数据源application.yml -> spring.datasource。
              -->
		<dependency>
			<groupId>org.hsweb</groupId>
			<artifactId>hsweb-web-datasource</artifactId>
		</dependency>

		<!--
        hsweb 核心依赖
        https://github.com/hs-web/hsweb-framework
        -->
		<dependency>
			<groupId>org.hsweb</groupId>
			<artifactId>hsweb-web-starter</artifactId>
		</dependency>

		<dependency>
			<groupId>org.hsweb</groupId>
			<artifactId>hsweb-web-core</artifactId>
			<version>${hsweb.version}</version>
		</dependency>

		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>druid</artifactId>
			<version>1.0.26</version>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<dependencyManagement>
		<!--统一依赖,有没有发现上面不需要写版本号了-->
		<dependencies>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-dependencies</artifactId>
				<version>${spring.boot.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.hsweb</groupId>
				<artifactId>hsweb-framework</artifactId>
				<version>${hsweb.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>
	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>


</project>

story-magic:

<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">
    <artifactId>story-magic</artifactId>
    <groupId>org.yoqu</groupId>
    <version>0.0.1-SNAPSHOT</version>
    <modelVersion>4.0.0</modelVersion>
    <packaging>pom</packaging>

    <name>story-magic</name>
    <url>http://maven.apache.org</url>

    <modules>
        <module>story-worker</module>
        <module>story-admin</module>
        <module>story-api</module>
        <module>story-dao</module>
        <module>story-frontend</module>
        <module>eureka-server</module>
        <module>common-utils</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <story.framework.version>0.0.1-SNAPSHOT</story.framework.version>
        <java.version>1.8</java.version>
        <spring.boot.version>1.5.3.RELEASE</spring.boot.version>
        <spring.cloud.version>1.3.1.RELEASE</spring.cloud.version>
        <webmagic-version>0.7.0</webmagic-version>
        <hsweb.version>2.2.2-SNAPSHOT</hsweb.version>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <target>
                        ${java.version}
                    </target>
                    <source>
                        ${java.version}
                    </source>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>hsweb-nexus</id>
            <name>Nexus Repository</name>
            <url>http://nexus.hsweb.me/content/groups/public/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>nexus-aliyun</id>
            <name>Nexus Aliyun</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>hsweb-nexus</id>
            <name>Nexus Repository</name>
            <url>http://nexus.hsweb.me/content/groups/public/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</project>

多数据源切换事务问题

我看了你的代码,跨库操作时,事务只针对当前库
例如我修改A库数据,同时修改B库数据
这时B库出问题,只能回滚B库的数据,A库已经修改成功了

启动类开启访问日志 @EnableAccessLogger后,org.springframework.boot.autoconfigure.web.BasicErrorController也被拦截

  1. 问题描述:
    启动类开启访问日志 @EnableAccessLogger后,每次各请求会有有个
    {"method":"getErrorPath()","target":"org.springframework.boot.autoconfigure.web.BasicErrorController"
    被拦截

  2. 复现步骤:

  3. 日志内容:

2018-06-08 16:55:48.606[http-nio-1882-exec-4]INFO access-logger -{"method":"getErrorPath()","target":"org.springframework.boot.autoconfigure.web.BasicErrorController","parameters":{},"httpHeaders":{"content-type":"application/json","cache-control":"no-cache","postman-token":"6b10a7ae-410e-4b3c-ae9e-024bc9aac899","user-agent":"PostmanRuntime/7.1.1","accept":"/","host":"localhost:1882","accept-encoding":"gzip, deflate","content-length":"416","connection":"keep-alive"},"httpMethod":"POST","ip":"0:0:0:0:0:0:0:1","url":"http://localhost:1882/addressBook/create","response":"/error","requestTime":1528448147883,"responseTime":1528448147884,"id":"261b59891e589075c5996bd980cbf9f4","useTime":1}

有人清楚这个错误是怎么产生的吗?

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.hswebframework.web.tests.SimpleWebApplicationTests$Config]; nested exception is java.io.FileNotFoundException: class path resource [org/apache/ibatis/plugin/Interceptor.class] cannot be opened because it does not exist

Demo无法登陆

你好,Demo的演示项目不知道为什么无法登陆,返回524 Origin Time-out

关于多数据源示例

Hi!
我clone 了工程后,看到有个子模块做多数据源,但没搜索到具体使用的地方示例。

代码生成器 未设置变量: sourceDir

运行hsweb-demo-master 使用代码生成器写出到开发环境提示“未设置变量: sourceDir”,请问这个在哪里设置,点击右上角“设置”,settings未定义

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.