Go to file
zwt13703 b3bd04aa59 init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
.claude init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
.github init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
contract@96fc06b1fe chore: 引入 contract submodule 2026-07-05 17:30:18 +08:00
db init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
deploy init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
test-base-core init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
test-module-business init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
test-module-system init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
test-server-cloud init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
.claudeignore init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
.cursorrules init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
.dockerignore init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
.editorconfig init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
.gitignore init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
.gitmodules chore: 引入 contract submodule 2026-07-05 17:30:18 +08:00
.windsurfrules init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
AGENTS.md init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
CLAUDE.md init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
Dockerfile init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
LICENSE init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
README.md init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
docker-compose.yml init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
pom.xml init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
pom.xml.bak init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00
开发规范-人工版.md init: test-backend 初始化,基于 ghb-base [AI: Claude Code] 2026-07-05 17:30:23 +08:00

README.md

ghb-base 后端jeecg-boot

这是 ghb-base 基础框架的后端。以后每个新系统都基于本框架开发——业务代码只写在 ghb-module-business框架层core/system不改。 基于 JeecgBoot 3.9.2 精简。

技术栈

  • Spring Boot 3.5.5 / Java 17
  • MyBatis-Plus / Shiro + JWT / MySQL 8 / Redis 6
  • 包名 com.ghb.base 数据库 ghb_base 上下文路径 /ghb

环境要求

  • JDK 17+、Maven 3.8+、MySQL 8.0+、Redis 6.0+

第一次启动

  1. 建库 ghb_base,导入初始化脚本:../ghb_base_init.sql(在 base 根目录)
  2. 改连接:ghb-module-system/ghb-system-start/src/main/resources/application-dev.ymlMySQL、Redis 地址)
  3. 启动:
    cd ghb-module-system/ghb-system-start
    mvn spring-boot:run -Pdev
    
    主类 com.ghb.base.GhbSystemApplication,端口 8080,访问前缀 /ghb(如 http://localhost:8080/ghb)。

模块结构(哪能改哪不能改)

jeecg-boot/
├── ghb-base-core/        核心框架      ← 不改
├── ghb-module-system/    租户/用户/角色/菜单/字典/日志 ← 不改
│   └── ghb-system-start/ 启动模块(含 application*.yml
├── ghb-module-business/  业务代码      ← 写这里
└── ghb-server-cloud/     微服务(网关/Nacos/监控)

新人必读(开始写代码前全部读完)

  1. CLAUDE.md(本目录)/ base 根 ../CLAUDE.md — AI 开发总纲
  2. ../.claude/ 下全部规则:contract.md(契约/返回格式/同步铁律)、backend.md(分层/命名/CRUD 模板/检查表)、database.mdgit.mdsecurity.mdtesting.md
  3. ../contract/ — 接口契约(独立 git submodule改接口前必须先更新契约。

铁律速记(详见 .claude/

  • 返回一律 Result 包装,禁止裸 return data;
  • Controller 只做参数校验 + 调 Service + 返回,方法体别超 20 行、别写 if/else 业务
  • 手写 @Select SQL 必须带 tenant_id 条件(多租户,否则数据泄露)
  • 新增表必须有 create_time/update_time/del_flag/COMMENT,金额字段用 DECIMAL
  • commit 要带 [AI: xxx] 标注;改 entity/controller 后重新打包重启