MCPcopy Index your code
hub / github.com/hs-web/hsweb-framework

github.com/hs-web/hsweb-framework @5.0.1

repository ↗ · DeepWiki ↗ · release 5.0.1 ↗ · + Follow
3,402 symbols 11,220 edges 691 files 667 documented · 20% updated 10d ago4.0.20 · 2025-10-27★ 8,4023 open issues
README

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

Codecov Build Status License

功能,特性

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

示例

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

Extension points exported contracts — how you extend this code

ReactiveAuthenticationManager (Interface)
授权信息管理器,用于获取用户授权和同步授权信息 @author zhouhao @see 3.0 [7 implementers]
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/ReactiveAuthenticationManager.java
AopMethodAuthorizeDefinitionCustomizerParser (Interface)
自定义权限控制定义,在拦截到方法后,优先使用此接口来获取权限控制方式 @see AuthorizeDefinition @author zhouhao [10 implementers]
hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/aop/AopMethodAuthorizeDefinitionCustomizerParser.java
ToStringOperator (Interface)
@author zhouhao @since 3.0.0-RC [25 implementers]
hsweb-core/src/main/java/org/hswebframework/web/bean/ToStringOperator.java
Entity (Interface)
实体总接口,所有实体需实现此接口 @author zhouhao @since 3.0 [5 implementers]
hsweb-commons/hsweb-commons-api/src/main/java/org/hswebframework/web/api/crud/entity/Entity.java
TestEntity (Interface)
(no doc) [10 implementers]
hsweb-starter/src/test/java/org/hswebframework/web/starter/jackson/CustomTypeFactoryTest.java
DataSourceSwitchStrategyMatcher (Interface)
数据源切换策略,可通过此接口来自定义数据源切换的方式 @author zhouhao @since 3.0.0-RC [4 implementers]
hsweb-datasource/hsweb-datasource-api/src/main/java/org/hswebframework/web/datasource/strategy/DataSourceSwitchStrategyMatcher.java
ScopePredicate (Interface)
(no doc) [36 implementers]
hsweb-authorization/hsweb-authorization-oauth2/src/main/java/org/hswebframework/web/oauth2/server/ScopePredicate.java
AccessLoggerParser (Interface)
(no doc) [5 implementers]
hsweb-logging/hsweb-access-logging-aop/src/main/java/org/hswebframework/web/logging/aop/AccessLoggerParser.java

Core symbols most depended-on inside this repo

get
called by 259
hsweb-core/src/main/java/org/hswebframework/web/context/Context.java
as
called by 168
hsweb-commons/hsweb-commons-crud/src/main/java/org/hswebframework/web/crud/query/QueryHelper.java
put
called by 162
hsweb-core/src/main/java/org/hswebframework/web/context/Context.java
add
called by 141
hsweb-commons/hsweb-commons-crud/src/main/java/org/hswebframework/web/crud/web/SaveController.java
getName
called by 140
hsweb-core/src/test/java/org/hswebframework/web/bean/FastBeanCopierTest.java
isEmpty
called by 106
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/define/AuthorizeDefinition.java
accept
called by 99
hsweb-commons/hsweb-commons-crud/src/main/java/org/hswebframework/web/crud/query/DefaultQueryHelper.java
empty
called by 96
hsweb-commons/hsweb-commons-api/src/main/java/org/hswebframework/web/api/crud/entity/PagerResult.java

Shape

Method 2,609
Class 566
Interface 196
Enum 30
Function 1

Languages

Java100%
TypeScript1%

Modules by API surface

hsweb-commons/hsweb-commons-crud/src/main/java/org/hswebframework/web/crud/query/DefaultQueryHelper.java102 symbols
hsweb-core/src/main/java/org/hswebframework/web/bean/FastBeanCopier.java43 symbols
hsweb-commons/hsweb-commons-crud/src/main/java/org/hswebframework/web/crud/query/QueryAnalyzerImpl.java41 symbols
hsweb-commons/hsweb-commons-crud/src/main/java/org/hswebframework/web/crud/query/QueryHelper.java33 symbols
hsweb-core/src/main/java/org/hswebframework/web/i18n/LocaleUtils.java28 symbols
hsweb-core/src/main/java/org/hswebframework/web/dict/EnumDict.java27 symbols
hsweb-commons/hsweb-commons-crud/src/main/java/org/hswebframework/web/crud/query/QueryAnalyzer.java26 symbols
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/token/redis/RedisUserTokenManager.java24 symbols
hsweb-core/src/test/java/org/hswebframework/web/bean/FastBeanCopierTest.java23 symbols
hsweb-commons/hsweb-commons-crud/src/main/java/org/hswebframework/web/crud/configuration/EasyormConfiguration.java23 symbols
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/token/LocalUserToken.java23 symbols
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/token/DefaultUserTokenManager.java23 symbols

Dependencies from manifests, versioned

ch.qos.logback:logback-classic
com.github.spotbugs:spotbugs-annotations4.9.3 · 1×
com.google.code.findbugs:jsr3053.0.2 · 1×
com.google.guava:guava33.4.8-jre · 1×
com.h2database:h2
commons-beanutils:commons-beanutils1.11.0 · 1×
commons-codec:commons-codec

For agents

$ claude mcp add hsweb-framework \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact