GithubHelp home page GithubHelp logo

fanqinghui / springboot-platform Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 8.0 51 KB

springboot-platform是一个基于Spring Boot & MyBatis的多模块项目,用于快速构建中小型API、RESTful API,以及企业级项目,该项目稳定、简单、快速,使我们摆脱那些重复劳动,专注于业务代码的编写,减少加班

Java 100.00%
springboot multi-modules springboot-mybatis springboot-sample springboot-multi-modules

springboot-platform's Introduction

springboot 多模块项目springboot-platform

缘起

简单的项目可以使用直接springboot搭建一个项目工程来完成工作,例如我github上的另外一个项目 action,但是另外一些项目比较庞大就必须采用分层结构,所以这个项目就是一个比较完成的多模块项目搭建

模块

  1. platform-common:公用组建
  2. platform-dao: 数据操作层
  3. platform-service:业务操作层
  4. platform-webapi:接口或数据展示层

特征&提供

  • 最佳实践的项目结构、配置文件、精简的POM
  • 统一响应结果封装及生成工具
  • 统一异常处理
  • 简单的接口签名认证
  • 常用基础方法抽象封装
  • 使用HikariCP数据库连接
  • 集成MyBatis、通用Mapper插件、PageHelper分页插件,实现单表业务零SQL

快速开始

  1. 根据业务在基础代码上进行扩展
  2. 对开发环境配置文件application-dev.properties进行配置,启动项目!

开发建议

  • 表名,建议使用小写,多个单词使用下划线拼接
  • Model内成员变量建议与表字段数量对应,如需扩展成员变量(比如连表查询)建议创建DTO,否则需在扩展的成员变量上加@Transient注解,详情见通用Mapper插件文档说明
  • 建议业务失败直接使用ServiceException("message")抛出,由统一异常处理器来封装业务失败的响应结果,比如throw new ServiceException("该手机号已被注册"),会直接被封装为{"code":400,"message":"该手机号已被注册"}返回,无需自己处理,尽情抛出
  • 需要工具类的话建议先从guava中找,实在没有再造轮子或引入类库,尽量精简项目
  • 开发规范建议遵循阿里巴巴Java开发手册(最新版下载)
  • 建议在公司内部使用ShowDocSpringFox-Swagger2RAP等开源项目来编写、管理API文档

技术选型&文档

  • SpringBoot 快速的java开发框架,大大提高程序员的开发效率
  • MyBatis PageHelper分页插件(查看官方中文文档

springboot-platform's People

Contributors

fanqinghui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.