diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 000000000..660be1acc
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,6 @@
+**/.git
+**/.vs
+**/bin
+**/obj
+**/node_modules
+*.user
\ No newline at end of file
diff --git a/README.en.md b/README.en.md
index fb79ea7d0..2f9634d40 100644
--- a/README.en.md
+++ b/README.en.md
@@ -8,7 +8,7 @@ This is a [vue-vben-admin](https://github.com/anncwb/vue-vben-admin) -based Abp
## Build
-[](https://github.com/colinin/abp-next-admin/actions/workflows/build.yml)
+[](https://github.com/colinin/abp-next-admin/actions/workflows/build.yml) [](https://www.nuget.org/packages/LINGYUN.Abp.Core)
## Deployment Options
@@ -23,43 +23,44 @@ If you don't need a microservices architecture, you can choose the monolithic se
If you need higher scalability and a more flexible service architecture, you can choose the microservices deployment option.
-## Quick Start
+## Quick Start of a Microservice Project
-### 0、Configurate hosts
-windows: modify C:\Windows\System32\drivers\etc\hosts ;
-linux: modify /etc/hosts;
-add config:
+### 0. Configure the hosts file
+
+On Windows, modify C:\Windows\System32\drivers\etc\hosts ;
+on Linux, modify /etc/hosts ;
+add the following entry:
```
127.0.0.1 host.docker.internal
```
-In linux, execute restart network command:
+On Linux, restart the network after changing the hosts file:
```shell
/etc/init.d/network restart
```
-### 1、Install cli
+### 1. Install the dotnet tool
```shell
dotnet tool install --global LINGYUN.Abp.Cli
```
-### 2、Install .NET Template
+### 2. Install the .NET template
```shell
dotnet new --install LINGYUN.Abp.MicroService.Templates
```
-### 3、Use cli create new project
+### 3. Create a project with the CLI
```shell
- # use sqlserver
- # MyCompanyName you company name
- # MyProjectName you project name
- # MyPackageName you package name
- # -o See: abp cli
- # --dbms See: abp cli
- # --cs See: abp cli
- # --no-random-port See: abp cli
+ # Initialize a project with a sqlserver connection string
+ # MyCompanyName company name
+ # MyProjectName project name
+ # MyPackageName package name
+ # -o output to the specified directory, see abp cli
+ # --dbms specify the database provider, see abp cli
+ # --cs specify the database connection string, see abp cli
+ # --no-random-port do not use random ports (app port 5000, dapr listening port 3500 by default)
labp create MyCompanyName.MyProjectName -pk MyPackageName -o "D:\Project" --dbms sqlserver --cs "Server=127.0.0.1;Database=MyProject;User Id=sa;Password=123456" --no-random-port
cd D:\Project\host\MyPackageName.MyCompanyName.MyProjectName.HttpApi.Host
@@ -74,7 +75,7 @@ In linux, execute restart network command:
### Feedback
-* The author is not a freelancer and does not have much time to maintain the project. If there is a problem, please contact **colin.in@foxmail.com** by email
+* The author is not a freelancer and does not have much time to maintain the project. If you have any problems, you can contact **colin.in@foxmail.com** by email
## Screenshots
@@ -92,7 +93,7 @@ In linux, execute restart network command:

-
+

@@ -100,13 +101,15 @@ In linux, execute restart network command:
## Related Projects
+Backend projects
+
[abpframework/abp](https://github.com/abpframework/abp) (abp vNext)
[EasyAbp/Cap](https://github.com/EasyAbp/Abp.EventBus.CAP) (EasyAbp)
[DotNetCore/CAP](https://github.com/dotnetcore/CAP) (CAP)
-Javascript version:
+Frontend projects
[vue-vben-admin](https://github.com/anncwb/vue-vben-admin.git) (vue-vben-admin)
@@ -123,163 +126,312 @@ Javascript version:
## Project Structure
-```bash
-├── mock/ # mock server & mock data
-├── public # public static assets (directly copied)
-│ │── favicon.ico # favicon
-│ │── manifest.json # PWA config file
-│ └── index.html # index.html template
-├── src # main source code
-│ ├── api # api service
-│ ├── assets # module assets like fonts, images (processed by webpack)
-│ ├── components # global components
-│ ├── directives # global directives
-│ ├── enums # global enums
-│ ├── hooks # global hooks
-│ ├── locales # locales
-│ ├── layout # layouts
-│ ├── router # router
-│ ├── settings # global settings
-│ ├── store # store
-│ ├── utils # global utils
-│ ├── views # views
-│ ├── App.vue # main app component
-│ ├── main.ts # app entry file
-├── types # types
-├── tests/ # tests
-├── .env.xxx # env variable configuration
-├── .eslintrc.js # eslint config
-├── jest.config.js # jest unit test config
-├── package.json # package.json
-├── postcss.config.js # postcss config
-├── tsconfig.json # typescript config
-└── vite.config.js # vue vite config
-```
-
-## Project setup
-
-With [yarn](https://yarnpkg.com/lang/en/) or [npm](https://www.npmjs.com/get-npm)
-
-
-#### Install dependencies
+### Frontend: apps/vben5 (a pnpm workspace + turbo monorepo)
```bash
-yarn install
-
+apps/vben5/
+├── apps/ # Independently runnable UI applications
+│ ├── app-antd/ # ABP business frontend (the one in use: pnpm dev:app / pnpm build:app)
+│ ├── web-antd/ # Official vben antd demo application
+│ ├── web-antdv-next/ # antdv-next demo application
+│ ├── web-ele/ # Element Plus demo application
+│ ├── web-naive/ # Naive UI demo application
+│ └── web-tdesign/ # TDesign demo application
+├── packages/
+│ ├── @abp/ # ABP business module packages (27 in total)
+│ │ ├── account/ # Account, external logins (third-party account binding)
+│ │ ├── ai-management/ # AI management (workspaces, tools, agents)
+│ │ ├── auditing/ # Audit logs and security logs
+│ │ ├── blob-management/ # Object storage (containers, files)
+│ │ ├── cache-management/ # Cache management
+│ │ ├── components/ # Shared ABP business components
+│ │ ├── core/ # ABP frontend core (request, permissions, menus, etc.)
+│ │ ├── data-protection/ # Data protection (entity/field level access control)
+│ │ ├── demo/ # Demo module
+│ │ ├── features/ # Feature management
+│ │ ├── gdpr/ # GDPR data export and deletion
+│ │ ├── identity/ # Users, roles, organization units, sessions, login logs
+│ │ ├── localization/ # Localization (languages, resources, texts)
+│ │ ├── notifications/ # Notifications (definitions, my notifications, send records)
+│ │ ├── openiddict/ # OpenIddict (applications, scopes, authorizations, tokens)
+│ │ ├── oss/ # OSS/Blob file list
+│ │ ├── permissions/ # Permission definitions and grants
+│ │ ├── platform/ # Platform (layouts, menus, data dictionaries, email/SMS)
+│ │ ├── request/ # HTTP request wrapper (token, error handling, tenant header)
+│ │ ├── saas/ # Tenants and editions
+│ │ ├── settings/ # Setting definitions and values
+│ │ ├── signalr/ # SignalR real-time communication
+│ │ ├── tasks/ # Background tasks (job management)
+│ │ ├── text-templating/ # Text templates
+│ │ ├── ui/ # ABP frontend UI component library
+│ │ ├── webhooks/ # Webhook definitions, subscriptions and send attempts
+│ │ └── wechat/ # WeChat (official account, WeCom, etc.)
+│ ├── @core/ # Core: base / ui-kit / forward
+│ ├── effects/ # Shared capabilities: plugins / hooks / common-ui, etc.
+│ ├── icons/ types/ # Icons and type definitions
+│ └── ... # The remaining shared packages (see pnpm-workspace.yaml)
+├── internal/ # Engineering configuration: vite-config / lint-configs / tailwind-config / tsconfig / node-utils
+├── docs/ # VitePress documentation
+├── playground/ # Component and example playground
+├── scripts/ # Cleanup, build and deployment scripts
+├── package.json # Root scripts: dev / dev:app / build:app / lint / format / test:unit / check:type
+├── pnpm-workspace.yaml # Workspace layout and dependency catalog
+├── turbo.json # turbo pipeline configuration
+└── vitest.config.ts # Unit test (vitest) configuration
```
-### Custom vue project config
-
-Modify the server address that the development environment will use for the proxy. Provide the following three addresses: IdentityService, IdentityServer, and ApiService
+### Backend: aspnet-core and the surrounding directories
```bash
-VITE_PROXY = [["/connect","http://127.0.0.1:44385"],["/api","http://127.0.0.1:30000"],["/signalr-hubs","ws://127.0.0.1:30000"]]
+.
+├── aspnet-core/
+│ ├── services/ # Service hosts (each with its own Dockerfile)
+│ │ ├── LINGYUN.Abp.MicroService.AuthServer/ # Auth server (STS, 44385)
+│ │ ├── LINGYUN.Abp.MicroService.IdentityService/ # Identity service (30015)
+│ │ ├── LINGYUN.Abp.MicroService.AdminService/ # Admin service (30010)
+│ │ ├── LINGYUN.Abp.MicroService.LocalizationService/# Localization service (30030)
+│ │ ├── LINGYUN.Abp.MicroService.PlatformService/ # Platform service (30025)
+│ │ ├── LINGYUN.Abp.MicroService.MessageService/ # Message service (30020)
+│ │ ├── LINGYUN.Abp.MicroService.TaskService/ # Task service (30040)
+│ │ ├── LINGYUN.Abp.MicroService.WebhookService/ # Webhook service (30045)
+│ │ ├── LINGYUN.Abp.MicroService.WorkflowService/ # Workflow service (30050)
+│ │ ├── LINGYUN.Abp.MicroService.WeChatService/ # WeChat service (30060)
+│ │ ├── LINGYUN.Abp.MicroService.AIService/ # AI service (30070)
+│ │ ├── LY.MicroService.Applications.Single/ # Monolith (30000, gateway and all modules merged)
+│ │ ├── LY.MicroService.IdentityServer/ # IdentityServer based services and hosts
+│ │ ├── LINGYUN.Abp.Applications/ LY.AIO.Applications.Single/ # Other hosts
+│ │ └── Publish/ # Publish output directory (used by the container image builds)
+│ ├── modules/ # Business modules, each layered by DDD (Domain / Application / EntityFrameworkCore / HttpApi ...)
+│ │ ├── account/ # Account and sign-in (OpenIddict/IdentityServer web integration, captcha)
+│ │ ├── identity/ # Users, roles, organization units, sessions, login logs
+│ │ ├── identityServer/ # IdentityServer4 based implementation
+│ │ ├── openIddict/ # OpenIddict server (applications, scopes, tokens, Portal, QR code, SMS, WeChat)
+│ │ ├── permissions-management/ # Permission management and grants
+│ │ ├── saas/ # Multi-tenancy and editions
+│ │ ├── settings/ feature-management/ # Settings and features
+│ │ ├── localization-management/ text-templating/ # Localization and text templates
+│ │ ├── auditing/ data-protection/ gdpr/ captcha/ # Auditing, data protection, GDPR, captcha
+│ │ ├── blob-management/ caching-management/ # Object storage and cache management
+│ │ ├── platform/ project/ system-info/ demo/ # Platform, project, system info, demo
+│ │ ├── realtime-message/ realtime-notifications/ # Instant messaging and real-time notifications
+│ │ ├── task-management/ rules-management/ webhooks/ # Background tasks, rules engine, webhooks
+│ │ ├── ai/ elsa/ # AI capabilities and workflow (Elsa)
+│ ├── framework/ # Base framework packages (33 groups), the most used ones:
+│ │ ├── common/ core packages (LINGYUN.Abp.Core, CAP, Hangfire, BlobStoring, SignalR ...)
+│ │ ├── security/ authentication/ authorization/ # Security, sign-in methods, authorization
+│ │ ├── auditing/ logging/ telemetry/ # Auditing, logging, tracing (OpenTelemetry/SkyWalking)
+│ │ ├── multi-tenancy: tenants/ # Multi-tenancy and editions
+│ │ ├── wechat/ wx-pusher/ pushplus/ tui-juhe/ # WeChat and message push
+│ │ ├── cloud-aliyun/ cloud-tencent/ # Aliyun and Tencent Cloud integration
+│ │ ├── dapr/ elasticsearch/ efcore/ data-protection/ # Dapr, Elasticsearch, EF Core, data protection
+│ │ ├── dynamic-queryable/ dynamic-definition/ exporter/ # Dynamic query, dynamic definitions, import/export
+│ │ ├── localization/ settings/ features/ mvc/ open-api/ cli/ ... # Other base packages
+│ ├── migrations/ # DbMigrator and EntityFrameworkCore migration projects of each service (run by deploy.ps1)
+│ ├── aspire/ # .NET Aspire: LINGYUN.Abp.MicroService.AppHost and the Aspire hosts of each service
+│ ├── templates/ # dotnet new project templates (micro / aio)
+│ ├── tests/ # Unit test projects
+│ ├── LINGYUN.MicroService.All.slnx # Full solution
+│ ├── LINGYUN.MicroService.Aspire.slnx # Aspire solution
+│ └── LINGYUN.MicroService.SingleProject.slnx # Monolith solution
+├── gateways/
+│ ├── internal/ # Internal gateway (YARP): Internal.Gateway / OpenApi.Gateway + yarp*.json routes
+│ └── web/ # Web gateway: LY.MicroService.ApiGateway
+├── apps/ # Frontend: vben5 (current) / vue (legacy)
+├── build/ # Build and migration scripts: build-aspnetcore-ef-update.ps1, build-aspnetcore-docker-build.ps1 ...
+├── deploy/ # One-click deployment script (deploy.ps1), middleware data and service log directories
+├── docs/ # Documentation (monolith startup guide, etc.)
+├── docker-compose.yml # Backend service orchestration
+├── docker-compose.override.yml # Image tags, volumes and startup order
+├── docker-compose.override.configuration.yml # Environment variables of each service (connection strings, CAP, Redis, Elasticsearch, ...)
+├── docker-compose.middleware.yml # Middleware: MySQL/Redis/RabbitMQ/Elasticsearch/Kibana/Logstash/OpenObserve
+├── docker-compose.override.agile.yml # AgileConfig configuration center (optional)
+├── Directory.Build.props Directory.Packages.props NuGet.Config common.props # Shared build and package version management
+└── README.md README.en.md RELEASE.md LICENSE # Documentation and license
```
-Modify the actual address of the production environment, as above
+## Starting the Project
-```bash
-# STS Connect
-# token issue
-VITE_GLOB_AUTHORITY='http://127.0.0.1:44385'
-# client id
-VITE_GLOB_CLIENT_ID='vue-admin-element'
-# client secret
-VITE_GLOB_CLIENT_SECRET='1q2w3e*'
-```
+Three startup options are provided; choose the one that fits your needs:
-### EntityFramework migration
+| Option | Description | Middleware | Frontend |
+| --- | --- | --- | --- |
+| Option 1: Microservices | Full microservices architecture, all backends run as containers | Must **start first**: `docker-compose.middleware.yml` | Start vben5 separately |
+| Option 2: Aspire | AppHost orchestrates a local microservices development environment | AppHost creates the containers automatically (PostgreSQL/Redis/RabbitMQ/Elasticsearch/Kibana) | Started automatically by AppHost |
+| Option 3: Monolith | Gateway, authentication and business modules merged into a single process | Must **start first**: `docker-compose.middleware.yml` | Start vben5 separately |
-Please switch to the service project startup directory and execute the **dotnet EF ** command for database migration
+### Prerequisites
-example:
+- **.NET SDK 10** (`dotnet --version`)
+- **Docker / Docker Compose** (middleware for options 1 and 3; option 2 also relies on Docker for its middleware containers)
+- **Node.js 20+ and pnpm** (the frontend lives in `apps/vben5`, a pnpm monorepo; `preinstall` runs `only-allow pnpm`)
+- **hosts**: on Windows edit `C:\Windows\System32\drivers\etc\hosts`, on Linux edit `/etc/hosts`, and add the following entry
+ ```
+ 127.0.0.1 host.docker.internal
+ ```
+ (containers reach the middleware on the host through `extra_hosts: host.docker.internal:host-gateway`)
-``` shell
+---
-cd aspnet-core/services/admin/LINGYUN.BackendAdminApp.Host
+### Option 1: Microservices
-dotnet ef database update
+#### 1) One-click startup: deploy/deploy.ps1
+```powershell
+cd ./deploy
+powershell -ExecutionPolicy Bypass -File .\deploy.ps1
```
-- You can also use quick migration script files: **./build/build-aspnetcore-ef-update.ps1**
+The script performs the following steps (see `deploy/deploy.ps1`):
-### Configure the RabbitMQ
+1. Starts the middleware: `docker-compose -f .\docker-compose.middleware.yml -p labp up -d --build` (MySQL, Redis, RabbitMQ, Elasticsearch, Kibana, Logstash, OpenObserve)
+2. Waits 30 seconds for MySQL initialization to complete
+3. Runs the 8 database migration projects one by one (`dotnet run --no-build`, **so the backend must have been built before running the script**)
+4. Builds the 12 backend images (`labp-*-service:10.6.0`)
+5. Starts the backend: `docker-compose -f .\docker-compose.yml -f .\docker-compose.override.yml -f .\docker-compose.override.configuration.yml -p labp up -d`
+6. Runs `pnpm dev:app` under `apps/vben5` to start the frontend
-Therefore project design for the micro service architecture, with the method of distributed event, communication between project USES is [DotNetCore/CAP](https://github.com/dotnetcore/CAP)
+Notes:
-The communication mode is **RabbitMQ Server**, so you need to install **RabbitMQ** in advance. Please refer to the official website for the specific installation mode
+- The script must be executed in the **deploy directory** (it uses relative paths internally).
+- The script calls `docker-compose` (Compose V1 command); if only the Compose V2 plugin is installed on your machine, replace `docker-compose` with `docker compose` in the script.
+- The script does not include AgileConfig (`docker-compose.override.agile.yml`); all configuration comes from `docker-compose.override.configuration.yml`.
+#### 2) Manual startup (equivalent to the script; make sure the middleware is started first)
+```powershell
+# 1) Start the middleware (must be first)
+docker-compose -f .\docker-compose.middleware.yml -p labp up -d
+# On the first run, wait at least 30 seconds so that MySQL can execute the init scripts under deploy/mysql/docker-entrypoint-initdb.d
-Then you need to change the **CAP:RabbitMQ** configuration in the configuration file to set it to your own defined configuration. The **rabbitmq_management** plug-in is recommended for quick management of **RabbitMQ**
+# 2) Database migration: use the migration script (it runs dotnet run for each of the 8 *.DbMigrator projects under aspnet-core/migrations, and builds automatically)
+cd .\build
+.\build-aspnetcore-ef-update.ps1
+# 3) Build the backend images: produces the 12 labp-*-service:10.6.0 images (the tags must match the image values in docker-compose.override.yml)
+.\build-aspnetcore-docker-build.ps1
-### Compiles background services
+# 4) Start the backend (all three compose files are required)
+docker-compose -f .\docker-compose.yml -f .\docker-compose.override.yml -f .\docker-compose.override.configuration.yml -p labp up -d
-```shell
-cd aspnet-core/services
+# 5) Start the frontend
+cd .\apps\vben5
+pnpm install
+pnpm dev:app
+```
+
+Notes on the manual steps:
-start-all-service.bat
+- Both scripts in steps 2 and 3 must be executed in the **build directory** (they reference `./build-aspnetcore-common.ps1` relatively).
+- `build-aspnetcore-ef-update.ps1` uses `dotnet run` internally (it builds first, then runs), so the manual flow does **not** require a pre-built backend; the one-click `deploy.ps1` uses `dotnet run --no-build`, so the backend must be built before running it.
+- To migrate only a single service, run it from its own directory, for example:
+ ```powershell
+ cd .\aspnet-core\migrations\LINGYUN.Abp.MicroService.AuthServer.DbMigrator
+ dotnet run
+ ```
+
+#### 3) Endpoints
+
+| Component | Address |
+| --- | --- |
+| Frontend (vben5, `@abp/app-antd`) | http://localhost:5666 |
+| API Gateway | http://localhost:30000 |
+| Auth Server (STS) | http://localhost:44385 |
+| Identity / Admin / Platform / Message / Localization | 30015 / 30010 / 30025 / 30020 / 30030 |
+| Task / Webhook / Workflow / WeChat / AI | 30040 / 30045 / 30050 / 30060 / 30070 |
+| Kibana | http://localhost:5601 |
+| RabbitMQ management | http://localhost:15672 (admin / 123456) |
+| MySQL | localhost:3306 (root / 123456, database `abp`) |
+| Redis | localhost:6379 |
+| OpenObserve console | http://localhost:5080 (admin@abp.io / ww1Z5L%6) |
+
+### Option 2: Aspire
+
+The AppHost brings up its own middleware containers (PostgreSQL, Redis, RabbitMQ, Elasticsearch, Kibana), automatically runs the database migration projects of each service in the Development environment, and automatically starts the vben5 frontend with `pnpm dev:app`, so there is **no need** to start `docker-compose.middleware.yml` as well.
+
+```powershell
+cd ./aspnet-core/aspire/LINGYUN.Abp.MicroService.AppHost
+aspire run
```
-#### Compiles and hot-reloads for development
+- The Aspire CLI must be installed (the version must match the AppHost's `Aspire.AppHost.Sdk` 13.x): `dotnet tool install --global Aspire.Cli`; if you prefer not to install the CLI, you can simply run `dotnet run --project .\LINGYUN.Abp.MicroService.AppHost.csproj`.
+- Docker must be running, and `apps/vben5` must already have run `pnpm install` (the AppHost runs `pnpm dev:app`, and the frontend port is fixed at 5666).
+- After startup the terminal prints the Aspire Dashboard address, where you can inspect resource status, logs and traces.
+- The host ports used by the AppHost fully overlap with the middleware of option 1 (6379/9200/5601/5672/15672/5432, etc.) — **do not run it at the same time as the option 1 middleware**.
-```shell
+### Option 3: Monolith
-cd apps/vue
+The monolith merges the gateway, authentication and all business modules into a single process, but it **still depends on the middleware, so the middleware must be started first**:
-yarn dev
+```powershell
+# 1) Start the middleware
+docker-compose -f .\docker-compose.middleware.yml -p labp up -d
+# On the first run, wait at least 30 seconds
+# 2) Start the monolith
+cd .\aspnet-core\services\LY.MicroService.Applications.Single
+dotnet run --launch-profile Single.MySql.Dev
+
+# 3) Start the frontend
+cd .\apps\vben5
+pnpm install
+pnpm dev:app
```
-#### Compiles and minifies for production
+- Default address **http://localhost:30000**: both `App:SelfUrl` and `AuthServer:Authority` point to it, so the token endpoint and the API share the same port.
+- **Specify the profile explicitly**: without `--launch-profile`, `dotnet run` uses the first profile in `launchSettings.json` (currently `Single.PostgreSql.Dev`). With the default database (MySQL) use `Single.MySql.Dev`; the other options are `Single.PostgreSql.Dev` and `Single.SqlServer.Dev`.
+- The connection strings of each database can be found in `appsettings.Development.MySql.json` / `appsettings.Development.PostgreSql.json` / `appsettings.Development.SqlServer.json`.
-```bash
-yarn run build
-```
+### Troubleshooting
-### About Docker container
+- **`docker-compose` command not found**: the scripts use the Compose V1 command; if only Compose V2 is installed, use `docker compose` instead.
+- **Image `labp-*-service:10.6.0` not found**: `docker-compose.override.yml` references pre-built images through `image:`, so run `build/build-aspnetcore-docker-build.ps1` first (option 1, manual startup, step 3).
+- **One-click migration fails (`dotnet run --no-build`)**: `deploy.ps1` uses `--no-build` internally, so the backend must be built before running the script (`dotnet build .\aspnet-core\LINGYUN.MicroService.All.slnx`); for manual migration use **build/build-aspnetcore-ef-update.ps1** instead (it uses `dotnet run` and builds automatically).
+- **Frontend dependency installation fails**: `apps/vben5` enforces pnpm (`preinstall` runs `only-allow pnpm`), so use `pnpm install` / `pnpm dev:app`.
+- **Containers cannot reach the middleware on the host**: make sure the hosts file contains `127.0.0.1 host.docker.internal`.
-**Step 1**: Building background services, powershell script: **./build/build-aspnetcore-release.ps1**, **Warning: after the release of service need configuration file: appsettings.Production.json**
+---
-**Step 2**: Build the front-end, **./build/build-vue-apps.ps1**
+### Lints and fixes files
-**Step 3**: Build after the release of the address of the default in **./aspnet-core/services/Publish**, change nginx proxy server address: **./client/docker/nginx/default.conf**
+Run the following in `apps/vben5` (vben5 enforces pnpm):
-**Step 4**: Run command **sudo docker-compose down && sudo docker-compose -f docker-compose.yml -f docker-compose.override.yml up --build -d**
+```bash
+cd apps/vben5
-**Using A CI tool such as Jenkins is recommended to simplify this into a single step**
+# lint
+pnpm lint
-#### Lints and fixes files
+# auto-fix
+pnpm format
-```bash
-yarn lint:eslint
+# type check
+pnpm check:type
```
-#### Run your unit tests
+### Run your unit tests
```bash
-yarn run test:unit
-```
+cd apps/vben5
+pnpm test:unit
+```
## How to contribute
-You are very welcome to join!Raise an issue Or submit a Pull Request。
+You are very welcome to join! Raise an issue or submit a Pull Request.
**Pull Request:**
-1. Fork code!
+1. Fork the code!
2. Create your own branch: `git checkout -b feat/xxxx`
3. Submit your changes: `git commit -am 'feat(function): add xxxxx'`
4. Push your branch: `git push origin feat/xxxx`
-5. submit`pull request`
+5. Submit a `pull request`
## Git Contribution submission specification
-- reference [vue](./apps/vue/.github/COMMIT_CONVENTION.md) specification ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular))
+- Reference the [vue](./apps/vue/.github/COMMIT_CONVENTION.md) specification ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular))
- `feat` Add new features
- `fix` Fix the problem/BUG
@@ -295,18 +447,6 @@ You are very welcome to join!Raise an issue Or submit a Pull Request。
- `types` Type definition file changes
- `wip` In development
-## Related warehouse
-
-If these plugins are helpful to you, you can give a star support
-
-- [vite-plugin-mock](https://github.com/anncwb/vite-plugin-mock) - Used for local and development environment data mock
-- [vite-plugin-html](https://github.com/anncwb/vite-plugin-html) - Used for html template conversion and compression
-- [vite-plugin-style-import](https://github.com/anncwb/vite-plugin-style-import) - Used for component library style introduction on demand
-- [vite-plugin-theme](https://github.com/anncwb/vite-plugin-theme) - Used for online switching of theme colors and other color-related configurations
-- [vite-plugin-imagemin](https://github.com/anncwb/vite-plugin-imagemin) - Used to pack compressed image resources
-- [vite-plugin-compression](https://github.com/anncwb/vite-plugin-compression) - Used to pack input .gz|.brotil files
-- [vite-plugin-svg-icons](https://github.com/anncwb/vite-plugin-svg-icons) - Used to quickly generate svg sprite
-
## Browser support
The `Chrome 80+` browser is recommended for local development
@@ -318,11 +458,11 @@ Support modern browsers, not IE
| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
+
## License
[MIT License](./LICENSE)
-
## Thanks
-
\ No newline at end of file
+
diff --git a/README.md b/README.md
index d1143f3dd..1c6d24386 100644
--- a/README.md
+++ b/README.md
@@ -125,148 +125,295 @@ linux下,修改完hosts后需要重启网络,在shell中执行:
## 目录结构
-本项目已经为你生成了一个完整的开发框架,提供了涵盖后台开发的各类功能和坑位,下面是整个项目的目录结构。
+### 前端:apps/vben5(pnpm workspace + turbo 的 monorepo)
```bash
-├── mock # mock 服务器 与 模拟数据
-├── public # 静态资源 (会被直接复制)
-│ │── favicon.ico # favicon图标
-│ │── manifest.json # PWA 配置文件
-│ └── index.html # html模板
-├── src # 源代码
-│ ├── api # 所有请求
-│ ├── assets # 主题 字体等静态资源 (由 webpack 处理加载)
-│ ├── components # 全局组件
-│ ├── directive # 全局指令
-│ ├── enums # 全局枚举
-│ ├── hooks # 全局hooks
-│ ├── locales # 国际化
-│ ├── layout # 全局布局
-│ ├── router # 路由
-│ ├── settings # 全局 配置
-│ ├── store # 全局 vuex store
-│ ├── utils # 全局方法
-│ ├── views # 所有页面
-│ ├── App.vue # 入口页面
-│ └── main.js # 入口文件 加载组件 初始化等
-├── types # ts类型
-├── tests # 测试
-├── .env.xxx # 环境变量配置
-├── .eslintrc.js # eslint 配置
-├── jest.config.js # jest 单元测试配置
-├── package.json # package.json 依赖
-├── postcss.config.js # postcss 配置
-├── tsconfig.json # typescript 配置
-└── vite.config.js # vue vite 配置
+apps/vben5/
+├── apps/ # 可独立运行的 UI 应用
+│ ├── app-antd/ # ABP 业务前端(当前使用:pnpm dev:app / pnpm build:app)
+│ ├── web-antd/ # vben 官方 antd 示例应用
+│ ├── web-antdv-next/ # antdv-next 示例应用
+│ ├── web-ele/ # Element Plus 示例应用
+│ ├── web-naive/ # Naive UI 示例应用
+│ └── web-tdesign/ # TDesign 示例应用
+├── packages/
+│ ├── @abp/ # ABP 业务模块包(27 个)
+│ │ ├── account/ # 账户、外部登录(第三方账号绑定)
+│ │ ├── ai-management/ # AI 管理(工作区、工具、智能体)
+│ │ ├── auditing/ # 审计日志、安全日志
+│ │ ├── blob-management/ # 对象存储(容器、文件)
+│ │ ├── cache-management/ # 缓存管理
+│ │ ├── components/ # ABP 前端通用业务组件
+│ │ ├── core/ # ABP 前端核心(请求、权限、菜单等基础能力)
+│ │ ├── data-protection/ # 数据保护(实体/字段级访问控制)
+│ │ ├── demo/ # 示例模块
+│ │ ├── features/ # 特性(Feature)管理
+│ │ ├── gdpr/ # GDPR 数据导出与删除
+│ │ ├── identity/ # 用户、角色、组织机构、会话、登录日志
+│ │ ├── localization/ # 本地化(语言、资源、文本)
+│ │ ├── notifications/ # 通知(通知定义、我的通知、发送记录)
+│ │ ├── openiddict/ # OpenIddict(应用、作用域、授权、令牌)
+│ │ ├── oss/ # OSS/Blob 文件列表
+│ │ ├── permissions/ # 权限定义与授权
+│ │ ├── platform/ # 平台(布局、菜单、数据字典、邮件/短信)
+│ │ ├── request/ # HTTP 请求封装(令牌、错误处理、租户头)
+│ │ ├── saas/ # 租户与版本(Edition)
+│ │ ├── settings/ # 设置定义与设置值
+│ │ ├── signalr/ # SignalR 实时通信
+│ │ ├── tasks/ # 后台任务(作业管理)
+│ │ ├── text-templating/ # 文本模板
+│ │ ├── ui/ # ABP 前端 UI 组件库
+│ │ ├── webhooks/ # Webhook 定义、订阅与发送记录
+│ │ └── wechat/ # 微信(公众号、企业微信等)
+│ ├── @core/ # 内核:base / ui-kit / forward
+│ ├── effects/ # 通用能力:plugins / hooks / common-ui 等
+│ ├── icons/ types/ # 图标、类型定义
+│ └── ... # 其余公共包(见 pnpm-workspace.yaml)
+├── internal/ # 工程化配置:vite-config / lint-configs / tailwind-config / tsconfig / node-utils
+├── docs/ # VitePress 文档
+├── playground/ # 组件与示例演练场
+├── scripts/ # 清理、构建、部署等脚本
+├── package.json # 根脚本:dev / dev:app / build:app / lint / format / test:unit / check:type
+├── pnpm-workspace.yaml # workspace 划分与依赖 catalog
+├── turbo.json # turbo 流水线配置
+└── vitest.config.ts # 单元测试(vitest)配置
```
-## 如何设置以及启动项目
-
-### 安装依赖
+### 后端:aspnet-core 与配套目录
```bash
-yarn install
+.
+├── aspnet-core/
+│ ├── services/ # 各服务宿主(含 Dockerfile)
+│ │ ├── LINGYUN.Abp.MicroService.AuthServer/ # 认证服务(STS,44385)
+│ │ ├── LINGYUN.Abp.MicroService.IdentityService/ # 身份服务(30015)
+│ │ ├── LINGYUN.Abp.MicroService.AdminService/ # 管理服务(30010)
+│ │ ├── LINGYUN.Abp.MicroService.LocalizationService/# 本地化服务(30030)
+│ │ ├── LINGYUN.Abp.MicroService.PlatformService/ # 平台服务(30025)
+│ │ ├── LINGYUN.Abp.MicroService.MessageService/ # 消息服务(30020)
+│ │ ├── LINGYUN.Abp.MicroService.TaskService/ # 任务服务(30040)
+│ │ ├── LINGYUN.Abp.MicroService.WebhookService/ # Webhook 服务(30045)
+│ │ ├── LINGYUN.Abp.MicroService.WorkflowService/ # 工作流服务(30050)
+│ │ ├── LINGYUN.Abp.MicroService.WeChatService/ # 微信服务(30060)
+│ │ ├── LINGYUN.Abp.MicroService.AIService/ # AI 服务(30070)
+│ │ ├── LY.MicroService.Applications.Single/ # 单体应用(30000,合并网关与全部模块)
+│ │ ├── LY.MicroService.IdentityServer/ # IdentityServer 版本服务与宿主
+│ │ ├── LINGYUN.Abp.Applications/ LY.AIO.Applications.Single/ # 其它宿主
+│ │ └── Publish/ # 发布输出目录(容器镜像构建使用)
+│ ├── modules/ # 业务模块,每个模块按 DDD 分层(Domain / Application / EntityFrameworkCore / HttpApi ...)
+│ │ ├── account/ # 账户与登录(含 OpenIddict/IdentityServer 的 Web 集成、验证码)
+│ │ ├── identity/ # 用户、角色、组织机构、会话、登录日志
+│ │ ├── identityServer/ # IdentityServer4 相关实现
+│ │ ├── openIddict/ # OpenIddict 服务端(应用、作用域、令牌、Portal、二维码、短信、微信登录)
+│ │ ├── permissions-management/ # 权限管理与授权
+│ │ ├── saas/ # 多租户与版本
+│ │ ├── settings/ feature-management/ # 设置、特性管理
+│ │ ├── localization-management/ text-templating/ # 本地化、文本模板
+│ │ ├── auditing/ data-protection/ gdpr/ captcha/ # 审计、数据保护、GDPR、验证码
+│ │ ├── blob-management/ caching-management/ # 对象存储、缓存管理
+│ │ ├── platform/ project/ system-info/ demo/ # 平台、项目、系统信息、示例
+│ │ ├── realtime-message/ realtime-notifications/ # 即时消息、实时通知
+│ │ ├── task-management/ rules-management/ webhooks/ # 后台任务、规则引擎、Webhook
+│ │ ├── ai/ elsa/ # AI 能力、工作流(Elsa)
+│ ├── framework/ # 基础框架包(33 个分组),常用分组:
+│ │ ├── common/ core 相关基础包(LINGYUN.Abp.Core、CAP、Hangfire、BlobStoring、SignalR ...)
+│ │ ├── security/ authentication/ authorization/ # 安全、登录方式、授权
+│ │ ├── auditing/ logging/ telemetry/ # 审计、日志、链路追踪(OpenTelemetry/SkyWalking)
+│ │ ├── multi-tenancy 相关:tenants/ # 多租户与版本
+│ │ ├── wechat/ wx-pusher/ pushplus/ tui-juhe/ # 微信、消息推送
+│ │ ├── cloud-aliyun/ cloud-tencent/ # 阿里云、腾讯云集成
+│ │ ├── dapr/ elasticsearch/ efcore/ data-protection/ # Dapr、ES、EF Core、数据保护
+│ │ ├── dynamic-queryable/ dynamic-definition/ exporter/ # 动态查询、动态定义、导入导出
+│ │ ├── localization/ settings/ features/ mvc/ open-api/ cli/ ... # 其它基础包
+│ ├── migrations/ # 各服务的 DbMigrator 与 EntityFrameworkCore 迁移项目(deploy.ps1 会依次执行)
+│ ├── aspire/ # .NET Aspire:LINGYUN.Abp.MicroService.AppHost 及各服务的 Aspire 宿主
+│ ├── templates/ # dotnet new 项目模板(micro 微服务 / aio 单体)
+│ ├── tests/ # 单元测试项目
+│ ├── LINGYUN.MicroService.All.slnx # 全量解决方案
+│ ├── LINGYUN.MicroService.Aspire.slnx # Aspire 解决方案
+│ └── LINGYUN.MicroService.SingleProject.slnx # 单体解决方案
+├── gateways/
+│ ├── internal/ # 内部网关(YARP):Internal.Gateway / OpenApi.Gateway + yarp*.json 路由
+│ └── web/ # Web 网关:LY.MicroService.ApiGateway
+├── apps/ # 前端:vben5(当前)/ vue(旧版)
+├── build/ # 构建与迁移脚本:build-aspnetcore-ef-update.ps1、build-aspnetcore-docker-build.ps1 ...
+├── deploy/ # 一键部署脚本(deploy.ps1)、中间件数据与各服务日志目录
+├── docs/ # 文档(单体服务启动指南等)
+├── docker-compose.yml # 后端服务编排
+├── docker-compose.override.yml # 镜像标签、卷映射与启动顺序
+├── docker-compose.override.configuration.yml # 各服务环境变量(连接串、CAP、Redis、Elasticsearch 等)
+├── docker-compose.middleware.yml # 中间件:MySQL/Redis/RabbitMQ/Elasticsearch/Kibana/Logstash/OpenObserve
+├── docker-compose.override.agile.yml # AgileConfig 配置中心(可选)
+├── Directory.Build.props Directory.Packages.props NuGet.Config common.props # 统一构建与包版本管理
+└── README.md README.en.md RELEASE.md LICENSE # 文档与许可
```
-### 更改配置文件
-
-
-修改开发环境用于代理的服务器地址,以下提供了三个分别为IdentityServer、SignalR、ApiService地址
-如果自己变更了端口,需要改成自己的地址
+## 启动项目
-```bash
+本项目提供三种启动方式,按需选择:
-VITE_PROXY = [["/connect","http://127.0.0.1:44385"],["/api","http://127.0.0.1:30000"],["/signalr-hubs","ws://127.0.0.1:30000"]]
+| 方式 | 说明 | 中间件 | 前端 |
+| --- | --- | --- | --- |
+| 方式一:微服务 | 完整微服务架构,后端全部以容器运行 | 需**先启动** `docker-compose.middleware.yml` | 单独启动 vben5 |
+| 方式二:Aspire | AppHost 编排本地微服务开发环境 | AppHost 自动创建容器(PostgreSQL/Redis/RabbitMQ/Elasticsearch/Kibana) | AppHost 自动启动 |
+| 方式三:单体 | 网关、认证与业务模块合并为一个进程 | 需**先启动** `docker-compose.middleware.yml` | 单独启动 vben5 |
-```
+### 通用前提
-修改生产环境真实地址,如上
+- **.NET SDK 10**(`dotnet --version`)
+- **Docker / Docker Compose**(方式一、三的中间件;方式二的中间件容器同样由 Docker 提供)
+- **Node.js 20+ 与 pnpm**(前端位于 `apps/vben5`,为 pnpm monorepo,`preinstall` 会执行 `only-allow pnpm`)
+- **hosts**:Windows 修改 `C:\Windows\System32\drivers\etc\hosts`,Linux 修改 `/etc/hosts`,增加如下配置
+ ```
+ 127.0.0.1 host.docker.internal
+ ```
+ (容器内通过 `extra_hosts: host.docker.internal:host-gateway` 访问宿主机上的中间件)
-```bash
+---
-# STS Connect
-# token签发地址
-VITE_GLOB_AUTHORITY='http://127.0.0.1:44385'
-# 客户端标识
-VITE_GLOB_CLIENT_ID='vue-admin-element'
-# 客户端密钥
-VITE_GLOB_CLIENT_SECRET='1q2w3e*'
+### 方式一:微服务启动
+#### 1) 一键启动:deploy/deploy.ps1
+```powershell
+cd ./deploy
+powershell -ExecutionPolicy Bypass -File .\deploy.ps1
```
-### EntityFramework 迁移
+脚本依次完成(见 `deploy/deploy.ps1`):
-请切换到服务项目启动目录, 执行 **dotnet ef** 命令进行数据库迁移
+1. 启动中间件:`docker-compose -f .\docker-compose.middleware.yml -p labp up -d --build`(MySQL、Redis、RabbitMQ、Elasticsearch、Kibana、Logstash、OpenObserve)
+2. 等待 30 秒,等 MySQL 初始化完成
+3. 依次执行 8 个数据库迁移项目(`dotnet run --no-build`,**因此执行脚本前必须先构建过后端**)
+4. 构建 12 个后端镜像(`labp-*-service:10.6.0`)
+5. 启动后端:`docker-compose -f .\docker-compose.yml -f .\docker-compose.override.yml -f .\docker-compose.override.configuration.yml -p labp up -d`
+6. 在 `apps/vben5` 下执行 `pnpm dev:app` 启动前端
-例如:
-``` shell
+注意:
-cd aspnet-core/services/admin/LINGYUN.BackendAdminApp.Host
+- 必须在 **deploy 目录**下执行脚本(脚本内部使用相对路径)。
+- 脚本调用的是 `docker-compose`(Compose V1 命令);本机只安装 Compose V2 插件时,请把脚本中的 `docker-compose` 改为 `docker compose`。
+- 脚本不包含 AgileConfig(`docker-compose.override.agile.yml`),配置均来自 `docker-compose.override.configuration.yml`。
-dotnet ef database update
-
-```
-
-- 也可以使用快速迁移脚本文件: **./build/build-aspnetcore-ef-update.ps1**
+#### 2) 手动启动(与脚本等价,务必先启动中间件)
+```powershell
+# ① 启动中间件(务必先启动)
+docker-compose -f .\docker-compose.middleware.yml -p labp up -d
+# 首次启动请等待 30 秒以上,让 MySQL 执行 deploy/mysql/docker-entrypoint-initdb.d 下的初始化脚本
-### 配置RabbitMQ
+# ② 数据库迁移:使用迁移脚本(内部对 aspnet-core/migrations 下的 8 个 *.DbMigrator 依次执行 dotnet run,会自动构建)
+cd .\build
+.\build-aspnetcore-ef-update.ps1
-因此项目设计为微服务架构,服务间通讯采用分布式事件的方式,项目采用的是[DotNetCore/CAP](https://github.com/dotnetcore/CAP)
-通讯方式为**RabbitMQ Server**,所以您需要事先安装**RabbitMQ**,具体安装方式请查阅官网
+# ③ 构建后端镜像:生成 12 个 labp-*-service:10.6.0(标签必须与 docker-compose.override.yml 中的 image 一致)
+.\build-aspnetcore-docker-build.ps1
-然后您需要更改配置文件中的**CAP:RabbitMQ**配置项,设置为您自己定义的配置,推荐使用**rabbitmq_management**插件便于快速管理**RabbitMQ**
+# ④ 启动后端(三个 compose 文件缺一不可)
+docker-compose -f .\docker-compose.yml -f .\docker-compose.override.yml -f .\docker-compose.override.configuration.yml -p labp up -d
+# ⑤ 启动前端
+cd .\apps\vben5
+pnpm install
+pnpm dev:app
+```
-### 启动后台服务
-
-```shell
-cd aspnet-core/services
+手动步骤说明:
-start-all-service.bat
+- ②③ 两个脚本都必须在 **build 目录**下执行(脚本内部相对引用 `./build-aspnetcore-common.ps1`)。
+- `build-aspnetcore-ef-update.ps1` 内部使用 `dotnet run`(会先构建再运行),因此手动流程**不需要**预先构建后端;而一键脚本 `deploy.ps1` 使用 `dotnet run --no-build`,所以走一键脚本前必须先构建过后端。
+- 只想迁移某个服务时,可直接进入对应目录执行,例如:
+ ```powershell
+ cd .\aspnet-core\migrations\LINGYUN.Abp.MicroService.AuthServer.DbMigrator
+ dotnet run
+ ```
+
+#### 3) 访问地址
+
+| 组件 | 地址 |
+| --- | --- |
+| 前端(vben5,`@abp/app-antd`) | http://localhost:5666 |
+| API 网关 | http://localhost:30000 |
+| 认证服务(STS) | http://localhost:44385 |
+| 身份 / 管理 / 平台 / 消息 / 本地化 | 30015 / 30010 / 30025 / 30020 / 30030 |
+| 任务 / Webhook / 工作流 / 微信 / AI | 30040 / 30045 / 30050 / 30060 / 30070 |
+| Kibana | http://localhost:5601 |
+| RabbitMQ 管理台 | http://localhost:15672 (admin / 123456) |
+| MySQL | localhost:3306 (root / 123456,数据库 `abp`) |
+| Redis | localhost:6379 |
+| OpenObserve 管理台 | http://localhost:5080 (admin@abp.io / ww1Z5L%6) |
+
+### 方式二:Aspire 启动
+
+AppHost 会自动拉起它自己的中间件容器(PostgreSQL、Redis、RabbitMQ、Elasticsearch、Kibana),在 Development 环境下自动执行各服务的数据库迁移项目,并自动以 `pnpm dev:app` 启动 vben5 前端,**不需要**再启动 `docker-compose.middleware.yml`。
+
+```powershell
+cd ./aspnet-core/aspire/LINGYUN.Abp.MicroService.AppHost
+aspire run
```
-### 启动本地开发环境
-
-```shell
+- 需要安装 Aspire CLI(版本需与 AppHost 的 `Aspire.AppHost.Sdk` 13.x 匹配):`dotnet tool install --global Aspire.Cli`;不使用 CLI 时也可以直接 `dotnet run --project .\LINGYUN.Abp.MicroService.AppHost.csproj`。
+- 需要 Docker 处于运行状态,且 `apps/vben5` 已经执行过 `pnpm install`(AppHost 会运行 `pnpm dev:app`,前端端口固定 5666)。
+- 启动后终端会输出 Aspire Dashboard 地址,可在面板中查看资源状态、日志与链路。
+- AppHost 占用的宿主机端口与方式一的中间件完全重叠(6379/9200/5601/5672/15672/5432 等),**请勿与方式一的中间件同时运行**。
-cd apps/vue
+### 方式三:单体服务启动
-yarn dev
+单体服务把网关、认证与各业务模块合并到一个进程,但**仍然依赖中间件,必须先启动中间件**:
-```
+```powershell
+# ① 启动中间件
+docker-compose -f .\docker-compose.middleware.yml -p labp up -d
+# 首次启动请等待 30 秒以上
-### 构建生产环境
+# ② 启动单体服务
+cd .\aspnet-core\services\LY.MicroService.Applications.Single
+dotnet run --launch-profile Single.MySql.Dev
-```bash
-yarn build
+# ③ 启动前端
+cd .\apps\vben5
+pnpm install
+pnpm dev:app
```
-### 关于docker容器部署
+- 默认地址 **http://localhost:30000**:`App:SelfUrl` 与 `AuthServer:Authority` 均指向它,认证端点与 API 同端口。
+- **建议显式指定 Profile**:不指定时 `dotnet run` 使用 `launchSettings.json` 中的第一个 Profile(当前为 `Single.PostgreSql.Dev`)。使用默认数据库(MySQL)请用 `Single.MySql.Dev`,其它可选 `Single.PostgreSql.Dev`、`Single.SqlServer.Dev`。
+- 各数据库连接串见 `appsettings.Development.MySql.json` / `appsettings.Development.PostgreSql.json` / `appsettings.Development.SqlServer.json`。
-**第一步**: 构建后台服务, powershell脚本:**./build/build-aspnetcore-release.ps1**, **注意:发布后的服务需要 appsettings.Production.json 文件**
+### 常见问题
-**第二步**: 构建前端, **./build/build-vue-apps.ps1**
+- **`docker-compose` 命令不存在**:脚本使用的是 Compose V1 命令;仅安装 Compose V2 时请改用 `docker compose`。
+- **提示找不到镜像 `labp-*-service:10.6.0`**:`docker-compose.override.yml` 通过 `image:` 引用预构建镜像,请先执行 `build/build-aspnetcore-docker-build.ps1`(方式一·手动启动 步骤 ③)。
+- **一键脚本迁移报错(`dotnet run --no-build`)**:`deploy.ps1` 内部使用 `--no-build`,执行脚本前需先构建后端(`dotnet build .\aspnet-core\LINGYUN.MicroService.All.slnx`);手动迁移请改用 **build/build-aspnetcore-ef-update.ps1**(内部 `dotnet run`,会自动构建)。
+- **前端依赖安装失败**:`apps/vben5` 强制使用 pnpm(`preinstall` 会执行 `only-allow pnpm`),请使用 `pnpm install` / `pnpm dev:app`。
+- **容器内连不上宿主机中间件**:确认 hosts 文件包含 `127.0.0.1 host.docker.internal`。
-**第三步**: 构建后的发布地址默认在**cd ./aspnet-core/services/Publish** ,变更nginx代理服务器地址: **./client/docker/nginx/default.conf**
+---
-**第四步**: 运行此命令 **sudo docker-compose down && sudo docker-compose -f docker-compose.yml -f docker-compose.override.yml up --build -d**
+### 代码格式检查以及自动修复
-**推荐使用 jenkins 之类的ci工具,可以将此简化为一个步骤**
+在 `apps/vben5` 下执行(vben5 强制使用 pnpm):
+```bash
+cd apps/vben5
-### 代码格式检查以及自动修复
+# 代码检查
+pnpm lint
-```bash
-yarn lint:eslint
+# 自动修复
+pnpm format
+
+# 类型检查
+pnpm check:type
```
### 运行单元测试
```bash
-yarn test:unit
+cd apps/vben5
+
+pnpm test:unit
```
## 如何贡献
diff --git a/apps/vben5/packages/@abp/notifications/src/components/send-records/NotificationSendRecordTable.vue b/apps/vben5/packages/@abp/notifications/src/components/send-records/NotificationSendRecordTable.vue
index 275f0b0fe..e1b3d3136 100644
--- a/apps/vben5/packages/@abp/notifications/src/components/send-records/NotificationSendRecordTable.vue
+++ b/apps/vben5/packages/@abp/notifications/src/components/send-records/NotificationSendRecordTable.vue
@@ -119,7 +119,7 @@ const formOptions: VbenFormProps = {
],
},
fieldName: 'state',
- label: $t('WebhooksManagement.DisplayName:State'),
+ label: $t('Notifications.DisplayName:SendState'),
},
{
component: 'ApiSelect',
diff --git a/aspnet-core/LINGYUN.MicroService.All.slnx b/aspnet-core/LINGYUN.MicroService.All.slnx
index e519b3174..1f00450ab 100644
--- a/aspnet-core/LINGYUN.MicroService.All.slnx
+++ b/aspnet-core/LINGYUN.MicroService.All.slnx
@@ -27,63 +27,70 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
@@ -307,6 +314,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -383,6 +405,7 @@
+
diff --git a/aspnet-core/cleanup-logs.bat b/aspnet-core/cleanup-logs.bat
index 5140f0035..77f00d751 100644
--- a/aspnet-core/cleanup-logs.bat
+++ b/aspnet-core/cleanup-logs.bat
@@ -18,16 +18,15 @@ del .\aspire\LINGYUN.Abp.MicroService.WeChatService\Logs /Q
del .\aspire\LINGYUN.Abp.MicroService.WorkflowService\Logs /Q
del .\services\LY.MicroService.Applications.Single\Logs /Q
-del .\services\LY.MicroService.BackendAdmin.HttpApi.Host\Logs /Q
-del .\services\LY.MicroService.AuthServer\Logs /Q
-del .\services\LY.MicroService.AuthServer.HttpApi.Host\Logs /Q
-del .\services\LY.MicroService.identityServer\Logs /Q
-del .\services\LY.MicroService.identityServer.HttpApi.Host\Logs /Q
-del .\services\LY.MicroService.LocalizationManagement.HttpApi.Host\Logs /Q
-del .\services\LY.MicroService.PlatformManagement.HttpApi.Host\Logs /Q
-del .\services\LY.MicroService.RealtimeMessage.HttpApi.Host\Logs /Q
-del .\services\LY.MicroService.TaskManagement.HttpApi.Host\Logs /Q
-del .\services\LY.MicroService.WebhooksManagement.HttpApi.Host\Logs /Q
-del .\services\LY.MicroService.WechatManagement.HttpApi.Host\Logs /Q
-del .\services\LY.MicroService.WorkflowManagement.HttpApi.Host\Logs /Q
+del .\services\LINGYUN.Abp.MicroService.LocalizationService\Logs /Q
+del .\services\LINGYUN.Abp.MicroService.AuthServer\Logs /Q
+del .\services\LINGYUN.Abp.MicroService.AdminService\Logs /Q
+del .\services\LINGYUN.Abp.MicroService.IdentityService\Logs /Q
+del .\services\LINGYUN.Abp.MicroService.PlatformService\Logs /Q
+del .\services\LINGYUN.Abp.MicroService.TaskService\Logs /Q
+del .\services\LINGYUN.Abp.MicroService.MessageService\Logs /Q
+del .\services\LINGYUN.Abp.MicroService.WebhookService\Logs /Q
+del .\services\LINGYUN.Abp.MicroService.WeChatService\Logs /Q
+del .\services\LINGYUN.Abp.MicroService.WorkflowService\Logs /Q
+
diff --git a/aspnet-core/create-database.bat b/aspnet-core/create-database.bat
deleted file mode 100644
index 32fb1efa0..000000000
--- a/aspnet-core/create-database.bat
+++ /dev/null
@@ -1,13 +0,0 @@
-@echo off
-cls
-
-call .\migrate-db-cmd.bat LY.MicroService.Platform.EntityFrameworkCore platform --ef-u
-call .\migrate-db-cmd.bat LY.MicroService.BackendAdmin.EntityFrameworkCore admin --ef-u
-call .\migrate-db-cmd.bat LY.MicroService.AuthServer.EntityFrameworkCore auth-server --ef-u
-call .\migrate-db-cmd.bat LY.MicroService.IdentityServer.EntityFrameworkCore identityserver4-admin --ef-u
-call .\migrate-db-cmd.bat LY.MicroService.LocalizationManagement.EntityFrameworkCore localization --ef-u
-call .\migrate-db-cmd.bat LY.MicroService.RealtimeMessage.EntityFrameworkCore messages --ef-u
-call .\migrate-db-cmd.bat LY.MicroService.TaskManagement.EntityFrameworkCore task-management --ef-u
-call .\migrate-db-cmd.bat LY.MicroService.WebhooksManagement.EntityFrameworkCore webhooks-management --ef-u
-
-taskkill /IM dotnet.exe /F
\ No newline at end of file
diff --git a/aspnet-core/delete-bin-obj.bat b/aspnet-core/delete-bin-obj.bat
new file mode 100644
index 000000000..5430432b6
--- /dev/null
+++ b/aspnet-core/delete-bin-obj.bat
@@ -0,0 +1,18 @@
+@echo off
+setlocal enabledelayedexpansion
+
+cls
+echo Deleting all BIN and OBJ folders...
+
+for /f "delims=" %%D in ('dir /s /b /ad bin obj 2^>nul') do (
+ echo %%D | findstr /i "\\node_modules\\" >nul
+ if errorlevel 1 (
+ echo Deleting: %%D
+ rd /s /q "%%D"
+ ) else (
+ echo Skipping: %%D
+ )
+)
+
+echo BIN and OBJ folders have been successfully deleted.
+endlocal
\ No newline at end of file
diff --git a/aspnet-core/ef-update.ps1 b/aspnet-core/ef-update.ps1
deleted file mode 100644
index 4be3108f9..000000000
--- a/aspnet-core/ef-update.ps1
+++ /dev/null
@@ -1,20 +0,0 @@
-Set-Location ".\migrations\LY.MicroService.BackendAdmin.EntityFrameworkCore"
-dotnet ef database update
-
-Set-Location "..\LY.MicroService.Platform.EntityFrameworkCore"
-dotnet ef database update
-
-Set-Location "..\LY.MicroService.LocalizationManagement.EntityFrameworkCore"
-dotnet ef database update
-
-Set-Location "..\LY.MicroService.RealtimeMessage.EntityFrameworkCore"
-dotnet ef database update
-
-Set-Location "..\LY.MicroService.IdentityServer.EntityFrameworkCore"
-dotnet ef database update
-
-Set-Location "..\LY.MicroService.TaskManagement.EntityFrameworkCore"
-dotnet ef database update
-
-Set-Location "..\LY.MicroService.AuthServer.EntityFrameworkCore"
-dotnet ef database update
diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/LocalizableValue.cs b/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/LocalizableValue.cs
new file mode 100644
index 000000000..bced7592f
--- /dev/null
+++ b/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/LocalizableValue.cs
@@ -0,0 +1,25 @@
+using System;
+
+namespace Volo.Abp.Settings;
+
+[Serializable]
+public class LocalizableValue
+{
+ public string ResourceName { get; set; } = default!;
+
+ public string Name { get; set; } = default!;
+
+ public TValue Value { get; set; } = default!;
+
+ public LocalizableValue()
+ {
+
+ }
+
+ public LocalizableValue(string resourceName, string name, TValue value)
+ {
+ ResourceName = resourceName;
+ Name = name;
+ Value = value;
+ }
+}
diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/SettingDefinitionExtensions.cs b/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/SettingDefinitionExtensions.cs
index f7e3f6165..ff50517a9 100644
--- a/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/SettingDefinitionExtensions.cs
+++ b/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/SettingDefinitionExtensions.cs
@@ -192,6 +192,19 @@ public static class SettingDefinitionExtensions
.WithProperty(OptionValueKey, optionValues);
}
+ public static SettingDefinition WithOptions(
+ this SettingDefinition definition,
+ IEnumerable> options)
+ {
+ var optionNames = options.Select(x => $"N:{x.Name};L:{x.ResourceName}").JoinAsString(",");
+ var optionValues = options.Select(x => x.Value).JoinAsString(",");
+
+ return definition
+ .WithValueType(ValueType.Option)
+ .WithProperty(OptionNameKey, optionNames)
+ .WithProperty(OptionValueKey, optionValues);
+ }
+
public static SettingDefinition ReplaceProviders(
this SettingDefinition definition,
params string[] providers)
diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/SettingResourceDefinition.cs b/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/SettingResourceDefinition.cs
index e3285b588..7bc314bc8 100644
--- a/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/SettingResourceDefinition.cs
+++ b/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/SettingResourceDefinition.cs
@@ -53,7 +53,7 @@ public class SettingResourceDefinition
{
if (!string.IsNullOrWhiteSpace(ResourceType))
{
- return new LocalizableString(DisplayName!, ResourceType).Localize(stringLocalizerFactory);
+ return new LocalizableString(Type.GetType(ResourceType)!, DisplayName!).Localize(stringLocalizerFactory);
}
return new LocalizableString(DisplayName!, ResourceName).Localize(stringLocalizerFactory);
}
diff --git a/aspnet-core/migrate-database.bat b/aspnet-core/migrate-database.bat
deleted file mode 100644
index 68b63f138..000000000
--- a/aspnet-core/migrate-database.bat
+++ /dev/null
@@ -1,12 +0,0 @@
-@echo off
-cls
-
-call .\migrate-db-cmd.bat LY.MicroService.AuthServer.DbMigrator auth-server --run
-call .\migrate-db-cmd.bat LY.MicroService.Platform.DbMigrator platform --run
-call .\migrate-db-cmd.bat LY.MicroService.LocalizationManagement.DbMigrator localization --run
-call .\migrate-db-cmd.bat LY.MicroService.RealtimeMessage.DbMigrator messages --run
-call .\migrate-db-cmd.bat LY.MicroService.TaskManagement.DbMigrator task-management --run
-call .\migrate-db-cmd.bat LY.MicroService.WebhooksManagement.DbMigrator webhooks-management --run
-call .\migrate-db-cmd.bat LY.MicroService.BackendAdmin.DbMigrator admin --run
-
-taskkill /IM dotnet.exe /F
\ No newline at end of file
diff --git a/aspnet-core/migrate-db-cmd.bat b/aspnet-core/migrate-db-cmd.bat
deleted file mode 100644
index fad3e03ad..000000000
--- a/aspnet-core/migrate-db-cmd.bat
+++ /dev/null
@@ -1,31 +0,0 @@
-@echo off
-chcp 65001
-
-title %2
-
-@echo %2 migrating
-
-cd .\migrations\%1
-
-if '%3' equ '--run' goto run
-if '%3' equ '--restore' goto restore
-if '%3' equ '--ef-u' goto efu
-if '%3' equ '' goto run
-exit
-
-:run
-start cmd.exe /c dotnet run --no-build
-goto end
-
-:restore
-dotnet restore
-goto end
-
-:efu
-dotnet ef database update
-goto end
-
-:end
-cd ..\..\
-@echo %2 migrated
-@echo --------
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/AIServiceDbMigratorHostedService.cs b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/AIServiceDbMigratorHostedService.cs
new file mode 100644
index 000000000..8e4e025c5
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/AIServiceDbMigratorHostedService.cs
@@ -0,0 +1,54 @@
+using LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+using Serilog;
+using System.Threading;
+using System.Threading.Tasks;
+using Volo.Abp;
+using Volo.Abp.Data;
+
+namespace LINGYUN.Abp.MicroService.AIService.DbMigrator;
+
+public class AIServiceDbMigratorHostedService : IHostedService
+{
+ private readonly IHostApplicationLifetime _hostApplicationLifetime;
+ private readonly IConfiguration _configuration;
+
+ public AIServiceDbMigratorHostedService(
+ IHostApplicationLifetime hostApplicationLifetime,
+ IConfiguration configuration)
+ {
+ _hostApplicationLifetime = hostApplicationLifetime;
+ _configuration = configuration;
+ }
+
+ public async Task StartAsync(CancellationToken cancellationToken)
+ {
+ using var application = await AbpApplicationFactory
+ .CreateAsync(options =>
+ {
+ options.Services.ReplaceConfiguration(_configuration);
+ options.UseAutofac();
+ options.Services.AddLogging(c => c.AddSerilog());
+ options.AddDataMigrationEnvironment();
+ });
+
+ await application.InitializeAsync();
+
+ await application
+ .ServiceProvider
+ .GetRequiredService()
+ .CheckAndApplyDatabaseMigrationsAsync();
+
+ await application.ShutdownAsync();
+
+ _hostApplicationLifetime.StopApplication();
+ }
+
+ public Task StopAsync(CancellationToken cancellationToken)
+ {
+ return Task.CompletedTask;
+ }
+}
+
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/AIServiceDbMigratorModule.cs b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/AIServiceDbMigratorModule.cs
new file mode 100644
index 000000000..ea4131ac8
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/AIServiceDbMigratorModule.cs
@@ -0,0 +1,14 @@
+using LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore;
+using Volo.Abp.Autofac;
+using Volo.Abp.Modularity;
+
+namespace LINGYUN.Abp.MicroService.AIService.DbMigrator;
+
+[DependsOn(
+ typeof(AbpAutofacModule),
+ typeof(AIServiceMigrationsEntityFrameworkCoreModule)
+ )]
+public class AIServiceDbMigratorModule : AbpModule
+{
+
+}
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/LINGYUN.Abp.MicroService.AIService.DbMigrator.csproj b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/LINGYUN.Abp.MicroService.AIService.DbMigrator.csproj
new file mode 100644
index 000000000..e5cdabb81
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/LINGYUN.Abp.MicroService.AIService.DbMigrator.csproj
@@ -0,0 +1,32 @@
+
+
+
+
+
+ Exe
+ net10.0
+ enable
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/Program.cs b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/Program.cs
new file mode 100644
index 000000000..0c7170238
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/Program.cs
@@ -0,0 +1,43 @@
+using LINGYUN.Abp.MicroService.AIService.DbMigrator;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
+using Serilog;
+using Serilog.Events;
+using System;
+
+var defaultOutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}";
+
+Log.Logger = new LoggerConfiguration()
+ .MinimumLevel.Information()
+ .MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
+ .MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning)
+#if DEBUG
+ .MinimumLevel.Override("LINGYUN.Abp.MicroService.AIService", LogEventLevel.Debug)
+#else
+ .MinimumLevel.Override("LINGYUN.Abp.MicroService.AIService", LogEventLevel.Information)
+#endif
+ .Enrich.FromLogContext()
+ .WriteTo.Async(x => x.Console(outputTemplate: defaultOutputTemplate))
+ .WriteTo.Async(x => x.File("Logs/migrations.txt", outputTemplate: defaultOutputTemplate))
+ .CreateLogger();
+
+try
+{
+ var builder = Host.CreateDefaultBuilder(args)
+ .AddAppSettingsSecretsJson()
+ .ConfigureLogging((context, logging) => logging.ClearProviders())
+ .ConfigureServices((hostContext, services) =>
+ {
+ services.AddHostedService();
+ });
+ await builder.RunConsoleAsync();
+}
+catch (Exception ex)
+{
+ Log.Fatal(ex, "Host terminated unexpectedly!");
+}
+finally
+{
+ await Log.CloseAndFlushAsync();
+}
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/appsettings.json b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/appsettings.json
new file mode 100644
index 000000000..7f4a7f274
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.DbMigrator/appsettings.json
@@ -0,0 +1,75 @@
+{
+ "ConnectionStrings": {
+ "Default": "Server=localhost;Database=abp;User Id=root;Password=123456;SslMode=None"
+ },
+ "StringEncryption": {
+ "DefaultPassPhrase": "s46c5q55nxpeS8Ra",
+ "InitVectorBytes": "s83ng0abvd02js84",
+ "DefaultSalt": "sf&5)s3#"
+ },
+ "Serilog": {
+ "MinimumLevel": {
+ "Default": "Information",
+ "Override": {
+ "System": "Warning",
+ "Microsoft": "Warning",
+ "DotNetCore": "Information"
+ }
+ },
+ "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName", "WithUniqueId" ],
+ "WriteTo": [
+ {
+ "Name": "Console",
+ "Args": {
+ "restrictedToMinimumLevel": "Debug",
+ "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
+ }
+ },
+ {
+ "Name": "File",
+ "Args": {
+ "path": "Logs/Debug-.log",
+ "restrictedToMinimumLevel": "Debug",
+ "rollingInterval": "Day",
+ "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
+ }
+ },
+ {
+ "Name": "File",
+ "Args": {
+ "path": "Logs/Info-.log",
+ "restrictedToMinimumLevel": "Information",
+ "rollingInterval": "Day",
+ "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
+ }
+ },
+ {
+ "Name": "File",
+ "Args": {
+ "path": "Logs/Warn-.log",
+ "restrictedToMinimumLevel": "Warning",
+ "rollingInterval": "Day",
+ "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
+ }
+ },
+ {
+ "Name": "File",
+ "Args": {
+ "path": "Logs/Error-.log",
+ "restrictedToMinimumLevel": "Error",
+ "rollingInterval": "Day",
+ "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
+ }
+ },
+ {
+ "Name": "File",
+ "Args": {
+ "path": "Logs/Fatal-.log",
+ "restrictedToMinimumLevel": "Fatal",
+ "rollingInterval": "Day",
+ "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
+ }
+ }
+ ]
+ }
+}
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDataSeeder.cs b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDataSeeder.cs
new file mode 100644
index 000000000..9b5639dec
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDataSeeder.cs
@@ -0,0 +1,27 @@
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Logging.Abstractions;
+using System.Threading.Tasks;
+using Volo.Abp.Data;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.MultiTenancy;
+
+namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore;
+
+public class AIServiceDataSeeder : ITransientDependency
+{
+ protected ILogger Logger { get; }
+ protected ICurrentTenant CurrentTenant { get; }
+
+ public AIServiceDataSeeder(
+ ICurrentTenant currentTenant)
+ {
+ CurrentTenant = currentTenant;
+
+ Logger = NullLogger.Instance;
+ }
+
+ public virtual Task SeedAsync(DataSeedContext context)
+ {
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDbMigrationEventHandler.cs b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDbMigrationEventHandler.cs
new file mode 100644
index 000000000..6d643ad4b
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDbMigrationEventHandler.cs
@@ -0,0 +1,45 @@
+using Microsoft.Extensions.Logging;
+using System.Threading.Tasks;
+using Volo.Abp.Data;
+using Volo.Abp.DistributedLocking;
+using Volo.Abp.EntityFrameworkCore.Migrations;
+using Volo.Abp.EventBus.Distributed;
+using Volo.Abp.MultiTenancy;
+using Volo.Abp.Uow;
+
+namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore;
+
+public class AIServiceDbMigrationEventHandler : EfCoreDatabaseMigrationEventHandlerBase
+{
+ protected AIServiceDataSeeder DataSeeder { get; }
+
+ public AIServiceDbMigrationEventHandler(
+ ICurrentTenant currentTenant,
+ IUnitOfWorkManager unitOfWorkManager,
+ ITenantStore tenantStore,
+ IAbpDistributedLock abpDistributedLock,
+ IDistributedEventBus distributedEventBus,
+ ILoggerFactory loggerFactory,
+ AIServiceDataSeeder dataSeeder)
+ : base(
+ ConnectionStringNameAttribute.GetConnStringName(),
+ currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory)
+ {
+ DataSeeder = dataSeeder;
+ }
+
+ protected async override Task AfterTenantCreated(TenantCreatedEto eventData, bool schemaMigrated)
+ {
+ // 新租户数据种子
+ var context = new DataSeedContext(eventData.Id);
+ if (eventData.Properties != null)
+ {
+ foreach (var property in eventData.Properties)
+ {
+ context.WithProperty(property.Key, property.Value);
+ }
+ }
+
+ await DataSeeder.SeedAsync(context);
+ }
+}
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDbMigrationService.cs b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDbMigrationService.cs
new file mode 100644
index 000000000..1576c8483
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceDbMigrationService.cs
@@ -0,0 +1,37 @@
+using LINGYUN.Abp.Data.DbMigrator;
+using Microsoft.Extensions.Logging;
+using System;
+using System.Threading.Tasks;
+using Volo.Abp.Data;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.DistributedLocking;
+using Volo.Abp.EventBus.Distributed;
+using Volo.Abp.MultiTenancy;
+using Volo.Abp.Uow;
+
+namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore;
+
+public class AIServiceDbMigrationService : EfCoreRuntimeDbMigratorBase, ITransientDependency
+{
+ protected AIServiceDataSeeder DataSeeder { get; }
+ public AIServiceDbMigrationService(
+ ICurrentTenant currentTenant,
+ IUnitOfWorkManager unitOfWorkManager,
+ IServiceProvider serviceProvider,
+ IAbpDistributedLock abpDistributedLock,
+ IDistributedEventBus distributedEventBus,
+ ILoggerFactory loggerFactory,
+ AIServiceDataSeeder dataSeeder)
+ : base(
+ ConnectionStringNameAttribute.GetConnStringName(),
+ unitOfWorkManager, serviceProvider, currentTenant, abpDistributedLock, distributedEventBus, loggerFactory)
+ {
+ DataSeeder = dataSeeder;
+ }
+
+ protected async override Task SeedAsync()
+ {
+ // DbMigrator迁移数据种子
+ await DataSeeder.SeedAsync(new DataSeedContext());
+ }
+}
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsDbContext.cs b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsDbContext.cs
new file mode 100644
index 000000000..5ab0b83b4
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsDbContext.cs
@@ -0,0 +1,35 @@
+using LINGYUN.Abp.AIManagement.Chats;
+using LINGYUN.Abp.AIManagement.EntityFrameworkCore;
+using LINGYUN.Abp.AIManagement.Tokens;
+using LINGYUN.Abp.AIManagement.Tools;
+using LINGYUN.Abp.AIManagement.Workspaces;
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp.Data;
+using Volo.Abp.EntityFrameworkCore;
+
+namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore;
+
+[ConnectionStringName("AIServiceDbMigrator")]
+public class AIServiceMigrationsDbContext :
+ AbpDbContext,
+ IAIManagementDbContext
+{
+ public DbSet WorkspaceDefinitions { get; set; }
+ public DbSet AIToolDefinitions { get; set; }
+ public DbSet TextChatMessageRecords { get; set; }
+ public DbSet ConversationRecords { get; set; }
+ public DbSet TokenUsageRecords { get; set; }
+
+ public AIServiceMigrationsDbContext(
+ DbContextOptions options) : base(options)
+ {
+ }
+
+ protected override void OnModelCreating(ModelBuilder builder)
+ {
+ base.OnModelCreating(builder);
+
+ builder.ConfigureAIManagement();
+ }
+}
+
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsDbContextFactory.cs b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsDbContextFactory.cs
new file mode 100644
index 000000000..fab946579
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsDbContextFactory.cs
@@ -0,0 +1,29 @@
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Design;
+using Microsoft.Extensions.Configuration;
+using System.IO;
+
+namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore;
+
+public class AIServiceMigrationsDbContextFactory : IDesignTimeDbContextFactory
+{
+ public AIServiceMigrationsDbContext CreateDbContext(string[] args)
+ {
+ var configuration = BuildConfiguration();
+ var connectionString = configuration.GetConnectionString("Default");
+
+ var builder = new DbContextOptionsBuilder()
+ .UseMySql(connectionString, ServerVersion.AutoDetect(connectionString));
+
+ return new AIServiceMigrationsDbContext(builder!.Options);
+ }
+
+ private static IConfigurationRoot BuildConfiguration()
+ {
+ var builder = new ConfigurationBuilder()
+ .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../LINGYUN.Abp.MicroService.AIService.DbMigrator/"))
+ .AddJsonFile("appsettings.json", optional: false);
+
+ return builder.Build();
+ }
+}
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsEntityFrameworkCoreModule.cs b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsEntityFrameworkCoreModule.cs
new file mode 100644
index 000000000..e3a29ef4c
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/AIServiceMigrationsEntityFrameworkCoreModule.cs
@@ -0,0 +1,44 @@
+using LINGYUN.Abp.AIManagement.EntityFrameworkCore;
+using LINGYUN.Abp.Data.DbMigrator;
+using LINGYUN.Abp.EntityFrameworkCore.MySQL;
+using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
+using LINGYUN.Abp.Saas.EntityFrameworkCore;
+using LINGYUN.Abp.TextTemplating.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.DependencyInjection;
+using Volo.Abp.EntityFrameworkCore;
+using Volo.Abp.FeatureManagement.EntityFrameworkCore;
+using Volo.Abp.Modularity;
+using Volo.Abp.PermissionManagement.EntityFrameworkCore;
+using Volo.Abp.SettingManagement.EntityFrameworkCore;
+
+namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore;
+
+[DependsOn(
+ typeof(AbpAIManagementEntityFrameworkCoreModule),
+ typeof(AbpSaasEntityFrameworkCoreModule),
+ typeof(AbpSettingManagementEntityFrameworkCoreModule),
+ typeof(AbpPermissionManagementEntityFrameworkCoreModule),
+ typeof(AbpFeatureManagementEntityFrameworkCoreModule),
+ typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
+ typeof(AbpTextTemplatingEntityFrameworkCoreModule),
+ typeof(AbpEntityFrameworkCoreMySQLMicrotingModule),
+ typeof(AbpDataDbMigratorModule)
+ )]
+public class AIServiceMigrationsEntityFrameworkCoreModule : AbpModule
+{
+ public override void ConfigureServices(ServiceConfigurationContext context)
+ {
+ context.Services.AddAbpDbContext();
+
+ Configure(options =>
+ {
+ options.UseMySQL(
+ mysql =>
+ {
+ // see: https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/1960
+ mysql.UseParameterizedCollectionMode(ParameterTranslationMode.Constant);
+ });
+ });
+ }
+}
diff --git a/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/FodyWeavers.xml b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/FodyWeavers.xml
similarity index 100%
rename from aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/FodyWeavers.xml
rename to aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/FodyWeavers.xml
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/FodyWeavers.xsd b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/FodyWeavers.xsd
new file mode 100644
index 000000000..3f3946e28
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/FodyWeavers.xsd
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.
+
+
+
+
+ A comma-separated list of error codes that can be safely ignored in assembly verification.
+
+
+
+
+ 'false' to turn off automatic generation of the XML Schema file.
+
+
+
+
+
\ No newline at end of file
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore.csproj b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore.csproj
new file mode 100644
index 000000000..babc34cd0
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore.csproj
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+ false
+ net10.0
+ LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/20261007004411_Initial-AI-Service.Designer.cs b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/20261007004411_Initial-AI-Service.Designer.cs
new file mode 100644
index 000000000..4e09aaf44
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/20261007004411_Initial-AI-Service.Designer.cs
@@ -0,0 +1,383 @@
+//
+using System;
+using LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Volo.Abp.EntityFrameworkCore;
+
+#nullable disable
+
+namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore.Migrations
+{
+ [DbContext(typeof(AIServiceMigrationsDbContext))]
+ [Migration("20261007004411_Initial-AI-Service")]
+ partial class InitialAIService
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
+ .HasAnnotation("ProductVersion", "10.0.9")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
+
+ modelBuilder.Entity("LINGYUN.Abp.AIManagement.Chats.ConversationRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("ExpiredAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)");
+
+ b.Property("TenantId")
+ .HasColumnType("char(36)")
+ .HasColumnName("TenantId");
+
+ b.Property("UpdateAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Workspace")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.HasKey("Id");
+
+ b.ToTable("AbpAIConversations", (string)null);
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.AIManagement.Chats.TextChatMessageRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("varchar(1024)");
+
+ b.Property("ConversationId")
+ .HasColumnType("char(36)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("ExtraProperties")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("ReplyAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ReplyMessage")
+ .HasColumnType("longtext");
+
+ b.Property("Role")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)");
+
+ b.Property("TenantId")
+ .HasColumnType("char(36)")
+ .HasColumnName("TenantId");
+
+ b.Property("UserId")
+ .HasColumnType("char(36)");
+
+ b.Property("Workspace")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "ConversationId");
+
+ b.ToTable("AbpAITextChatMessages", (string)null);
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.AIManagement.Tokens.TokenUsageRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("CachedInputTokenCount")
+ .HasColumnType("bigint");
+
+ b.Property("ConversationId")
+ .HasColumnType("char(36)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("InputTokenCount")
+ .HasColumnType("bigint");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("MessageId")
+ .HasColumnType("char(36)");
+
+ b.Property("OutputTokenCount")
+ .HasColumnType("bigint");
+
+ b.Property("ReasoningTokenCount")
+ .HasColumnType("bigint");
+
+ b.Property("TenantId")
+ .HasColumnType("char(36)")
+ .HasColumnName("TenantId");
+
+ b.Property("TotalTokenCount")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "ConversationId");
+
+ b.ToTable("AbpAITokenUsages", (string)null);
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.AIManagement.Tools.AIToolDefinitionRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("Description")
+ .HasMaxLength(1024)
+ .HasColumnType("varchar(1024)");
+
+ b.Property("ExtraProperties")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsEnabled")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsGlobal")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsSystem")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("Provider")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)");
+
+ b.Property("StateCheckers")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name")
+ .IsUnique();
+
+ b.ToTable("AbpAIAIToolDefinitionRecords", (string)null);
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.AIManagement.Workspaces.WorkspaceDefinitionRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("ApiBaseUrl")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ApiKey")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("Description")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ExtraProperties")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("FrequencyPenalty")
+ .HasColumnType("float");
+
+ b.Property("Instructions")
+ .HasMaxLength(512)
+ .HasColumnType("varchar(512)");
+
+ b.Property("IsEnabled")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsSystem")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("MaxOutputTokens")
+ .HasColumnType("int");
+
+ b.Property("ModelName")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("PresencePenalty")
+ .HasColumnType("float");
+
+ b.Property("Provider")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)");
+
+ b.Property("StateCheckers")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)");
+
+ b.Property("SystemPrompt")
+ .HasMaxLength(512)
+ .HasColumnType("varchar(512)");
+
+ b.Property("Temperature")
+ .HasColumnType("float");
+
+ b.Property("Tools")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name")
+ .IsUnique();
+
+ b.ToTable("AbpAIWorkspaceDefinitions", (string)null);
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/20261007004411_Initial-AI-Service.cs b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/20261007004411_Initial-AI-Service.cs
new file mode 100644
index 000000000..10652875c
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/20261007004411_Initial-AI-Service.cs
@@ -0,0 +1,219 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore.Migrations
+{
+ ///
+ public partial class InitialAIService : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AlterDatabase()
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "AbpAIAIToolDefinitionRecords",
+ columns: table => new
+ {
+ Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
+ Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ Provider = table.Column(type: "varchar(20)", maxLength: 20, nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ Description = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ IsEnabled = table.Column(type: "tinyint(1)", nullable: false),
+ IsSystem = table.Column(type: "tinyint(1)", nullable: false),
+ IsGlobal = table.Column(type: "tinyint(1)", nullable: false),
+ StateCheckers = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ ExtraProperties = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ CreationTime = table.Column(type: "datetime(6)", nullable: false),
+ CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
+ LastModificationTime = table.Column(type: "datetime(6)", nullable: true),
+ LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AbpAIAIToolDefinitionRecords", x => x.Id);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "AbpAIConversations",
+ columns: table => new
+ {
+ Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
+ TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
+ Name = table.Column(type: "varchar(50)", maxLength: 50, nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ Workspace = table.Column(type: "varchar(64)", maxLength: 64, nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ CreatedAt = table.Column(type: "datetime(6)", nullable: false),
+ ExpiredAt = table.Column(type: "datetime(6)", nullable: false),
+ UpdateAt = table.Column(type: "datetime(6)", nullable: true),
+ CreationTime = table.Column(type: "datetime(6)", nullable: false),
+ CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
+ LastModificationTime = table.Column(type: "datetime(6)", nullable: true),
+ LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AbpAIConversations", x => x.Id);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "AbpAITextChatMessages",
+ columns: table => new
+ {
+ Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
+ Content = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ ExtraProperties = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ CreationTime = table.Column(type: "datetime(6)", nullable: false),
+ CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
+ LastModificationTime = table.Column(type: "datetime(6)", nullable: true),
+ LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
+ TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
+ Workspace = table.Column(type: "varchar(64)", maxLength: 64, nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ Role = table.Column(type: "varchar(20)", maxLength: 20, nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ CreatedAt = table.Column(type: "datetime(6)", nullable: false),
+ UserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
+ ConversationId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
+ ReplyMessage = table.Column(type: "longtext", nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ ReplyAt = table.Column(type: "datetime(6)", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AbpAITextChatMessages", x => x.Id);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "AbpAITokenUsages",
+ columns: table => new
+ {
+ Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
+ TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
+ MessageId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
+ ConversationId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
+ InputTokenCount = table.Column(type: "bigint", nullable: true),
+ OutputTokenCount = table.Column(type: "bigint", nullable: true),
+ TotalTokenCount = table.Column(type: "bigint", nullable: true),
+ CachedInputTokenCount = table.Column(type: "bigint", nullable: true),
+ ReasoningTokenCount = table.Column(type: "bigint", nullable: true),
+ CreationTime = table.Column(type: "datetime(6)", nullable: false),
+ CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
+ LastModificationTime = table.Column(type: "datetime(6)", nullable: true),
+ LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AbpAITokenUsages", x => x.Id);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateTable(
+ name: "AbpAIWorkspaceDefinitions",
+ columns: table => new
+ {
+ Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
+ Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ Provider = table.Column(type: "varchar(20)", maxLength: 20, nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ ModelName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ DisplayName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ Description = table.Column(type: "varchar(128)", maxLength: 128, nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ ApiKey = table.Column(type: "varchar(64)", maxLength: 64, nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ ApiBaseUrl = table.Column(type: "varchar(128)", maxLength: 128, nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ SystemPrompt = table.Column(type: "varchar(512)", maxLength: 512, nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ Instructions = table.Column(type: "varchar(512)", maxLength: 512, nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ Temperature = table.Column(type: "float", nullable: true),
+ MaxOutputTokens = table.Column(type: "int", nullable: true),
+ FrequencyPenalty = table.Column(type: "float", nullable: true),
+ PresencePenalty = table.Column(type: "float", nullable: true),
+ IsEnabled = table.Column(type: "tinyint(1)", nullable: false),
+ IsSystem = table.Column(type: "tinyint(1)", nullable: false),
+ Tools = table.Column(type: "varchar(128)", maxLength: 128, nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ StateCheckers = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ ExtraProperties = table.Column(type: "longtext", nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false)
+ .Annotation("MySql:CharSet", "utf8mb4"),
+ CreationTime = table.Column(type: "datetime(6)", nullable: false),
+ CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
+ LastModificationTime = table.Column(type: "datetime(6)", nullable: true),
+ LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AbpAIWorkspaceDefinitions", x => x.Id);
+ })
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpAIAIToolDefinitionRecords_Name",
+ table: "AbpAIAIToolDefinitionRecords",
+ column: "Name",
+ unique: true);
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpAITextChatMessages_TenantId_ConversationId",
+ table: "AbpAITextChatMessages",
+ columns: new[] { "TenantId", "ConversationId" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpAITokenUsages_TenantId_ConversationId",
+ table: "AbpAITokenUsages",
+ columns: new[] { "TenantId", "ConversationId" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AbpAIWorkspaceDefinitions_Name",
+ table: "AbpAIWorkspaceDefinitions",
+ column: "Name",
+ unique: true);
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "AbpAIAIToolDefinitionRecords");
+
+ migrationBuilder.DropTable(
+ name: "AbpAIConversations");
+
+ migrationBuilder.DropTable(
+ name: "AbpAITextChatMessages");
+
+ migrationBuilder.DropTable(
+ name: "AbpAITokenUsages");
+
+ migrationBuilder.DropTable(
+ name: "AbpAIWorkspaceDefinitions");
+ }
+ }
+}
diff --git a/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/AIServiceMigrationsDbContextModelSnapshot.cs b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/AIServiceMigrationsDbContextModelSnapshot.cs
new file mode 100644
index 000000000..fae89d279
--- /dev/null
+++ b/aspnet-core/migrations/LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore/Migrations/AIServiceMigrationsDbContextModelSnapshot.cs
@@ -0,0 +1,380 @@
+//
+using System;
+using LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Volo.Abp.EntityFrameworkCore;
+
+#nullable disable
+
+namespace LINGYUN.Abp.MicroService.AIService.EntityFrameworkCore.Migrations
+{
+ [DbContext(typeof(AIServiceMigrationsDbContext))]
+ partial class AIServiceMigrationsDbContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
+ .HasAnnotation("ProductVersion", "10.0.9")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
+
+ modelBuilder.Entity("LINGYUN.Abp.AIManagement.Chats.ConversationRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("ExpiredAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)");
+
+ b.Property("TenantId")
+ .HasColumnType("char(36)")
+ .HasColumnName("TenantId");
+
+ b.Property("UpdateAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Workspace")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.HasKey("Id");
+
+ b.ToTable("AbpAIConversations", (string)null);
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.AIManagement.Chats.TextChatMessageRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("varchar(1024)");
+
+ b.Property("ConversationId")
+ .HasColumnType("char(36)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("ExtraProperties")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("ReplyAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ReplyMessage")
+ .HasColumnType("longtext");
+
+ b.Property("Role")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)");
+
+ b.Property("TenantId")
+ .HasColumnType("char(36)")
+ .HasColumnName("TenantId");
+
+ b.Property("UserId")
+ .HasColumnType("char(36)");
+
+ b.Property("Workspace")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "ConversationId");
+
+ b.ToTable("AbpAITextChatMessages", (string)null);
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.AIManagement.Tokens.TokenUsageRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("CachedInputTokenCount")
+ .HasColumnType("bigint");
+
+ b.Property("ConversationId")
+ .HasColumnType("char(36)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("InputTokenCount")
+ .HasColumnType("bigint");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("MessageId")
+ .HasColumnType("char(36)");
+
+ b.Property("OutputTokenCount")
+ .HasColumnType("bigint");
+
+ b.Property("ReasoningTokenCount")
+ .HasColumnType("bigint");
+
+ b.Property("TenantId")
+ .HasColumnType("char(36)")
+ .HasColumnName("TenantId");
+
+ b.Property("TotalTokenCount")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "ConversationId");
+
+ b.ToTable("AbpAITokenUsages", (string)null);
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.AIManagement.Tools.AIToolDefinitionRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("Description")
+ .HasMaxLength(1024)
+ .HasColumnType("varchar(1024)");
+
+ b.Property("ExtraProperties")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsEnabled")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsGlobal")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsSystem")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("Provider")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)");
+
+ b.Property("StateCheckers")
+ .HasMaxLength(256)
+ .HasColumnType("varchar(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name")
+ .IsUnique();
+
+ b.ToTable("AbpAIAIToolDefinitionRecords", (string)null);
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.AIManagement.Workspaces.WorkspaceDefinitionRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("char(36)");
+
+ b.Property("ApiBaseUrl")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ApiKey")
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)")
+ .HasColumnName("CreatorId");
+
+ b.Property("Description")
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("varchar(128)");
+
+ b.Property("ExtraProperties")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("FrequencyPenalty")
+ .HasColumnType("float");
+
+ b.Property("Instructions")
+ .HasMaxLength(512)
+ .HasColumnType("varchar(512)");
+
+ b.Property("IsEnabled")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsSystem")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)")
+ .HasColumnName("LastModifierId");
+
+ b.Property("MaxOutputTokens")
+ .HasColumnType("int");
+
+ b.Property("ModelName")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("varchar(64)");
+
+ b.Property("PresencePenalty")
+ .HasColumnType("float");
+
+ b.Property