From 478b653478291470fd597704e0426ed9aa1d2575 Mon Sep 17 00:00:00 2001 From: wizardforcel <562826179@qq.com> Date: Sun, 21 Jun 2020 16:55:52 +0800 Subject: [PATCH] 2020-06-21 16:55:52 --- docs/db/106.md | 10 +++++----- docs/dotnet/148.md | 2 +- docs/dotnet/154.md | 2 +- docs/graph/13.md | 2 -- docs/java/101.md | 2 +- docs/java/3.md | 2 +- docs/java/5.md | 2 +- docs/java/64.md | 6 +++--- docs/java/76.md | 2 +- docs/js/55.md | 2 +- docs/js/73.md | 8 ++++---- docs/php/171.md | 2 +- docs/py/17.md | 2 +- docs/py/22.md | 2 +- docs/py/23.md | 4 ++-- docs/py/24.md | 2 +- docs/py/28.md | 4 ++-- docs/py/56.md | 2 +- docs/py/60.md | 2 +- docs/spring-boot/12.md | 2 +- docs/spring-boot/16.md | 2 +- docs/spring-boot/18.md | 2 +- docs/spring-boot/19.md | 2 +- docs/spring-boot/2.md | 2 +- docs/spring-boot/67.md | 4 ++-- docs/spring-boot/7.md | 2 +- docs/spring/3.md | 2 +- docs/spring/5.md | 2 +- docs/spring/6.md | 2 +- docs/symfony/89.md | 4 ++-- docs/symfony/90.md | 4 ++-- docs/symfony/97.md | 2 +- docs/symfony/98.md | 2 +- 33 files changed, 46 insertions(+), 48 deletions(-) diff --git a/docs/db/106.md b/docs/db/106.md index 2bd68c1..3177aa5 100644 --- a/docs/db/106.md +++ b/docs/db/106.md @@ -56,7 +56,7 @@ $ npm i mongodb ``` -我们安装`mongodb`本机 JavaScript 驱动程序。 `npm`是 Node.js 程序包管理器。 MongoDB Node.js 驱动程序提供基于回调和基于承诺的交互。 +我们安装`mongodb`本机 JavaScript 驱动程序。 `npm`是 Node.js 程序包管理器。 MongoDB Node.js 驱动程序提供基于回调和基于`Promise`的交互。 ## MongoDB 创建数据库 @@ -95,7 +95,7 @@ asyncFunc() `then()`方法始终返回`Promise`,这使我们能够链接方法调用。 -**注意**:如果没有传递回调,`MongoClient`的连接将返回一个承诺。 +> **注意**:如果没有传递回调,`MongoClient`的连接将返回一个`Promise`。 我们也可以使用`async/await`语法来处理`Promise`。 @@ -214,7 +214,7 @@ db.listCollections().toArray().then((docs) => { `listCollection()`方法在`testdb`数据库中找到所有集合; 它们被打印到控制台。 -**Note:** that we should be careful about using `toArray()` method because it can cause a lot of memory usage. +> **注意**:我们应该谨慎使用`toArray()`方法,因为它会导致大量的内存使用。 ```js }).catch((err) => { @@ -229,7 +229,7 @@ db.listCollections().toArray().then((docs) => { 在`catch`块中,我们捕获了任何潜在的异常,并在`finally`块中关闭了与数据库的连接。 -**Note:** our applications are console programs; therefore, we close the connection at the end of the program. In web applications, the connections should be reused. +> **注意**:我们的应用程序是控制台程序; 因此,我们在程序结束时关闭连接。 在 Web 应用程序中,应重新使用连接。 ```js $ node list_collections.js @@ -458,7 +458,7 @@ $ node find_one.js ## MongoDB 异步/等待示例 -使用`async/await`,我们可以轻松地以同步方式处理承诺。 +使用`async/await`,我们可以轻松地以同步方式处理`Promise`。 `async_await.js` diff --git a/docs/dotnet/148.md b/docs/dotnet/148.md index 025e89a..f2af37e 100644 --- a/docs/dotnet/148.md +++ b/docs/dotnet/148.md @@ -35,7 +35,7 @@ course of three days, during the second Persian invasion of Greece. `File`提供了用于创建,复制,删除,移动和打开单个文件的静态方法,并有助于创建`FileStream`对象。 -**注意**:`File.ReadAllText()`不适合读取非常大的文件。 +> **注意**:`File.ReadAllText()`不适合读取非常大的文件。 `File.ReadAllText()`打开一个文件,以指定的编码读取文件中的所有文本,然后关闭该文件。 diff --git a/docs/dotnet/154.md b/docs/dotnet/154.md index c46d1db..8f60f91 100644 --- a/docs/dotnet/154.md +++ b/docs/dotnet/154.md @@ -434,7 +434,7 @@ File.WriteAllBytes(localPath, imageBytes); 在 HTTP 协议中,基本访问认证是 HTTP 用户代理(例如 Web 浏览器或控制台应用)在发出请求时提供用户名和密码的方法。 在基本 HTTP 认证中,请求包含`Authorization: Basic <credentials>`形式的标头字段,其中凭据是由单个冒号`:`连接的 id 和密码的 base64 编码。 -**注意**:凭证未加密; 因此,必须将 HTTP 基本认证与 HTTPS 协议一起使用。 +> **注意**:凭证未加密; 因此,必须将 HTTP 基本认证与 HTTPS 协议一起使用。 HTTP 基本认证是用于实施对 Web 资源的访问控制的最简单技术。 它不需要 cookie,会话标识符或登录页面; 相反,HTTP 基本认证使用 HTTP 标头中的标准字段。 diff --git a/docs/graph/13.md b/docs/graph/13.md index 2a1baac..040f715 100644 --- a/docs/graph/13.md +++ b/docs/graph/13.md @@ -4,8 +4,6 @@ 在 Java 2D 游戏教程的这一部分中,我们创建一个扫雷游戏克隆。 源代码和图像可以在作者的 Github [Java-Minesweeper-Game](https://github.com/janbodnar/Java-Minesweeper-Game) 存储库中找到。 -**Ad** Pro Tip : Easily access your essential developer tools such emulators etc. by loading them onto cloud [hosted citrix xendesktop](https://www.clouddesktoponline.com/citrix-xen-desktop/) with add-ons such as [Office 365 Enterprise E5](https://www.o365cloudexperts.com/office-365-e5/) suite for enhanced team productivity. - ## 扫雷 《扫雷》是一款流行的棋盘游戏,默认情况下附带许多操作系统。 游戏的目标是扫雷场中的所有地雷。 如果玩家单击包含地雷的单元格,则地雷会引爆,游戏结束。 diff --git a/docs/java/101.md b/docs/java/101.md index 22870a8..fe9ed01 100644 --- a/docs/java/101.md +++ b/docs/java/101.md @@ -33,7 +33,7 @@ course of three days, during the second Persian invasion of Greece. `FileReader`是用于读取字符文件的类。 它使用默认缓冲区大小从字符文件中读取文本。 从字节到字符的解码使用指定的字符集或平台的默认字符集。 -**Note:** In the past, `FileReader` relied on the default platform's encoding. Since Java 11, the issue was corrected. It is possible now to explicitly specify the encoding. +> **注意**:过去,`FileReader`依赖于默认平台的编码。 从 Java 11 开始,此问题已得到纠正。 现在可以显式指定编码。 `com/zetcode/FileReaderEx.java` diff --git a/docs/java/3.md b/docs/java/3.md index 355ffd6..7be5418 100644 --- a/docs/java/3.md +++ b/docs/java/3.md @@ -108,7 +108,7 @@ $ mkdir bin 编译后的 Java 字节码进入`bin`目录。 -**注意**:在 Java 中, `.java`文件中的类名需要与文件名完全一致。 +> **注意**:在 Java 中, `.java`文件中的类名需要与文件名完全一致。 ```java $ touch src/com/zetcode/SimpleEx.java diff --git a/docs/java/5.md b/docs/java/5.md index cf83f54..f6c0459 100644 --- a/docs/java/5.md +++ b/docs/java/5.md @@ -68,7 +68,7 @@ This is Java 我们使用`java`工具执行该程序。 -**Note:** We execute the (single) source file with java tool. This feature was added in Java 11. +> **注意**:我们使用`java工具执行(单个)源文件。 Java 11 中添加了此功能。 ## Java 控制台读取值 diff --git a/docs/java/64.md b/docs/java/64.md index 8c840f8..152636a 100644 --- a/docs/java/64.md +++ b/docs/java/64.md @@ -8,7 +8,7 @@ Java 套接字教程展示了如何使用套接字在 Java 中进行网络编程 在编程中,套接字是网络上运行的两个程序之间的通信端点。 套接字类用于在客户端程序和服务器程序之间创建连接。 `Socket`代表客户端套接字,`ServerSocket`代表服务器套接字。 -**Note:** In networking, the term socket has a different meaning. It is used for the combination of an IP address and a port number. +> **注意**:在网络中,“套接字”一词具有不同的含义。 它用于 IP 地址和端口号的组合。 `ServerSocket`绑定到端口号,这是通过客户端和服务器同意进行通信的唯一 ID。 @@ -22,7 +22,7 @@ TCP 更可靠,具有大量错误检查并需要更多资源。 HTTP,SMTP 或 是提供当前时间的服务器。 客户端无需任何命令即可直接连接到服务器,服务器以当前时间作为响应。 -**Note:** Time servers come and go, so we might need to find a working server on https://www.ntppool.org/en/. +> **注意**:时间服务器来来往往,因此我们可能需要在 上找到可用的服务器。 在我们的示例中,我们选择了瑞典的服务器。 @@ -108,7 +108,7 @@ System.out.println(output); Whois 是基于 TCP 的面向事务的查询/响应协议,被广泛用于向互联网用户提供信息服务。 它用于查询域名或 IP 地址块所有者等信息。 -**Note:** Most whois servers provide only limited information (for instance only for selected domain names) and the information about owners is often anonymized by domain registrars. +> **注意**:大多数 Whois 服务器仅提供有限的信息(例如,仅针对选定的域名),并且有关域名所有者的信息通常由域名注册机构匿名。 Whois 协议使用端口 43。 diff --git a/docs/java/76.md b/docs/java/76.md index 47519be..2486a22 100644 --- a/docs/java/76.md +++ b/docs/java/76.md @@ -204,7 +204,7 @@ public class ListCopy { `ArrayList`可以包含各种数据类型。 这些称为原始列表。 -**Note:** It is generally not recommended to use raw lists. +> **注意**:通常不建议使用原始列表。 原始列表通常需要强制转换,而且类型安全。 diff --git a/docs/js/55.md b/docs/js/55.md index 7dd70df..dd58a07 100644 --- a/docs/js/55.md +++ b/docs/js/55.md @@ -207,7 +207,7 @@ console.log('server running on port 8080'); 我们指定`text/html`内容类型,并将 HTML 标记写入响应。 -**Note:** In real-world applications, we do not write HTML code into the response. We use templates. +> **注意**:在实际应用中,我们不会在响应中编写 HTML 代码。 我们使用模板。 ## Node HTTP 查询参数 diff --git a/docs/js/73.md b/docs/js/73.md index 1f96623..f88f11a 100644 --- a/docs/js/73.md +++ b/docs/js/73.md @@ -93,9 +93,9 @@ asyncFunc() `then()`方法始终返回`Promise`,这使我们能够链接方法调用。 -**Note:** the `MongoClient's` connect returns a promise if no callback is passed. +> **注意**:如果没有传递回调,`MongoClient`的`connect`将返回一个`Promise`。 -我们也可以使用`async/await`语法来处理诺言。 +我们也可以使用`async/await`语法来处理`Promise`。 ## MongoDB JS 驱动程序 @@ -212,7 +212,7 @@ db.listCollections().toArray().then((docs) => { `listCollection()`方法在`testdb`数据库中找到所有集合; 它们被打印到控制台。 -**Note:** that we should be careful about using `toArray()` method because it can cause a lot of memory usage. +> **注意**:我们应该谨慎使用`toArray()`方法,因为它会导致大量的内存使用。 ```js }).catch((err) => { @@ -227,7 +227,7 @@ db.listCollections().toArray().then((docs) => { 在`catch`块中,我们捕获了任何潜在的异常,并在`finally`块中关闭了与数据库的连接。 -**Note:** our applications are console programs; therefore, we close the connection at the end of the program. In web applications, the connections should be reused. +> **注意**:我们的应用程序是控制台程序; 因此,我们在程序结束时关闭连接。 在 Web 应用程序中,应重新使用连接。 ```js $ node list_collections.js diff --git a/docs/php/171.md b/docs/php/171.md index 60ab8c5..d0de1a3 100644 --- a/docs/php/171.md +++ b/docs/php/171.md @@ -365,7 +365,7 @@ $ composer req swiftmailer/swiftmailer 对于此示例,我们需要安装`swiftmailer/swiftmailer`软件包。 -**Note:** Gmail is not ideal for testing applications. We should use an online service such as Mailtrap or Mailgun, or use an SMTP server provided by a webhosting company. +> **注意**:Gmail 不是理想的测试应用程序。 我们应该使用诸如 Mailtrap 或 Mailgun 之类的在线服务,或者使用由网络托管公司提供的 SMTP 服务器。 在我们的示例中,我们使用 Mailtrap 服务。 diff --git a/docs/py/17.md b/docs/py/17.md index b44f89b..47f6bdb 100644 --- a/docs/py/17.md +++ b/docs/py/17.md @@ -35,7 +35,7 @@ finally: 除以零是不可能的。 如果我们尝试执行此操作,则会引发`ZeroDivisionError`并中断脚本。 -**Note:** The following examples demonstrate how the exceptions work in Python. It is more straightforward to ensure that the divisor is not zero rather than catch `ZeroDivisionError`. +> **注意**:以下示例演示了异常在 Python 中的工作方式。 确保除数不为零而不是捕获`ZeroDivisionError`更直接。 `zero_division.py` diff --git a/docs/py/22.md b/docs/py/22.md index 975bd8f..a8a8c51 100644 --- a/docs/py/22.md +++ b/docs/py/22.md @@ -14,7 +14,7 @@ Python `bcrypt`模块是一个用于在 Python 中生成强哈希值的库。 哈希是使用算法将任意大小的数据映射到固定长度的过程。 这称为哈希值。 加密是一种双向功能,而散列是一种单向功能。 尽管在技术上可以反向散列值,但所需的计算能力使其不可行。 加密是为了保护传输中的数据,而散列是为了验证数据没有被更改并且是真实的。 -**Note:** Hashing is not limited to security. It is also used to compare large amounts of data or fast key lookups. +> **注意**:散列不限于安全性。 它还用于比较大量数据或快速键查找。 密码不是以纯文本格式存储在数据库中,而是以散列值存储。 diff --git a/docs/py/23.md b/docs/py/23.md index 0c9187e..dc90bb4 100644 --- a/docs/py/23.md +++ b/docs/py/23.md @@ -8,7 +8,7 @@ Python 套接字教程展示了如何使用套接字进行 Python 网络编程 Python 的`socket`模块提供了与 Berkeley 套接字 API 的接口。 -**Note:** In networking, the term socket has a different meaning. It is used for the combination of an IP address and a port number. +> **注意**:在网络中,“套接字”一词具有不同的含义。 它用于 IP 地址和端口号的组合。 ## 网络协议 @@ -143,7 +143,7 @@ $ ./qotd_client.py 是提供当前时间的服务器。 客户端无需任何命令即可直接连接到服务器,服务器以当前时间作为响应。 -**Note:** Time servers come and go, so we might need to find a working server on https://www.ntppool.org/en/. +> **注意**:时间服务器来来往往,因此我们可能需要在 上找到可用的服务器。 `time_client.py` diff --git a/docs/py/24.md b/docs/py/24.md index c5fa5e1..d295715 100644 --- a/docs/py/24.md +++ b/docs/py/24.md @@ -16,7 +16,7 @@ Python `smtplib`教程展示了如何使用`smtplib`模块在 Python 中发送 要实际发送电子邮件,我们需要有权访问邮件服务器。 Python 带有一个简单的开发邮件服务器。 Mailslurper 是易于使用的本地开发服务器。 共享的虚拟主机提供商使我们可以访问邮件服务器。 我们可以在帐户中找到详细信息。 -**注意**:避免使用 Gmail,因为它是高度安全的服务器,并且使其工作非常复杂。 实际上,互联网上的大多数(如果不是全部)示例演示了如何通过 Gmail 服务器发送电子邮件,这些示例都无法正常工作。 而是使用开发服务器或共享的虚拟主机服务器。 +> **注意**:避免使用 Gmail,因为它是高度安全的服务器,并且使其工作非常复杂。 实际上,互联网上的大多数(如果不是全部)示例演示了如何通过 Gmail 服务器发送电子邮件,这些示例都无法正常工作。 而是使用开发服务器或共享的虚拟主机服务器。 最后,我们可以使用 Web 服务。 有开发 Web 服务(例如 MailTrap 或 MailSlurp)或生产服务(例如 Mailgun 或 Mandrill)。 diff --git a/docs/py/28.md b/docs/py/28.md index 2dc11a8..08c2513 100644 --- a/docs/py/28.md +++ b/docs/py/28.md @@ -16,11 +16,11 @@ Python 哈希教程解释了 Python 中的哈希概念。 我们介绍了哈希 如果对象的哈希值在其生命周期内从未发生变化,则该对象是可哈希的。 (在多次调用 Python 程序期间,它可以具有不同的值。)可哈希对象需要`__hash__()`方法。 为了执行比较,散列需要一种`__eq__()`方法。 -**Note:** Hashable objects which compare equal must have the same hash value. +> **注意**:比较相等的可哈希对象必须具有相同的哈希值。 散列性使对象可用作字典键和集成员,因为这些数据结构在内部使用散列值。 Python 不可变的内置对象是可哈希的; 可变容器(例如列表或字典)不是。 默认情况下,作为用户定义类实例的对象是可哈希的。 它们都比较不相等(除了它们本身),并且它们的哈希值是从`id()`派生的。 -**Note:** If a class does not define an `__eq__()` method it should not define a `__hash__()` operation either; if it defines `__eq__()` but not `__hash__()`, its instances will not be usable as items in hashable collections. +> **注意**:如果一个类没有定义一个`__eq __()`方法,它也不应该定义一个`__hash __()`操作。 如果它定义了`__eq __()`而不是`__hash __()`,则其实例将不能用作可散列集合中的项目。 ## Python `hash()`函数 diff --git a/docs/py/56.md b/docs/py/56.md index d91b183..85b8348 100644 --- a/docs/py/56.md +++ b/docs/py/56.md @@ -425,7 +425,7 @@ Pos, Country, Amount (Bn. $), GDP 这是一个简单的 CSV 文件,其中包含有关国家军事支出的数据。 -**Note:** CSV files may have optional column names in the first row. +> **注意**:CSV 文件在第一行中可能具有可选的列名。 `read_from_csv.py` diff --git a/docs/py/60.md b/docs/py/60.md index 5588b6c..be7e473 100644 --- a/docs/py/60.md +++ b/docs/py/60.md @@ -845,7 +845,7 @@ for sel in root.xpath("//span[contains(@class, 'one-click-content')]"): 在此脚本中,我们在`www.dictionary.com`上找到了术语狗的定义。 `lxml`模块用于解析 HTML 代码。 -**Note:** The tags that contain the definitions may change overnight. In such case we would need to adapt the script. +> **注意**:包含定义的标签可能会在一夜之间发生变化。 在这种情况下,我们需要调整脚本。 ```py from lxml import html diff --git a/docs/spring-boot/12.md b/docs/spring-boot/12.md index 58f91f4..1a48229 100644 --- a/docs/spring-boot/12.md +++ b/docs/spring-boot/12.md @@ -242,7 +242,7 @@ public interface CityRepository extends JpaRepository { `CityRepository`从`JpaRepository`延伸。 它提供了实体的类型及其主键。 -**Note:** In Java enterprise applications it is a good practice to define a service layer that works with repositories. For simplicity reasons, we skip the service layer. +> **注意**:在Java企业应用程序中,定义与存储库一起使用的服务层是一个好习惯。 为简单起见,我们跳过服务层。 `com/zetcode/MyRunner.java` diff --git a/docs/spring-boot/16.md b/docs/spring-boot/16.md index e88242f..5238feb 100644 --- a/docs/spring-boot/16.md +++ b/docs/spring-boot/16.md @@ -398,7 +398,7 @@ logger.info("{}", cities2); 在第三个查询中,我们利用存储库。 -**Note:** In Java enterprise applications it is a good practice to define a service layer that works with repositories. For simplicity reasons, we skip the service layer. +> **注意**:在Java企业应用程序中,定义与存储库一起使用的服务层是一个好习惯。 为简单起见,我们跳过服务层。 `com/zetcode/Application.java` diff --git a/docs/spring-boot/18.md b/docs/spring-boot/18.md index b7c0f8c..ee62582 100644 --- a/docs/spring-boot/18.md +++ b/docs/spring-boot/18.md @@ -310,7 +310,7 @@ public class MyRunner implements CommandLineRunner { 在`MyRunner`中,我们使用`findByNameEndingWithAndPopulationLessThan()`方法。 -**Note:** In Java enterprise applications it is a good practice to define a service layer that works with repositories. For simplicity reasons, we skip the service layer. +> **注意**:在Java企业应用程序中,定义与存储库一起使用的服务层是一个好习惯。 为简单起见,我们跳过服务层。 `com/zetcode/Application.java` diff --git a/docs/spring-boot/19.md b/docs/spring-boot/19.md index cb9c36f..56a91bc 100644 --- a/docs/spring-boot/19.md +++ b/docs/spring-boot/19.md @@ -270,7 +270,7 @@ public class MyRunner implements CommandLineRunner { 在`MyRunner`中,我们使用`CityRepository`保存和检索实体。 数据存储在内存中的 H2 数据库中。 -**Note:** In Java enterprise applications it is a good practice to define a service layer that works with repositories. For simplicity reasons, we skip the service layer. +> **注意**:在Java企业应用程序中,定义与存储库一起使用的服务层是一个好习惯。 为简单起见,我们跳过服务层。 `com/zetcode/Application.java` diff --git a/docs/spring-boot/2.md b/docs/spring-boot/2.md index 610eb86..77efb40 100644 --- a/docs/spring-boot/2.md +++ b/docs/spring-boot/2.md @@ -10,7 +10,7 @@ Spring 是流行的 Java 应用框架,而 Spring Boot 是 Spring 的演进, 在下面的示例中,我们创建一个将电子邮件发送到 Mailtrap 帐户的应用。 如果没有帐户,我们需要注册一个帐户。 注册过程非常简单快捷。 有一个免费层,每月可发送 500 封电子邮件。 -**注意**:Gmail 不是测试应用的理想选择。 我们应该使用诸如 Mailtrap 或 Mailgun 之类的在线服务,或者使用由网络托管公司提供的 SMTP 服务器。 +> **注意**:Gmail 不是测试应用的理想选择。 我们应该使用诸如 Mailtrap 或 Mailgun 之类的在线服务,或者使用由网络托管公司提供的 SMTP 服务器。 该应用具有 Web 界面来发送电子邮件。 此外,可以通过测试发送电子邮件。 diff --git a/docs/spring-boot/67.md b/docs/spring-boot/67.md index d8821eb..ce05c16 100644 --- a/docs/spring-boot/67.md +++ b/docs/spring-boot/67.md @@ -30,7 +30,7 @@ Spring 反应式是一个反应式库,用于根据反应式流规范在 JVM 在以下应用中,我们对 MongoDB 数据库使用反应式编程。 -**Note:** by default, without any specific configuration, Spring Boot attempts to connect to a locally hosted instance of MongoDB, using the `test` database name. +> **注意**:默认情况下,没有任何特定配置,Spring Boot 会尝试使用`test`数据库名称连接到本地托管的 MongoDB 实例。 ```java pom.xml @@ -370,7 +370,7 @@ all.block(); `subscribe()`方法开始工作并立即返回。 我们不能保证在应用的其他部分运行操作完成。 `block()`是一项阻止操作:它触发该操作并等待其完成。 -**Note:** Generally, we rarely use blocking calls in our applications. Operations in a console application is one of a few exceptions. +> **注意**:通常,我们很少在应用程序中使用阻塞调用。 控制台应用程序中的操作是少数例外之一。 `com/zetcode/Application.java` diff --git a/docs/spring-boot/7.md b/docs/spring-boot/7.md index 40b26ca..e36d40d 100644 --- a/docs/spring-boot/7.md +++ b/docs/spring-boot/7.md @@ -280,7 +280,7 @@ public class MyController { 在`MyController`中,我们有一个返回所有城市的端点。 -**Note:** In Java enterprise applications it is a good practice to define a service layer that works with repositories. For simplicity reasons, we skip the service layer. +> **注意**:在Java企业应用程序中,定义与存储库一起使用的服务层是一个好习惯。 为简单起见,我们跳过服务层。 `com/zetcode/conf/AppConf.java` diff --git a/docs/spring/3.md b/docs/spring/3.md index 1b39085..b22de25 100644 --- a/docs/spring/3.md +++ b/docs/spring/3.md @@ -207,7 +207,7 @@ private WordService wordService; 这称为场注入。 -**注意**:虽然字段注入简短而有趣,但通常建议使用构造函数注入或设置器注入。 +> **注意**:虽然字段注入简短而有趣,但通常建议使用构造函数注入或设置器注入。 ```java $ mvn -q exec:java diff --git a/docs/spring/5.md b/docs/spring/5.md index d8809fa..102ab36 100644 --- a/docs/spring/5.md +++ b/docs/spring/5.md @@ -251,7 +251,7 @@ public class MyController { `MyController`提供请求路径和处理程序方法之间的映射。 -**注**:这是一个很好的做法,在响应头返回新创建资源的位置。 +> **注意**:这是一个很好的做法,在响应头返回新创建资源的位置。 ```java @PostMapping(value = "/posts") diff --git a/docs/spring/6.md b/docs/spring/6.md index 9260c67..75f129d 100644 --- a/docs/spring/6.md +++ b/docs/spring/6.md @@ -384,7 +384,7 @@ public class PostService implements IPostService { `PostService`具有删除帖子并返回所有帖子的方法。 我们没有实现数据库层。 相反,我们使用一个简单的内存集合。 -**注意**:在实际应用中,我们还将实现存储库层。 +> **注意**:在实际应用中,我们还将实现存储库层。 ```java $ mvn jetty:run diff --git a/docs/symfony/89.md b/docs/symfony/89.md index d2d5680..7e6589e 100644 --- a/docs/symfony/89.md +++ b/docs/symfony/89.md @@ -24,7 +24,7 @@ $ composer require symfony/var-dumper HTTP 定义了一组请求方法,以指示要对给定资源执行的所需操作。 GET 请求用于从指定资源请求数据。 使用 GET 的请求应仅检索数据,而对数据没有其他影响。 -**Note:** The purpose and impact of the HTTP methods is a recommendation; these are not strict rules. This is why we said earlier that GET method should not have effect on data. In practice, this is not always followed. +> **注意**:建议使用 HTTP 方法的目的和影响; 这些不是严格的规则。 这就是我们前面说过 GET 方法不应对数据产生影响的原因。 实际上,这并不总是遵循的。 `get_request.php` @@ -51,7 +51,7 @@ echo $content . "\n"; 该示例创建`HttpClient`,并向指定的网页发出 GET 请求。 -**Note:** Responses are always asynchronous, so that the call to the method returns immediately instead of waiting to receive the response. There are blocking methods such as `getStatusCode()` and `getContent()`, which wait until the full response contents are received. +> **注意**:响应始终是异步的,因此对方法的调用将立即返回,而不是等待接收响应。 有诸如`getStatusCode()`和`getContent()`之类的阻塞方法,它们会等到接收到完整的响应内容为止。 ```php $httpClient = HttpClient::create(); diff --git a/docs/symfony/90.md b/docs/symfony/90.md index d02696e..aeb599d 100644 --- a/docs/symfony/90.md +++ b/docs/symfony/90.md @@ -12,7 +12,7 @@ Symfony 是一组可重用的 PHP 组件和一个用于 Web 项目的 PHP 框架 在下面的示例中,我们有一个简单的表单,其中有一个输入框用于输入用户名。 如果用户输入的名称无效(空或仅包含空格),则应用将在表单上方显示一个闪烁通知。 -**注意**:在我们的应用中,我们有一个 GET 表单。 GET 方法被认为是[安全](https://developer.mozilla.org/en-US/docs/Glossary/safe),因此我们未实现 CSRF 保护。 [Symfony CSRF 教程](/symfony/csrf/)涵盖了 Symfony 中的 CSRF 保护。 +> **注意**:在我们的应用中,我们有一个 GET 表单。 GET 方法被认为是[安全](https://developer.mozilla.org/en-US/docs/Glossary/safe),因此我们未实现 CSRF 保护。 [Symfony CSRF 教程](/symfony/csrf/)涵盖了 Symfony 中的 CSRF 保护。 ```php $ composer create-project symfony/skeleton flashmsg @@ -67,7 +67,7 @@ class Validate `Validate`服务检查提供的字符串是否为空或仅包含空格。 -**注意**:在生产应用中,我们使用一些验证库,例如 Symfony 的`symfony/validator`或 PHP Rackit 或 Respect。 +> **注意**:在生产应用中,我们使用一些验证库,例如 Symfony 的`symfony/validator`或 PHP Rackit 或 Respect。 ```php $ php bin/console make:controller FormController diff --git a/docs/symfony/97.md b/docs/symfony/97.md index 570227a..a745283 100644 --- a/docs/symfony/97.md +++ b/docs/symfony/97.md @@ -149,7 +149,7 @@ public function index(DataService $dserv) 通过参数注入创建`DataService`。 -**注意**:为简单起见,我们已将数据库访问代码放置在服务类中。 生产应用中还有另一层:存储库。 数据库访问代码放置在存储库类中,该存储库类从服务类中调用。 +> **注意**:为简单起见,我们已将数据库访问代码放置在服务类中。 生产应用中还有另一层:存储库。 数据库访问代码放置在存储库类中,该存储库类从服务类中调用。 `src/Service/DataService.php` diff --git a/docs/symfony/98.md b/docs/symfony/98.md index 8bd3849..1b57c59 100644 --- a/docs/symfony/98.md +++ b/docs/symfony/98.md @@ -172,7 +172,7 @@ class FormController extends AbstractController 在`FormController`中,我们检查 CSRF 令牌,验证表单输入值,并将响应发送回客户端。 -**注意**:为简单起见,我们将验证代码放入控制器中。 在生产应用中,最好将此类代码放在单独的服务类中。 +> **注意**:为简单起见,我们将验证代码放入控制器中。 在生产应用中,最好将此类代码放在单独的服务类中。 ```php public function index(Request $request, ValidatorInterface $validator, -- GitLab