mirror of https://github.com/abpframework/abp.git
committed by
GitHub
14 changed files with 464 additions and 430 deletions
@ -1,23 +1,24 @@ |
|||
## Background Jobs |
|||
## 后台作业 |
|||
|
|||
### Introduction |
|||
### 介绍 |
|||
|
|||
Background jobs are used to queue some tasks to be executed in the background. You may need background jobs for several reasons. Here are some examples: |
|||
后台作业用来在后台里执行应用里的一些任务, 出于几个原因, 你可能需要后台工作, 以下是一些例子: |
|||
|
|||
- To perform **long-running tasks** without having the users wait. For example, a user presses a 'report' button to start a long-running reporting job. You add this job to the **queue** and send the report's result to your user via email when it's completed. |
|||
- To create **re-trying** and **persistent tasks** to **guarantee** that a code will be **successfully executed**. For example, you can send emails in a background job to overcome **temporary failures** and **guarantee** that it eventually will be sent. That way users do not wait while sending emails. |
|||
- 为执行**长时间运行的任务**而用户无需等待, 例如:用户按了一下"报告"按钮开始一个长时间运行的报告任务, 你把这个任务添加到**队列**里,并在完成后通过电子邮件将报告的结果发送给你的用户. |
|||
- 创建**可重试**和**持久的任务**以**确保**代码将**成功执行**. 例如, 你可以在后台作业中发送电子邮件以克服**临时故障**并**保证**最终发送. 这样用户不需要在发送电子邮件时等待. |
|||
|
|||
Background jobs are **persistent** that means they will be **re-tried** and **executed** later even if your application crashes. |
|||
后台作业是**持久性的**这意味着即使你的应用程序崩溃了, 后台左右也会在稍后**重试**并**执行**. |
|||
|
|||
ABP provides an **abstraction** module and **several implementations** for background jobs. It has a built-in/default implementation as well as Hangfire and RabbitMQ integrations. |
|||
ABP为后台作业提供了一个**抽象**模块和几个后台作业**实现**. 它具有内置/默认的实现以及与Hangfire和RabbitMQ的集成. |
|||
|
|||
### Abstraction Module |
|||
### 抽象模块 |
|||
|
|||
TODO |
|||
待添加 |
|||
|
|||
### Creating a Background Job |
|||
### 创建后台作业 |
|||
|
|||
A background job is a class that implements the `IBackgroundJob<TArgs>` interface or derives from the `BackgroundJob<TArgs>` class. `TArgs` is a simple plain C# class to store the job data. |
|||
后台作业是一个实现`IBackgroundJob<TArgs>`接口或继承自`BackgroundJob<TArgs>`类的类.`TArgs`是一个简单的C#类, 用于存储作业数据. |
|||
|
|||
An example background job to send emails in background: |
|||
在后台发送电子邮件的后台作业例子: |
|||
|
|||
待添加 |
|||
@ -1,7 +1,7 @@ |
|||
## Data Transfer Objects Best Practices & Conventions |
|||
## 数据传输对象最佳实践&约定 |
|||
|
|||
* **Do** define DTOs in the **application contracts** package. |
|||
* **Do** inherit from the pre-built **base DTO classes** where possible and necessary (like `EntityDto<TKey>`, `CreationAuditedEntityDto<TKey>`, `AuditedEntityDto<TKey>`, `FullAuditedEntityDto<TKey>` and so on). |
|||
* **Do** define DTO members with **public getter and setter**. |
|||
* **Do** use **data annotations** for **validation** on the properties of DTOs those are inputs of the service. |
|||
* **Do** not add any **logic** into DTOs except implementing `IValidatableObject` when necessary. |
|||
* **推荐** 在 **application.contracts** 层中定义DTO. |
|||
* **推荐** 在可能和必要的情况下从预构建的 **基础DTO类** 继承 (如 `EntityDto<TKey>`, `CreationAuditedEntityDto<TKey>`, `AuditedEntityDto<TKey>`, `FullAuditedEntityDto<TKey>` 等). |
|||
* **推荐** 定义 **public getter 和 setter** 的DTO成员 . |
|||
* **推荐** 使用 **data annotations** **验证** service输入DTO的属性. |
|||
* **不推荐** 在DTO中添加任何 **逻辑**, 在必要的时候可以实现 `IValidatableObject` 接口. |
|||
@ -1,27 +1,26 @@ |
|||
## Module Development Best Practices & Conventions |
|||
## 模块开发最佳实践 & 约定 |
|||
|
|||
### Introduction |
|||
### 介绍 |
|||
|
|||
This document describes the **best practices** and **conventions** for those who want to develop **modules** that satisfy the following specifications: |
|||
这篇文档描述了想要满足以下规范的**模块**的**最佳实践**与**约定**: |
|||
|
|||
* Develop modules that conform to the **Domain Driven Design** patterns & best practices. |
|||
* Develop modules with **DBMS and ORM independence**. |
|||
* Develop modules that can be used as a **remote service / microservice** as well as being compatible with a **monolithic** application. |
|||
* 开发应用**领域驱动设计**模式的最佳实践的模块. |
|||
* 开发 **DBMS 与 ORM 独立** 的模块. |
|||
* 开发可用作 **远程服务 / 微服务** 的模块, 并可以集成到 **单体** 应用程序中. |
|||
|
|||
Also, this guide is mostly usable for general **application development**. |
|||
本指南主要用于 **应用程序** 开发. |
|||
|
|||
### Guides |
|||
|
|||
* Overall |
|||
* [Module Architecture](Module-Architecture.md) |
|||
* Domain Layer |
|||
* [Entities](Entities.md) |
|||
* [Repositories](Repositories.md) |
|||
* [Domain Services](Domain-Services.md) |
|||
* Application Layer |
|||
* [Application Services](Application-Services.md) |
|||
* [Data Transfer Objects](Data-Transfer-Objects.md) |
|||
* Data Access |
|||
* [Entity Framework Core Integration](Entity-Framework-Core-Integration.md) |
|||
* [MongoDB Integration](MongoDB-Integration.md) |
|||
### 指南 |
|||
|
|||
* 总体 |
|||
* [模块架构](Module-Architecture.md) |
|||
* 领域层 |
|||
* [实体](Entities.md) |
|||
* [仓储](Repositories.md) |
|||
* [领域服务](Domain-Services.md) |
|||
* 应用程序层 |
|||
* [应用程序服务](Application-Services.md) |
|||
* [数据传输对象](Data-Transfer-Objects.md) |
|||
* 数据访问 |
|||
* [Entity Framework Core 集成](Entity-Framework-Core-Integration.md) |
|||
* [MongoDB 集成](MongoDB-Integration.md) |
|||
@ -1,52 +1,52 @@ |
|||
## Contribution Guide |
|||
## 贡献指南 |
|||
|
|||
ABP is an [open source](https://github.com/abpframework) and community driven project. This guide is aims to help anyone wants to contribute to the project. |
|||
ABP是[开源](https://github.com/abpframework)和社区驱动项目. 本指南旨在帮助任何想要为项目做出贡献的人. |
|||
|
|||
### Code Contribution |
|||
### 贡献代码 |
|||
|
|||
You can always send pull requests to the Github repository. |
|||
你可以将Pull request(拉取请求)发送到Github存储库. |
|||
|
|||
- Clone the [ABP repository](https://github.com/abpframework/abp/) from Github. |
|||
- Make the required changes. |
|||
- Send a pull request. |
|||
- 从Github克隆[ABP存储库](https://github.com/abpframework/abp/). |
|||
- 进行必要的更改. |
|||
- 发送Pull request(拉取请求). |
|||
|
|||
Before making any change, please discuss it on the [Github issues](https://github.com/abpframework/abp/issues). In this way, no other developer will work on the same issue and your PR will have a better chance to be accepted. |
|||
在进行任何更改之前,请在[Github问题](https://github.com/abpframework/abp/issues)上进行讨论. 通过这种方式, 其他开发人员将不会处理同一个问题, 你的PR将有更好的机会被接受. |
|||
|
|||
#### Bug Fixes & Enhancements |
|||
#### Bug修复 & 增强功能 |
|||
|
|||
You may want to fix a known bug or work on a planned enhancement. See [the issue list](https://github.com/abpframework/abp/issues) on Github. |
|||
你可能希望修复已知Bug或处理计划的增强功能. 请参阅Github上的[问题列表](https://github.com/abpframework/abp/issues). |
|||
|
|||
#### Feature Requests |
|||
#### 功能请求 |
|||
|
|||
If you have a feature idea for the framework or modules, [create an issue](https://github.com/abpframework/abp/issues/new) on Github or attend to an existing discussion. Then you can implement it if it's embraced by the community. |
|||
如果你对框架或模块有功能的想法, 请在Github上[创建一个问题](https://github.com/abpframework/abp/issues/new)或参加现有的讨论. 如果它被社区所接受你就可以实现它. |
|||
|
|||
### Document Translation |
|||
### 文件翻译 |
|||
|
|||
You may want to translate the complete [documentation](https://abp.io/documents/) (including this one) to your mother language. If so, follow these steps: |
|||
你可能希望将完整的[文档](https://abp.io/documents/)(包括本文)翻译成你的母语. 请按照下列步骤操作: |
|||
|
|||
* Clone the [ABP repository](https://github.com/abpframework/abp/) from Github. |
|||
* To add a new language, create a new folder inside the [docs](https://github.com/abpframework/abp/tree/master/docs) folder. Folder names can be "en", "es", "fr", "tr" and so on based on the language (see [all culture codes](https://msdn.microsoft.com/en-us/library/hh441729.aspx)). |
|||
* Get the ["en" folder](https://github.com/abpframework/abp/tree/master/docs/en) as a reference for the file names and folder structure. Keep the same naming if you are translating the same documentation. |
|||
* Send a pull request (PR) once you translate any document. Please translate documents & send PRs one by one. Don't wait to finish translations for all documents. |
|||
* 从Github克隆[ABP存储库](https://github.com/abpframework/abp/). |
|||
* 要添加新语言,请在[docs](https://github.com/abpframework/abp/tree/master/docs)文件夹中创建一个新文件夹. 文件夹名称可以是" en","es","fr","tr"等(参见[所有文化代码](https://msdn.microsoft.com/en-us/library/hh441729.aspx)). |
|||
* 获取["en"文件夹](https://github.com/abpframework/abp/tree/master/docs/en)作为文件名和文件夹结构的参考. 如果要翻译相同的文档, 请保持相同的命名. |
|||
* 翻译任何文档后发送拉取请求(PR). 请翻译文件后及时发送PR. 不要等到完成所有文件的翻译. |
|||
|
|||
### Resource Localization |
|||
### 资源本地化 |
|||
|
|||
ABP framework has a flexible [localization system](https://abp.io/documents/abp/latest/Localization). You can create localized user interfaces for your own application. |
|||
ABP框架具有灵活的[本地化系统](https://abp.io/documents/abp/latest/Localization). 你可以为自己的应用程序创建本地化用户界面. |
|||
|
|||
In addition to that, the framework and pre-build modules have already localized texts. As an example, see [the localization texts for the Volo.Abp.UI package](https://github.com/abpframework/abp/blob/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json). You can create a new file in the [same folder](https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi) to translate it. |
|||
除此之外,框架和预构建模块已经本地化了文本.请参阅[Volo.Abp.UI包的本地化文本](https://github.com/abpframework/abp/blob/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json).你可以在[相同文件夹](https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi)中创建一个新文件进行翻译. |
|||
|
|||
* Clone the [ABP repository](https://github.com/abpframework/abp/) from Github. |
|||
* Create a new file for the target language for a localization text (json) file (near to the en.json file). |
|||
* Copy all texts from the en.json file. |
|||
* Translate the texts. |
|||
* Send pull request on Github. |
|||
* 从Github克隆[ABP存储库](https://github.com/abpframework/abp/). |
|||
* 为本地化文本(json)文件(en.json文件同目录下)创建目标语言的新文件. |
|||
* 复制en.json文件中的所有文本. |
|||
* 翻译文本. |
|||
* 在Github上发送拉取请求(Pull request). |
|||
|
|||
ABP is a modular framework. So there are many localization text resource, one per module. To find all .json files, you can search for "en.json" after cloning the repository. You can also check [this list](Localization-Text-Files.md) for a list of localization text files. |
|||
ABP是一个模块化框架. 所以有很多本地化文本资源, 每个模块都有一个. 要查找所有.json文件,可以在克隆存储库后搜索"en.json". 你还可以检查[此列表](Localization-Text-Files.md)以获取本地化文本文件列表. |
|||
|
|||
### Blog Posts & Tutorials |
|||
### 博客文章和教程 |
|||
|
|||
If you decide to create some tutorials or blog posts on ABP, please inform us (by creating a [Github issue](https://github.com/abpframework/abp/issues)), so we may add a link to your tutorial/post in the official documentation and we can announce it on our [Twitter account](https://twitter.com/abpframework). |
|||
如果你发布了一些ABP框架的教程或博客帖子, 请通知我们(通过创建[Github问题](https://github.com/abpframework/abp/issues)), 我们可能会在官方文档中添加指向你的教程或博客帖子的链接和在[推特](https://twitter.com/abpframework)上公布. |
|||
|
|||
### Bug Report |
|||
### Bug 报告 |
|||
|
|||
If you find any bug, please [create an issue on the Github repository](https://github.com/abpframework/abp/issues/new). |
|||
如果你发现任何Bug, 请[在Github存储库上创建一个问题](https://github.com/abpframework/abp/issues/new). |
|||
@ -1,3 +1,3 @@ |
|||
## ABP Tag Helpers |
|||
|
|||
"ABP tag helpers" is not documented yet. You can see a [demo of components](http://bootstrap-taghelpers.abp.io/) for now. |
|||
"ABP tag helpers" 目前还没有文档. 你现在可以看到[组件演示](http://bootstrap-taghelpers.abp.io/). |
|||
Loading…
Reference in new issue