Go to file
weihu 4104efbccb add test 2023-12-26 15:17:46 +08:00
.github/workflow add github action 2023-12-26 15:15:16 +08:00
spring-boot-nebula-aggregate add ddd aggregate 2023-12-18 20:02:59 +08:00
spring-boot-nebula-common add ddd aggregate 2023-12-18 20:02:59 +08:00
spring-boot-nebula-dependencies add ddd aggregate 2023-12-18 20:02:59 +08:00
spring-boot-nebula-samples update demo 2023-08-09 10:11:49 +08:00
spring-boot-nebula-web add test 2023-12-26 15:17:46 +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 add utils 2023-12-08 10:56:54 +08:00
pom.xml add ddd aggregate 2023-12-18 20:02:59 +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模块

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"
}

提供开箱即用的分页对象

使用