diff --git a/aspnet-core/templates/aio/content/README.md b/aspnet-core/templates/aio/content/README.md index 7b7520aef..7d7b52ed3 100644 --- a/aspnet-core/templates/aio/content/README.md +++ b/aspnet-core/templates/aio/content/README.md @@ -33,6 +33,12 @@ LINGYUN.Abp.Templates provides two types of project templates based on ABP Frame ## How to Use +### Install labp CLI Tool + +```bash +dotnet tool install --global LINGYUN.Abp.Cli +``` + ### Install Templates ```bash @@ -49,14 +55,14 @@ dotnet new install LINGYUN.Abp.AllInOne.Templates ```bash # Short name: lam (LINGYUN Abp Microservice) -dotnet new lam -n YourCompanyName.YourProjectName -pk YourPackageName -o /path/to/output --dbms MySql --cs "Server=127.0.0.1;Database=YourDatabase;User Id=your_user;Password=your_password;SslMode=None" --no-random-port +labp create YourCompanyName.YourProjectName -pk YourPackageName -t lam -o /path/to/output --dbms MySql --cs "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None" --no-random-port ``` #### For All-in-One Project ```bash # Short name: laa (LINGYUN Abp AllInOne) -dotnet new laa -n YourCompanyName.YourProjectName -pk YourPackageName -o /path/to/output --dbms MySql --cs "Server=127.0.0.1;Database=YourDatabase;User Id=your_user;Password=your_password;SslMode=None" --no-random-port +labp create YourCompanyName.YourProjectName -pk YourPackageName -t laa -o /path/to/output --dbms MySql --cs "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None" --no-random-port ``` ## How to Run diff --git a/aspnet-core/templates/aio/content/README.zh-CN.md b/aspnet-core/templates/aio/content/README.zh-CN.md index b93d76220..ae492e5b8 100644 --- a/aspnet-core/templates/aio/content/README.zh-CN.md +++ b/aspnet-core/templates/aio/content/README.zh-CN.md @@ -36,27 +36,33 @@ LINGYUN.Abp.Templates 基于 ABP Framework 提供两种项目模板: ### 安装模板 ```bash -# 安装微服务模板 +# 安装微服务模板:lam dotnet new install LINGYUN.Abp.MicroService.Templates -# 安装单体应用模板 +# 安装单体应用模板:laa dotnet new install LINGYUN.Abp.AllInOne.Templates ``` +### 安装 labp 命令行工具 + +```bash + dotnet tool install --global LINGYUN.Abp.Cli +``` + ### 创建新项目 #### 创建微服务项目 ```bash # 简写名称:lam (LINGYUN Abp Microservice) -dotnet new lam -n YourCompanyName.YourProjectName -pk YourPackageName -o /path/to/output --dbms MySql --cs "Server=127.0.0.1;Database=YourDatabase;User Id=your_user;Password=your_password;SslMode=None" --no-random-port +labp create YourCompanyName.YourProjectName -pk YourPackageName -t lam -o /path/to/output --dbms MySql --cs "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None" --no-random-port ``` #### 创建单体应用项目 ```bash # 简写名称:laa (LINGYUN Abp AllInOne) -labp create MyCompanyName.MyProjectName -pk MyPackageName -t laa -o /Users/feijie/Projects/Tests --dbms MySql --cs "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None" --no-random-port +labp create YourCompanyName.YourProjectName -pk YourPackageName -t laa -o /path/to/output --dbms MySql --cs "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None" --no-random-port ``` ## 运行项目 diff --git a/docs/startup-aio-readme.en.md b/docs/startup-aio-readme.en.md index baa9bb741..6a3871599 100644 --- a/docs/startup-aio-readme.en.md +++ b/docs/startup-aio-readme.en.md @@ -4,16 +4,69 @@ English | [简体中文](startup-aio-readme.md) ## Table of Contents -- [Requirements](#requirements) -- [Project Compilation](#project-compilation) -- [Environment Configuration](#environment-configuration) - - [Required Configuration](#required-configuration) - - [Optional Configuration](#optional-configuration) -- [Database Initialization](#database-initialization) -- [Service Startup](#service-startup) -- [Configuration Details](#configuration-details) +- [Quick Start with CLI](#quick-start-with-cli) + - [Requirements](#cli-requirements) + - [Install CLI Tool](#install-cli-tool) + - [Create Project](#create-project) + - [Run Project](#run-project) +- [Source Code Startup](#source-code-startup) + - [Requirements](#requirements) + - [Project Compilation](#project-compilation) + - [Environment Configuration](#environment-configuration) + - [Required Configuration](#required-configuration) + - [Optional Configuration](#optional-configuration) + - [Database Initialization](#database-initialization) + - [Service Startup](#service-startup) + - [Configuration Details](#configuration-details) +- [Common Issues](#common-issues) + +## Quick Start with CLI + +### CLI Requirements -## Requirements +- .NET 8.0 SDK +- Database (support any of the following): + - MySQL + - SQL Server + - SQLite + - Oracle + - Oracle Devart + - PostgreSQL +- Redis + +### Install CLI Tool + +```bash +dotnet tool install --global LINGYUN.Abp.Cli +``` + +### Create Project + +```bash +# Short name: laa (LINGYUN Abp AllInOne) +labp create YourCompanyName.YourProjectName -pk YourPackageName -t laa -o /path/to/output --dbms MySql --cs "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None" --no-random-port +``` + +Parameter Description: +- `-pk` or `--package-name`: Package name +- `-t` or `--template`: Template type, use `laa` for All-in-One template +- `-o` or `--output`: Output directory +- `--dbms`: Database type, supports MySql, SqlServer, Sqlite, Oracle, OracleDevart, PostgreSql +- `--cs`: Database connection string +- `--no-random-port`: Do not use random port + +### Run Project + +After creating the project, navigate to the project directory: + +```bash +cd /path/to/output/host/YourPackageName.YourCompanyName.YourProjectName.AIO.Host +dotnet run --launch-profile "YourPackageName.YourCompanyName.YourProjectName.Development" +``` + +## Source Code Startup + +### Requirements - .NET 8.0 SDK - Database (support any of the following): @@ -23,7 +76,7 @@ English | [简体中文](startup-aio-readme.md) - Redis - Docker (optional) -## Project Compilation +### Project Compilation 1. Ensure .NET 8.0 SDK is installed 2. Execute the following command in the project root directory to compile the entire project: @@ -34,9 +87,9 @@ English | [简体中文](startup-aio-readme.md) 3. Open the `LY.MicroService.Applications.Single` solution in your IDE for debugging or publishing -## Environment Configuration +### Environment Configuration -### Required Configuration +#### Required Configuration #### 1. Database Configuration @@ -181,7 +234,7 @@ The following configurations are applicable for monolithic distributed architect } ``` -## Database Initialization +### Database Initialization 1. Run database migration script: @@ -210,15 +263,15 @@ Taking PostgreSQL as an example: - Run the `LY.MicroService.Applications.Single.DbMigrator` project - Wait for migration to complete, basic table data will be initialized -## Service Startup +### Service Startup 1. Run the `LY.MicroService.Applications.Single` project 2. Access Swagger API documentation in your browser: - URL: http://127.0.0.1:30000/swagger -## Configuration Details +### Configuration Details -### 1. Basic Configuration +#### 1. Basic Configuration #### Application Configuration diff --git a/docs/startup-aio-readme.md b/docs/startup-aio-readme.md index 605585796..bb0c4540d 100644 --- a/docs/startup-aio-readme.md +++ b/docs/startup-aio-readme.md @@ -4,16 +4,70 @@ ## 目录 -- [环境要求](#环境要求) -- [项目编译](#项目编译) -- [环境配置](#环境配置) - - [必选配置](#必选配置) - - [可选配置](#可选配置) -- [数据库初始化](#数据库初始化) -- [服务启动](#服务启动) -- [配置说明](#配置说明) +- [CLI 快速启动](#cli快速启动) + - [环境要求](#cli环境要求) + - [安装命令行工具](#安装命令行工具) + - [创建项目](#创建项目) + - [运行项目](#运行项目) +- [源码启动](#源码启动) + - [环境要求](#环境要求) + - [项目编译](#项目编译) + - [环境配置](#环境配置) + - [必选配置](#必选配置) + - [可选配置](#可选配置) + - [数据库初始化](#数据库初始化) + - [服务启动](#服务启动) + - [配置说明](#配置说明) +- [常见问题](#常见问题) + +## CLI 快速启动 + +### CLI 环境要求 -## 环境要求 +- .NET 8.0 SDK +- 数据库(支持以下任一种): + - MySQL + - SQL Server + - SQLite + - Oracle + - Oracle Devart + - PostgreSQL +- Redis + +### 安装命令行工具 + +```bash +dotnet tool install --global LINGYUN.Abp.Cli +``` + +### 创建项目 + +```bash +# 简写名称:laa (LINGYUN Abp AllInOne) +labp create YourCompanyName.YourProjectName -pk YourPackageName -t laa -o /path/to/output --dbms MySql --cs "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None" --no-random-port +``` + +参数说明: + +- `-pk` 或 `--package-name`: 包名 +- `-t` 或 `--template`: 模板类型,使用 `laa` 表示单体应用模板 +- `-o` 或 `--output`: 输出目录 +- `--dbms`: 数据库类型,支持 MySql、SqlServer、Sqlite、Oracle、OracleDevart、PostgreSql +- `--cs`: 数据库连接字符串 +- `--no-random-port`: 不使用随机端口 + +### 运行项目 + +创建项目后,进入项目目录: + +```bash +cd /path/to/output/host/YourPackageName.YourCompanyName.YourProjectName.AIO.Host +dotnet run --launch-profile "YourPackageName.YourCompanyName.YourProjectName.Development" +``` + +## 源码启动 + +### 环境要求 - .NET 8.0 SDK - 数据库(支持以下任一种): @@ -23,7 +77,7 @@ - Redis - Docker(可选) -## 项目编译 +### 项目编译 1. 确保已安装 .NET 8.0 SDK 2. 在项目根目录执行以下命令编译整个项目: @@ -34,9 +88,9 @@ 3. 使用 IDE 打开 `LY.MicroService.Applications.Single` 解决方案进行调试或发布 -## 环境配置 +### 环境配置 -### 必选配置 +#### 必选配置 #### 1. 数据库配置 @@ -181,7 +235,7 @@ Redis 配置示例: } ``` -## 数据库初始化 +### 数据库初始化 1. 运行数据库迁移脚本: @@ -210,15 +264,15 @@ Redis 配置示例: - 运行 `LY.MicroService.Applications.Single.DbMigrator` 项目 - 等待数据迁移完成,基础表数据将被初始化 -## 服务启动 +### 服务启动 1. 运行 `LY.MicroService.Applications.Single` 项目 2. 在浏览器中访问 Swagger 接口文档: - URL: http://127.0.0.1:30000/swagger -## 配置说明 +### 配置说明 -### 1. 基础配置 +#### 基础配置 #### 应用程序配置 @@ -247,7 +301,7 @@ Redis 配置示例: } ``` -### 2. 认证配置 +### 认证配置 #### OpenIddict 配置 @@ -294,7 +348,7 @@ Redis 配置示例: } ``` -### 3. 功能开关配置 +### 功能开关配置 ```json { @@ -310,7 +364,7 @@ Redis 配置示例: } ``` -### 4. 日志配置 +### 日志配置 ```json {