From e7ce4d0d0251a712ffa8f459ad095facd4dba0ce Mon Sep 17 00:00:00 2001 From: xezzon Date: Sun, 14 Jan 2024 21:52:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 33 +++++++++---------- README.md | 25 +++++++++++--- docker-compose.yml | 29 ++++++++++++++++ geom-service/README.md | 5 +++ .../java/io/github/xezzon/geom/auth/README.md | 0 .../java/io/github/xezzon/geom/dict/README.md | 0 .../io/github/xezzon/geom/group/README.md | 0 .../java/io/github/xezzon/geom/menu/README.md | 0 .../java/io/github/xezzon/geom/user/README.md | 0 geom-service/geom-service-openapi/README.md | 1 + 10 files changed, 72 insertions(+), 21 deletions(-) create mode 100644 docker-compose.yml create mode 100644 geom-service/README.md create mode 100644 geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/auth/README.md create mode 100644 geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/dict/README.md create mode 100644 geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/group/README.md create mode 100644 geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/menu/README.md create mode 100644 geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/user/README.md create mode 100644 geom-service/geom-service-openapi/README.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9a76bb0..115250d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,9 +8,9 @@ ``` geom -├── geom-app # 服务目录 -│ ├── geom-app-admin # 后台管理服务 -│ └── geom-app-openapi # 开放接口服务 +├── geom-service # 服务目录 +│ ├── geom-service-admin # 系统管理服务 +│ └── geom-service-openapi # 开放平台服务 ├── geom-common # 各服务共享的 bean ├── geom-core # 用于存放一些共享的内容(如全局常量、DTO) └── geom-sdk # 提供给系统内其他服务调用 geom 服务的客户端 @@ -20,9 +20,9 @@ geom ```mermaid flowchart LR - geom-app-admin-->geom-common - geom-app-openapi-->geom-common - geom-app-openapi-->geom-sdk + geom-service-admin-->geom-common + geom-service-openapi-->geom-common + geom-service-openapi-->geom-sdk geom-common-->geom-core geom-sdk--> geom-core ``` @@ -32,19 +32,20 @@ flowchart LR 一个服务可能会提供多种功能,所以我们将会像这样组织项目的包: ``` -geom-app-admin +geom-service-admin ├── src │ ├── main │ │ ├── java │ │ │ └── io/github/xezzon/geom -│ │ │ ├── auth # 认证功能 -│ │ │ │ ├── adaptor # 服务接口 -│ │ │ │ ├── domain # 充血模型 -│ │ │ │ │ └── convert # MapStruct 接口 -│ │ │ │ ├── repository # 基础 DAO 接口 -│ │ │ │ │ └── wrapper # 增强的 DAO 类 -│ │ │ │ └── service # 控制逻辑接口 -│ │ │ │ └── impl # 承担绝大部分业务逻辑 +│ │ │ ├── user # 用户功能 +│ │ │ │ ├── UserService.java # 该功能的逻辑运转中枢 +│ │ │ │ ├── UserController.java # 提供前端调用的 HTTP 接口 +│ │ │ │ ├── UserRpcAdaptor.java # 提供其他服务调用的 RPC 接口 +│ │ │ │ ├── domain # 模型 +│ │ │ │ ├── convert # MapStruct 接口 +│ │ │ │ ├── repository # DAO 接口 +│ │ │ │ ├── service # 向其他包提供的功能的接口定义 +│ │ │ │ └── README.md # 该功能的细节说明 │ │ │ ├── dict # 字典功能 │ │ │ └── AdminApplication.java # 启动类 │ │ └── resources @@ -56,8 +57,6 @@ geom-app-admin └── generated-sources # 由 Maven 插件生成的代码,是成品的一部分,请不要试图改动 ``` -其余部分与之类似,会先按功能分包,再按层级分包。 - ## 如何运行与测试 `TODO` diff --git a/README.md b/README.md index fa2aac5..38ad5e3 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,33 @@ # geom -一组可独立部署、提供 SDK 的微服务。 +一组面向云原生开发的基础设施服务。帮助开发者专注于业务代码的开发。 ## 功能特性 -`TODO` +geom 后端提供 2 个服务与 1 个 SDK。 + +- admin 系统管理服务 + - 认证 + - 菜单权限 + - 数据权限 + - SSO + - 字典 +- openapi 开发平台服务 + - 发布接口 + - 订阅接口 + - WEBHOOK + - 消息解密/验证 +- sdk ## 如何使用 -![部署架构](doc/assets/部署架构.png) +最简单的方式是通过 [docker-compose](./docker-compose.yml) 启动。 -`TODO` +```shell +#!/bin/bash +# 只需要运行需要的服务 +docker-compose up -d geom-service-admin geom-service-openapi +``` ## 技术栈 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7d9a0d3 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,29 @@ +version: '3' +services: + geom-service-admin: + image: ghcr.io/xezzon/geom-service-admin + container_name: geom-service-admin + environment: + - GEOM_JWT_ISSUER=xezzon.github.io + - OTEL_SDK_DISABLED=false # 启用 OpenTelemetry + - OTEL_EXPORTER_OTLP_ENDPOINT=http://otel:4317 + restart: unless-stopped + geom-service-openapi: + image: ghcr.io/xezzon/geom-service-openapi + container_name: geom-service-openapi + environment: + - GEOM_JWT_ISSUER=xezzon.github.io + - OTEL_SDK_DISABLED=false + - OTEL_EXPORTER_OTLP_ENDPOINT=http://otel:4317 + restart: unless-stopped + myapp: # 开发者自己的业务代码 打包为 Docker 镜像 + image: myapp + container_name: myapp + +networks: + default: + driver: bridge + gateway_default: # 与网关处于同一网络下 + external: true + telemetry_collector: # 与 OpenTelemetry Collector 处于同一网络下,可以通过其容器名作为域名进行访问 + external: true diff --git a/geom-service/README.md b/geom-service/README.md new file mode 100644 index 0000000..a443762 --- /dev/null +++ b/geom-service/README.md @@ -0,0 +1,5 @@ +# 应用服务 + +## jib-maven-plugin + +## OpenTelemetry diff --git a/geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/auth/README.md b/geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/auth/README.md new file mode 100644 index 0000000..e69de29 diff --git a/geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/dict/README.md b/geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/dict/README.md new file mode 100644 index 0000000..e69de29 diff --git a/geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/group/README.md b/geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/group/README.md new file mode 100644 index 0000000..e69de29 diff --git a/geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/menu/README.md b/geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/menu/README.md new file mode 100644 index 0000000..e69de29 diff --git a/geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/user/README.md b/geom-service/geom-service-admin/src/main/java/io/github/xezzon/geom/user/README.md new file mode 100644 index 0000000..e69de29 diff --git a/geom-service/geom-service-openapi/README.md b/geom-service/geom-service-openapi/README.md new file mode 100644 index 0000000..1a9b683 --- /dev/null +++ b/geom-service/geom-service-openapi/README.md @@ -0,0 +1 @@ +# 开放平台服务