Giter Club home page Giter Club logo

springboot-example's Introduction

代码规范

  • 项目包名请使用单数
  • 资源类名称请使用单数
  • 资源URL名称请使用复数
  • 变量和方法的命名请使用驼峰规范
  • 请使用lombok,取代Getter,Setter和toString等
  • 命名规范:
    • XXXResource(资源接口)
    • XXXRequestDTO(请求DTO)
    • XXXResponseDTO(响应DTO)
    • XXXService(服务)
    • XXXDAO(数据访问对象)

分层架构


### 
── config (配置相关)
│   ├── Constants.java
│   └── SwaggerConfiguration.java
├── dao 《数据访问层》
│   └── package-info.java
├── domain (领域相关)
│   └── Hello.java
├── rest 《控制层》      
│   ├── dto
│   │   ├── request
│   │   └── response
│   └── resource
│       └── HelloResource.java
└── service 《服务层》
    └── HelloService.java

经典三层架构.png

架构守护

ARCHUNIT是一个基于 Java 的测试库,用于检查代码的结构特性,如包和类的依赖关系、注解验证,还能检查代码分层是否一致,它可以在现有的测试环境中以单元测试的方式运⾏。

  • 分层架构守护测试,如图: 分层架构守护.png

  • 循环依赖检测,如图: 分层依赖.png

本地强制检测

  • Checkstyle编码风格。
  • 提交日志检测。e.g:“[Your name] commit messages”。
  • 测试覆盖率检测, 分支和语句覆盖率大于70%。
  • Push前,本地强制运行mvn clean package。
  • test2

springboot-example's People

Contributors

guming avatar

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.