Browse Source

📚 docs: 更新文档,添加 labp CLI 工具安装和项目创建的说明。

 feat: 添加 labp CLI 工具的安装命令和项目创建示例。
📝 update: 更新 README 文件,调整结构并补充 CLI 快速启动指南。
pull/1067/head^2^2
feijie 1 year ago
parent
commit
f7bea60845
  1. 10
      aspnet-core/templates/aio/content/README.md
  2. 14
      aspnet-core/templates/aio/content/README.zh-CN.md
  3. 81
      docs/startup-aio-readme.en.md
  4. 88
      docs/startup-aio-readme.md

10
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 ## How to Use
### Install labp CLI Tool
```bash
dotnet tool install --global LINGYUN.Abp.Cli
```
### Install Templates ### Install Templates
```bash ```bash
@ -49,14 +55,14 @@ dotnet new install LINGYUN.Abp.AllInOne.Templates
```bash ```bash
# Short name: lam (LINGYUN Abp Microservice) # 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 #### For All-in-One Project
```bash ```bash
# Short name: laa (LINGYUN Abp AllInOne) # 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 ## How to Run

14
aspnet-core/templates/aio/content/README.zh-CN.md

@ -36,27 +36,33 @@ LINGYUN.Abp.Templates 基于 ABP Framework 提供两种项目模板:
### 安装模板 ### 安装模板
```bash ```bash
# 安装微服务模板 # 安装微服务模板:lam
dotnet new install LINGYUN.Abp.MicroService.Templates dotnet new install LINGYUN.Abp.MicroService.Templates
# 安装单体应用模板 # 安装单体应用模板:laa
dotnet new install LINGYUN.Abp.AllInOne.Templates dotnet new install LINGYUN.Abp.AllInOne.Templates
``` ```
### 安装 labp 命令行工具
```bash
dotnet tool install --global LINGYUN.Abp.Cli
```
### 创建新项目 ### 创建新项目
#### 创建微服务项目 #### 创建微服务项目
```bash ```bash
# 简写名称:lam (LINGYUN Abp Microservice) # 简写名称: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 ```bash
# 简写名称:laa (LINGYUN Abp AllInOne) # 简写名称: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
``` ```
## 运行项目 ## 运行项目

81
docs/startup-aio-readme.en.md

@ -4,16 +4,69 @@ English | [简体中文](startup-aio-readme.md)
## Table of Contents ## Table of Contents
- [Requirements](#requirements) - [Quick Start with CLI](#quick-start-with-cli)
- [Project Compilation](#project-compilation) - [Requirements](#cli-requirements)
- [Environment Configuration](#environment-configuration) - [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) - [Required Configuration](#required-configuration)
- [Optional Configuration](#optional-configuration) - [Optional Configuration](#optional-configuration)
- [Database Initialization](#database-initialization) - [Database Initialization](#database-initialization)
- [Service Startup](#service-startup) - [Service Startup](#service-startup)
- [Configuration Details](#configuration-details) - [Configuration Details](#configuration-details)
- [Common Issues](#common-issues)
## Requirements ## Quick Start with CLI
### CLI 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 - .NET 8.0 SDK
- Database (support any of the following): - Database (support any of the following):
@ -23,7 +76,7 @@ English | [简体中文](startup-aio-readme.md)
- Redis - Redis
- Docker (optional) - Docker (optional)
## Project Compilation ### Project Compilation
1. Ensure .NET 8.0 SDK is installed 1. Ensure .NET 8.0 SDK is installed
2. Execute the following command in the project root directory to compile the entire project: 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 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 #### 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: 1. Run database migration script:
@ -210,15 +263,15 @@ Taking PostgreSQL as an example:
- Run the `LY.MicroService.Applications.Single.DbMigrator` project - Run the `LY.MicroService.Applications.Single.DbMigrator` project
- Wait for migration to complete, basic table data will be initialized - Wait for migration to complete, basic table data will be initialized
## Service Startup ### Service Startup
1. Run the `LY.MicroService.Applications.Single` project 1. Run the `LY.MicroService.Applications.Single` project
2. Access Swagger API documentation in your browser: 2. Access Swagger API documentation in your browser:
- URL: http://127.0.0.1:30000/swagger - URL: http://127.0.0.1:30000/swagger
## Configuration Details ### Configuration Details
### 1. Basic Configuration #### 1. Basic Configuration
#### Application Configuration #### Application Configuration

88
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 - .NET 8.0 SDK
- 数据库(支持以下任一种): - 数据库(支持以下任一种):
@ -23,7 +77,7 @@
- Redis - Redis
- Docker(可选) - Docker(可选)
## 项目编译 ### 项目编译
1. 确保已安装 .NET 8.0 SDK 1. 确保已安装 .NET 8.0 SDK
2. 在项目根目录执行以下命令编译整个项目: 2. 在项目根目录执行以下命令编译整个项目:
@ -34,9 +88,9 @@
3. 使用 IDE 打开 `LY.MicroService.Applications.Single` 解决方案进行调试或发布 3. 使用 IDE 打开 `LY.MicroService.Applications.Single` 解决方案进行调试或发布
## 环境配置 ### 环境配置
### 必选配置 #### 必选配置
#### 1. 数据库配置 #### 1. 数据库配置
@ -181,7 +235,7 @@ Redis 配置示例:
} }
``` ```
## 数据库初始化 ### 数据库初始化
1. 运行数据库迁移脚本: 1. 运行数据库迁移脚本:
@ -210,15 +264,15 @@ Redis 配置示例:
- 运行 `LY.MicroService.Applications.Single.DbMigrator` 项目 - 运行 `LY.MicroService.Applications.Single.DbMigrator` 项目
- 等待数据迁移完成,基础表数据将被初始化 - 等待数据迁移完成,基础表数据将被初始化
## 服务启动 ### 服务启动
1. 运行 `LY.MicroService.Applications.Single` 项目 1. 运行 `LY.MicroService.Applications.Single` 项目
2. 在浏览器中访问 Swagger 接口文档: 2. 在浏览器中访问 Swagger 接口文档:
- URL: http://127.0.0.1:30000/swagger - URL: http://127.0.0.1:30000/swagger
## 配置说明 ### 配置说明
### 1. 基础配置 #### 基础配置
#### 应用程序配置 #### 应用程序配置
@ -247,7 +301,7 @@ Redis 配置示例:
} }
``` ```
### 2. 认证配置 ### 认证配置
#### OpenIddict 配置 #### OpenIddict 配置
@ -294,7 +348,7 @@ Redis 配置示例:
} }
``` ```
### 3. 功能开关配置 ### 功能开关配置
```json ```json
{ {
@ -310,7 +364,7 @@ Redis 配置示例:
} }
``` ```
### 4. 日志配置 ### 日志配置
```json ```json
{ {

Loading…
Cancel
Save