Go to file
weihu 10c993f9d0 🎉 release 0.0.01 2024-03-16 14:59:14 +08:00
.github/workflows update workflow 2023-12-26 15:50:53 +08:00
spring-boot-nebula-aggregate update jdk 11 2023-12-26 15:55:58 +08:00
spring-boot-nebula-aop-base 🎉 release 0.0.01 2024-03-16 14:59:14 +08:00
spring-boot-nebula-common update jdk 11 2023-12-26 15:55:58 +08:00
spring-boot-nebula-dependencies 🎉 release 0.0.01 2024-03-16 14:59:14 +08:00
spring-boot-nebula-distribute-lock 🎉 add DistributedLock 2024-03-16 10:41:47 +08:00
spring-boot-nebula-mybatis 🎉 release 0.0.01 2024-03-16 14:59:14 +08:00
spring-boot-nebula-samples 🎉 release 0.0.01 2024-03-16 14:59:14 +08:00
spring-boot-nebula-web 🎉 release 0.0.01 2024-03-16 14:59:14 +08:00
spring-boot-nebula-web-common 🎉 add DistributedLock 2024-03-16 10:41:47 +08:00
style update style 2023-12-26 15:06:21 +08:00
.gitignore init 2023-03-16 19:55:27 +08:00
LICENSE init 2023-03-16 19:55:27 +08:00
README.md 🎉 release 0.0.01 2024-03-16 14:59:14 +08:00
pom.xml 🎉 add DistributedLock 2024-03-16 10:41:47 +08:00

README.md

spring-boot-nebula

模块说明

每个模块可单独引用使用,不耦合

解决问题

  1. 统一公司所有spring boot项目的依赖管理

不使用common可能存在的问题:

  • a项目使用了 redission 3.14 b项目 使用3.61,然后导致相同代码可能运行结果不一致
  • 统一使用web-spring-boot-start模块或者boot-common-parent可解决不同项目依赖版本不一致问题。 在boot-common-parent管理公司的所有依赖,以后应用项目无需手动指定各种依赖版本只需引用依赖即可,统一在boot-common-parent管理即可
  1. 提供开箱即用的web-spring-boot-start模块解决web开发需要手动封装工具类的痛点

demo

使用参考 spring-boot-nebula-samples模块

spring-boot-nebula-web 使用

  1. 引入依赖
 <dependency>
    <groupId>io.github.weihubeats</groupId>
    <artifactId>spring-boot-nebula-web</artifactId>
    <version>0.0.01</version>
</dependency>
  1. 运行Application.java
  2. 运行 http-test-controller.http中的GET localhost:8088/test

原先web项目需要使用的返回值比如Response<T> ss;

    @GetMapping("/test")
    public Response<String> test() {
        return Response.success("小奏");
    }

现在不需要将自己的返回对象包裹起来,只需要添加注解@NebulaResponseBody

    @GetMapping("/test")
    @NebulaResponseBody
    public String test() {
        return "小奏";
    }

返回结果

{
  "code": 200,
  "data": "小奏",
  "msg": "success"
}

提供开箱即用的分页对象

使用

提供时间戳自动转LocalDateTime注解

@GetTimestamp

    @GetMapping("/test")
    @NebulaResponseBody
    public String test(@GetTimestamp LocalDateTime time) {
        return time.toString();
    }

依赖

  • web

<dependency>
    <groupId>io.github.weihubeats</groupId>
    <artifactId>spring-boot-nebula-web</artifactId>
    <version>0.0.01</version>
</dependency>
  • 分布式锁
<dependency>
    <groupId>io.github.weihubeats</groupId>
    <artifactId>spring-boot-nebula-distribute-lock</artifactId>
    <version>0.0.01</version>
</dependency>
  • ddd聚合根组件
<dependency>
    <groupId>io.github.weihubeats</groupId>
    <artifactId>spring-boot-nebula-aggregate</artifactId>
    <version>0.0.01</version>
</dependency>
  • mybatis-plus
<dependency>
    <groupId>io.github.weihubeats</groupId>
    <artifactId>spring-boot-nebula-mybatis-plus</artifactId>
    <version>0.0.01</version>
</dependency>