{"id":20754667,"url":"https://github.com/liaochong/spring-boot-convention","last_synced_at":"2025-07-05T23:07:53.505Z","repository":{"id":37169942,"uuid":"174547187","full_name":"liaochong/spring-boot-convention","owner":"liaochong","description":"spring boot 代码规约，从代码层面上统一规范！","archived":false,"fork":false,"pushed_at":"2022-06-17T02:07:17.000Z","size":118,"stargazers_count":9,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-04T22:46:59.109Z","etag":null,"topics":["hibernate-validator","java","springboot2"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liaochong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-08T14:00:21.000Z","updated_at":"2023-09-20T11:41:23.000Z","dependencies_parsed_at":"2022-08-28T10:20:40.407Z","dependency_job_id":null,"html_url":"https://github.com/liaochong/spring-boot-convention","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/liaochong/spring-boot-convention","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liaochong%2Fspring-boot-convention","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liaochong%2Fspring-boot-convention/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liaochong%2Fspring-boot-convention/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liaochong%2Fspring-boot-convention/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liaochong","download_url":"https://codeload.github.com/liaochong/spring-boot-convention/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liaochong%2Fspring-boot-convention/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263819194,"owners_count":23516121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hibernate-validator","java","springboot2"],"created_at":"2024-11-17T09:18:30.353Z","updated_at":"2025-07-05T23:07:53.479Z","avatar_url":"https://github.com/liaochong.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 简介 | Brief introduction\nspring-boot-convention是作者在多家公司获得的最佳实践合集，针对多项目的痛点，如不统一的输入、输出，大范围式的try/catch，hibernate validator校验力度范围不够、RPC share包pom内容重复定义严重等进行了底层处理，其能够达到的效果如下：\n1. 极大降低代码量，通过统一异常设定以及统一异常拦截处理，使用异常流进行业务逻辑开发，业务流不需要关心返回值，也无需try/catch；\n2. 降低RPC share包中pom内容的重复定义，如lombok依赖、上传仓库设定等；\n3. 统一输入输出格式，已定义分页输入、分页输出、最终结果容器等，使用统一输入输出组件，对项目的后期维护均有极大益处；\n4. 扩大hibernate validator参数校验范围，解除只能在controller中校验并且需要手动处理校验不通过数据的限制；\n\n## 模块介绍 | Module introduce\n* my-convention（规约父pom，定义下属模块通用配置，如build）\n  - my-convention-api（api模块，只包含Paging、Result、PagingResult等输入输出基础类，独立出来方便集成到RPC依赖包中）\n  - my-convention-common（common模块，包含规约异常定义，api模块通用的工具类，系统编码的定义）\n  - my-convention-share-parent（share-parent模块，pom文件，定义RPC依赖包必须的依赖，如Hibernate validator、api模块、lombok等）\n* my-spring-boot\n  - my-spring-boot-parent\n  - my-spring-boot-starters\n    - my-spring-boot-starter-convention\n* my-example\n\n## 依赖关系 | Dependency relationship\n* my-example\n  - my-spring-boot-starter-parent\n  - my-spring-boot-starter-convention\n    - my-convention-common\n      - my-convention-api\n      \n## 注意事项 | Attention\n1. 所有依赖包均为上传到maven中央仓库，如需调试，需要本地install；\n  - install my-convention;\n  - install my-spring-boot-starter-parent;\n  - install my-spring-boot-starters;\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliaochong%2Fspring-boot-convention","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliaochong%2Fspring-boot-convention","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliaochong%2Fspring-boot-convention/lists"}