# spring-boot-framework **Repository Path**: ming6580/spring-boot-framework ## Basic Information - **Project Name**: spring-boot-framework - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-02 - **Last Updated**: 2024-04-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # spring-boot-framework Project ### 系统打包 ```sh #mvn clean install -Dmaven.test.skip=true ``` ### 系统启动 ```sh #java -jar -Xms512m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError xxx.jar ``` ### swagger地址 ```http http://localhost:8080/doc.html ``` ### 包设计 | 包名 | 说明 | | ----------------- | ---------------- | | deploy | 系统部署相关 yaml中除configmap相关开发负责外,其他运维负责! | | doc | 系统SQL脚本、系统说明文件等 | | logs | 日志相关 | | src.main.bin | 系统shell脚本 | | src.main.build | 系统打包配置 | | com.zmj.framework | 系统框架相关源码 | | com.zmj.framework.authorization |统一权限相关| | com.zmj.framework.base |mybatis-plus相关基础封装包| | com.zmj.framework.circuitBreaker |断路器| | com.zmj.framework.common |公共部分代码| | com.zmj.framework.config |spring boot配置| | com.zmj.framework.constant |封装的静态类| | com.zmj.framework.exception |封装的异常类| | com.zmj.framework.handler |日志、异常、持久层拦截处理类| | com.zmj.framework.intercepter |openfeign拦截器| | com.zmj.framework.request |封装请求| | com.zmj.framework.response |封装响应| | com.zmj.framework.util |封装的工具类| | com.zmj.base | 系统通用功能源码如:文件服务、缓存服务 | | com.zmj.demo | 业务代码区 | | com.zmj.demo.config | 业务代码配置 | | com.zmj.demo.controller | 控制层 | | com.zmj.demo.mapper | 持久层 | | com.zmj.demo.pojo | 实体 | | com.zmj.demo.restclient | openfiegn服务层 | | com.zmj.demo.service | 业务逻辑层 | ## 基础依赖包及版本 | 项目 | 依赖包 | 版本 | | ------------- | ------------------------------ | ------------ | | JDK | JDK11 | JDK11 | | Spring boot | spring-boot-starter-parent | 2.6.3 | | web容器 | undertow | 2.2.16.Final | | 本地缓存 | guava | 31.1-jre | | 分布式缓存 | redis | 3.7.1 | | 缓存处理组件 | spring-boot-starter-cache | 2.6.3 | | 日志 | spring-boot-starter-log4j2 | 2.17.2 | | 熔断与限流 | resilience4j | 1.7.1 | | 消息中间件 | spring-boot-starter-amqp | 2.6.3 | | 数据库驱动 | mysql-connector-java | 8.0.28 | | 持久层 | Mybatis | 3.5.6 | | 持久层增强 | mybatis-plus | 3.5.1 | | 工具类 | hutool-all | 5.7.2 | | 数据库连接池 | HikariCP | 4.0.3 | | 服务间调用 | spring-cloud-starter-openfeign | 3.1.1 | | 健康检查 | spring-boot-starter-actuator | 2.6.5 | | swagger | knife4j-spring-boot-starter | 3.0.3 | | 分布式存储 | minio | 6.0.11 | | Excel导入导出 | easyexcel | 3.5.1 | | 监控 | micrometer-registry-prometheus | 1.8.4 | ## 系统错误码定义 | 状态码 | 描述 | | ---------- | ------------------------------------------------------------ | | 4** | **客户端错误**,接口地址错误、参数错误、令牌错误、无权限、 | | 42* | 认证服务相关,无应用、无用户、应用名或密码错误、用户名或密码错误、用户禁用、用户过期、用户锁定、第一次登录修改密码 | | 43* | 参数错误,非空校验、类型校验、长度校验等 | | 5** | **服务器错误**,系统代码错误如:NullPointException、OutOfBoundsException、ClassCaseException、ClassNotFoundException等。 | | 6** | **依赖中间件错误**,关系库错误、缓存库错误、MQ消息队列错误、其他中间件错误。 | | 7** | **依赖服务错误**,请求超时、远程认证失败、远程服务非成功响应。 | | 8** | **流控**,黑名单、限流、重复请求、 | | 9** | **业务异常**,重复数据、数据当前不可用、禁止操作等,如:物料编码已被使用。 | | 状态码 | 英文 | 描述 | 对应Exception | | ------ | ------------------------- | -------------------- | ------------------------ | | 400 | Bad Request | 错误的请求。 | BadRequestException | | 401 | Unauthorized | 身份认证失败。 | UnauthorizedException | | 403 | Forbidden | 无权限。 | ForbiddenException | | 404 | Not Found | 未找到对应的接口。 | NotFoundException | | 420 | Client Not Found | 应用未注册。 | NoneClientException | | 421 | Client Id Or Secret Error | 应用编码或秘钥错误。 | ClientErrorException | | 422 | Account Not Found | 无用户。 | NoneUserException | | 423 | Account bad credentials | 用户名或密码错误。 | BadCredentialsException | | 424 | Account Disabled | 用户禁用 | AccountDisabledException | | 425 | Account Expired | 用户过期 | AccountExpiredException | | 426 | Account Locked | 用户锁定 | AccountLockedException | | 427 | Account First Login | 第一次登录修改密码 | FirstLoginException | | 430 | Request Parameters Error | 请求参数校验错误 | BadParametersException | | 500 | Internal Server Error | 服务器内部错误 | ServerException | | 502 | Bad Gateway | 错误网关 | .. | | 503 | Service Unavailable | 服务不可用 | .. | | 504 | Gateway Time-out | 网关超时 | .. | | 600 | Middleware Error | 中间件异常 | MiddlewareException | | 610 | Sql Error | 数据库错误 | SqlException | | 620 | No Sql Error | 缓存库错误 | NoSqlException | | 630 | Mq Error | 消息队列错误 | MqException | | 690 | Other Middleware Error | 其他中间件异常 | OtherMiddlewareExcetpion | | 700 | Remote Error | 远程调用异常 | RemoteException | | 701 | Remote Time Out | 远程服务调用超时 | RemoteTimeOutException | | 702 | Remote Authority Error | 远程服务认证失败 | RemoteAuthorityException | | 703 | Remote Service Error | 远程服务异常响应码 | RemoteServiceException | | 800 | Limit Error | 限流 | LimitException | | 801 | The Hit List | 黑名单 | HitListException | | 802 | Limit | 限制访问 | UnavailableException | | 803 | Repeat | 重复请求 | RepeatRequestException | | 900 | Business Error | 业务异常 | BizException | | 901 | Repeat Data | 重复数据 | RepeatDataException | | 902 | Unavailable Data | 当前数据不可用 | UnavailableDataException | | 903 | Forbidden Data | 禁止操作数据 | ForbiddenDataException |