-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Improve RPC communication based on HTTP/2 #403
Open
SDUWYS
wants to merge
4
commits into
apache:dubbo3
Choose a base branch
from
SDUWYS:http2
base: dubbo3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
# 使用 Node.js 开发后端服务 | ||
|
||
基于 Dubbo 定义的 Triple 协议,你可以轻松编写浏览器、gRPC 兼容的 RPC 服务,并让这些服务同时运行在 HTTP/1 和 HTTP/2 上。Dubbo Node.js SDK 支持使用 IDL 或编程语言特有的方式定义服务,并提供一套轻量的 API 来发布或调用这些服务。 | ||
|
||
本示例演示了基于 Triple 协议的 RPC 通信模式,示例使用 Protocol Buffer 定义 RPC 服务,并演示了代码生成、服务发布和服务访问等过程。 | ||
|
||
## <span id="precondition">前置条件</span> | ||
|
||
因为使用 Protocol Buffer 的原因,我们首先需要安装相关的代码生成工具,这包括 `@bufbuild/protoc-gen-es`、`@bufbuild/protobuf`、`@apachedubbo/protoc-gen-apache-dubbo-es`、`@apachedubbo/dubbo`。 | ||
|
||
```Shell | ||
npm install @bufbuild/protoc-gen-es @bufbuild/protobuf @apachedubbo/protoc-gen-apache-dubbo-es @apachedubbo/dubbo | ||
``` | ||
|
||
## <span id="defineService">定义服务</span> | ||
|
||
现在,使用 Protocol Buffer (IDL) 来定义一个 Dubbo 服务。 | ||
|
||
创建目录,并生成文件 | ||
|
||
```Shell | ||
mkdir -p proto && touch proto/example.proto | ||
``` | ||
|
||
写入内容 | ||
|
||
```Protobuf | ||
syntax = "proto3"; | ||
|
||
package apache.dubbo.demo.example.v1; | ||
|
||
message SayRequest { | ||
string sentence = 1; | ||
} | ||
|
||
message SayResponse { | ||
string sentence = 1; | ||
} | ||
|
||
service ExampleService { | ||
rpc Say(SayRequest) returns (SayResponse) {} | ||
} | ||
``` | ||
|
||
这个文件声明了一个叫做 `ExampleService` 的服务,为这个服务定义了 `Say` 方法以及它的请求参数 `SayRequest` 和返回值 `SayResponse`。 | ||
|
||
## <span id="generateCode">生成代码</span> | ||
|
||
创建 gen 目录,做为生成文件放置的目标目录 | ||
|
||
``` | ||
mkdir -p gen | ||
``` | ||
|
||
运行以下命令,在 gen 目录下生成代码文件 | ||
|
||
```Shell | ||
PATH=$PATH:$(pwd)/node_modules/.bin \ | ||
protoc -I proto \ | ||
--es_out gen \ | ||
--es_opt target=ts \ | ||
--apache-dubbo-es_out gen \ | ||
--apache-dubbo-es_opt target=ts \ | ||
example.proto | ||
``` | ||
|
||
运行命令后,应该可以在目标目录中看到以下生成的文件: | ||
|
||
```Plain Text | ||
├── gen | ||
│ ├── example_dubbo.ts | ||
│ └── example_pb.ts | ||
├── proto | ||
│ └── example.proto | ||
``` | ||
|
||
## <span id="implementService">实现服务</span> | ||
|
||
接下来我们就需要添加业务逻辑了,实现 ExampleService ,并将其注册到 DubboRouter 中。 | ||
|
||
创建 dubbo.ts 文件 | ||
|
||
```typescript | ||
import type { DubboRouter } from "@apachedubbo/dubbo"; | ||
import { ExampleService } from "./gen/example_dubbo"; | ||
|
||
export default (router: DubboRouter) => | ||
// registers apache.dubbo.demo.example.v1 | ||
router.service(ExampleService, { | ||
// implements rpc Say | ||
async say(req) { | ||
return { | ||
sentence: `You said: ${req.sentence}`, | ||
}; | ||
}, | ||
}, { serviceGroup: 'dubbo', serviceVersion: '1.0.0' }); | ||
``` | ||
|
||
## <span id="startServer">启动 Server</span> | ||
|
||
Dubbo 服务可以嵌入到普通的 Node.js 服务器、Next.js、Express 或 Fastify 中。 | ||
在这里我们将使用 Fastify,所以让我们安装 Fastify 以及我们为 Fastify 准备的插件。 | ||
|
||
```Shell | ||
npm install fastify @apachedubbo/dubbo-fastify | ||
``` | ||
|
||
创建 server.ts 文件,新建一个 Server,把上一步中实现的 `ExampleService` 注册给它。 | ||
接下来就可以直接初始化和启动 Server 了,它将在指定的端口接收请求。 | ||
|
||
```typescript | ||
import { fastify } from "fastify"; | ||
import { fastifyDubboPlugin } from "@apachedubbo/dubbo-fastify"; | ||
import routes from "./dubbo"; | ||
|
||
async function main() { | ||
const server = fastify(); | ||
await server.register(fastifyDubboPlugin, { | ||
routes, | ||
}); | ||
server.get("/", (_, reply) => { | ||
reply.type("text/plain"); | ||
reply.send("Hello World!"); | ||
}); | ||
await server.listen({ host: "localhost", port: 8080 }); | ||
console.log("server is listening at", server.addresses()); | ||
} | ||
|
||
void main(); | ||
``` | ||
|
||
最后,运行代码启动服务 | ||
|
||
```Shell | ||
npx tsx server.ts | ||
``` | ||
|
||
## <span id="accessService">访问服务</span> | ||
|
||
最简单方式是使用 HTTP/1.1 POST 请求访问服务,参数则作以标准 JSON 格式作为 HTTP 负载传递。如下是使用 cURL 命令的访问示例: | ||
|
||
```Shell | ||
curl \ | ||
--header 'Content-Type: application/json' \ | ||
--header 'TRI-Service-Version: 1.0.0' \ | ||
--header 'TRI-Service-group: dubbo' \ | ||
--data '{"sentence": "Hello World"}' \ | ||
http://localhost:8080/apache.dubbo.demo.example.v1.ExampleService/Say | ||
``` | ||
|
||
也可以使用标准的 Dubbo client 请求服务,我们首先需要从生成代码即 dubbo-node 包中获取服务代理,为它指定 server 地址并初始化,之后就可以发起起 RPC 调用了。 | ||
|
||
创建 client.ts 文件。 | ||
|
||
```typescript | ||
import { createPromiseClient } from "@apachedubbo/dubbo"; | ||
import { ExampleService } from "./gen/example_dubbo"; | ||
import { createDubboTransport } from "@apachedubbo/dubbo-node"; | ||
|
||
const transport = createDubboTransport({ | ||
baseUrl: "http://localhost:8080", | ||
httpVersion: "1.1", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. “1.1” 这里是不是写错了诶 |
||
}); | ||
|
||
async function main() { | ||
const client = createPromiseClient(ExampleService, transport, { serviceVersion: '1.0.0', serviceGroup: 'dubbo' }); | ||
const res = await client.say({ sentence: "Hello World" }); | ||
console.log(res); | ||
} | ||
void main(); | ||
``` | ||
|
||
运行客户端 | ||
|
||
```Shell | ||
npx tsx client.ts | ||
``` | ||
|
||
## 其他 | ||
|
||
参考[开发运行在浏览器上的 web 应用](../dubbo-web-example/README.md),了解如何开发能访问 Dubbo 后端服务的浏览器页面。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { createPromiseClient } from "@apachedubbo/dubbo"; | ||
import { ExampleService } from "./gen/example_dubbo"; | ||
import { stdin, stdout, env } from "process"; | ||
import * as readline from "node:readline/promises"; | ||
import { createDubboTransport } from "@apachedubbo/dubbo-node"; | ||
|
||
const rl = readline.createInterface(stdin, stdout); | ||
|
||
let rejectUnauthorized = true; | ||
|
||
if (process.env.NODE_EXTRA_CA_CERTS == undefined) { | ||
console.log(env.NODE_EXTRA_CA_CERTS); | ||
rl.write("It appears that you haven't configured Node.js with your certificate authority for local development. This is okay; we'll bypass TLS errors in this example client. \n"); | ||
rejectUnauthorized = false; | ||
} | ||
|
||
|
||
const transport = createDubboTransport({ | ||
baseUrl: "https://localhost:8443", | ||
httpVersion: "2", | ||
nodeOptions: { rejectUnauthorized }, | ||
}); | ||
|
||
async function main() { | ||
const client = createPromiseClient(ExampleService, transport, { serviceVersion: '1.0.0', serviceGroup: 'dubbo' }); | ||
const res = await client.say({ sentence: "Hello World" }); | ||
console.log(res); | ||
} | ||
void main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { DubboRouter } from "@apachedubbo/dubbo"; | ||
import { ExampleService } from "./gen/example_dubbo"; | ||
|
||
export default (router: DubboRouter) => | ||
// registers apache.dubbo.demo.example.v1 | ||
router.service(ExampleService, { | ||
// implements rpc Say | ||
async say(req) { | ||
return { | ||
sentence: `You said: ${req.sentence}`, | ||
}; | ||
}, | ||
}, { serviceGroup: 'dubbo', serviceVersion: '1.0.0' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// @generated by @apachedubbo/protoc-gen-apache-dubbo-es v3.0.0-alpha with parameter "target=ts" | ||
// @generated from file example.proto (package apache.dubbo.demo.example.v1, syntax proto3) | ||
/* eslint-disable */ | ||
// @ts-nocheck | ||
|
||
import { SayRequest, SayResponse } from "./example_pb.js"; | ||
import { MethodKind } from "@bufbuild/protobuf"; | ||
|
||
/** | ||
* @generated from service apache.dubbo.demo.example.v1.ExampleService | ||
*/ | ||
export const ExampleService = { | ||
typeName: "apache.dubbo.demo.example.v1.ExampleService", | ||
methods: { | ||
/** | ||
* @generated from rpc apache.dubbo.demo.example.v1.ExampleService.Say | ||
*/ | ||
say: { | ||
name: "Say", | ||
I: SayRequest, | ||
O: SayResponse, | ||
kind: MethodKind.Unary, | ||
}, | ||
} | ||
} as const; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// @generated by protoc-gen-es v1.3.0 with parameter "target=ts" | ||
// @generated from file example.proto (package apache.dubbo.demo.example.v1, syntax proto3) | ||
/* eslint-disable */ | ||
// @ts-nocheck | ||
|
||
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; | ||
import { Message, proto3 } from "@bufbuild/protobuf"; | ||
|
||
/** | ||
* @generated from message apache.dubbo.demo.example.v1.SayRequest | ||
*/ | ||
export class SayRequest extends Message<SayRequest> { | ||
/** | ||
* @generated from field: string sentence = 1; | ||
*/ | ||
sentence = ""; | ||
|
||
constructor(data?: PartialMessage<SayRequest>) { | ||
super(); | ||
proto3.util.initPartial(data, this); | ||
} | ||
|
||
static readonly runtime: typeof proto3 = proto3; | ||
static readonly typeName = "apache.dubbo.demo.example.v1.SayRequest"; | ||
static readonly fields: FieldList = proto3.util.newFieldList(() => [ | ||
{ no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, | ||
]); | ||
|
||
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SayRequest { | ||
return new SayRequest().fromBinary(bytes, options); | ||
} | ||
|
||
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SayRequest { | ||
return new SayRequest().fromJson(jsonValue, options); | ||
} | ||
|
||
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SayRequest { | ||
return new SayRequest().fromJsonString(jsonString, options); | ||
} | ||
|
||
static equals(a: SayRequest | PlainMessage<SayRequest> | undefined, b: SayRequest | PlainMessage<SayRequest> | undefined): boolean { | ||
return proto3.util.equals(SayRequest, a, b); | ||
} | ||
} | ||
|
||
/** | ||
* @generated from message apache.dubbo.demo.example.v1.SayResponse | ||
*/ | ||
export class SayResponse extends Message<SayResponse> { | ||
/** | ||
* @generated from field: string sentence = 1; | ||
*/ | ||
sentence = ""; | ||
|
||
constructor(data?: PartialMessage<SayResponse>) { | ||
super(); | ||
proto3.util.initPartial(data, this); | ||
} | ||
|
||
static readonly runtime: typeof proto3 = proto3; | ||
static readonly typeName = "apache.dubbo.demo.example.v1.SayResponse"; | ||
static readonly fields: FieldList = proto3.util.newFieldList(() => [ | ||
{ no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, | ||
]); | ||
|
||
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SayResponse { | ||
return new SayResponse().fromBinary(bytes, options); | ||
} | ||
|
||
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SayResponse { | ||
return new SayResponse().fromJson(jsonValue, options); | ||
} | ||
|
||
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SayResponse { | ||
return new SayResponse().fromJsonString(jsonString, options); | ||
} | ||
|
||
static equals(a: SayResponse | PlainMessage<SayResponse> | undefined, b: SayResponse | PlainMessage<SayResponse> | undefined): boolean { | ||
return proto3.util.equals(SayResponse, a, b); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCkM4avGmv88fB8 | ||
Yh7Xk4RNbj5KdNAhInF7lSa0gmt9ZTXLdBQ6Ep80Qn0Afmxu8N5MplmQqcx5M1vJ | ||
JtTBtbKWGurT0GeLna1Fp0ASIbeRuxAJMWwjU2k+P2hqUGUOIStV5H/azQ5GeTpo | ||
wObHsbFBqBkvNh+lt1pr2t471+sihhdPe8qvWIddCkmiBbMFXvb70oIf34B+WnfV | ||
oOeSiujtLoxKhmoijox5mntaegDdVNCQEPifTNg/jLHwx14lt388Y/ri9fZXsYQy | ||
VVaLcpINNfxp7GE0U5FdmvZYiIgcKfCuqhtlaGYOpMGe907v2wH+e6IJ1aOrjy2c | ||
gaVCH0ozAgMBAAECggEANJ/+7me9bFfuBy87S0QQBvDqLdq6SaRMUps+yGN0J8Ak | ||
OYx+Xw5Qz+LvRRU/k17HIDHASsjgq4d2R0WWsm6VSd5enHwSc4CZY9Vyh10fBCm7 | ||
vfaE/d1hwX147XnOqXSf+us8vtcxWAzKV4BbdmzQroY9bBAgnG/jHuYKi4tr5Kgp | ||
hsj8FfrRm/FrWMsU9QWYlDYsuRuN9i3qUzPYvSO8HvbNfssA+f01bONvXgXUbz4/ | ||
1IlCV/najUcfDfK9QhauftZhNpXku4BbWlDqPP8rNE5SBG7iK8HI1jqf4GKM5UCl | ||
aTh2aIqxUEfLdhzBbRHkLy+EE4qjZDHqzm/vbxvLYQKBgQDDfRojlTFtAfVtkDwl | ||
xbPnkOvu6sp0fcui5ix/u70lYz+7p3kBKA9t6xm22NdSaE6qkxjNMj5gNBLyhTN5 | ||
oJqroobT3wlN6xAvr8d/Nzynh4/XcUfwlM7yqet9cDVMf8nLGE340Zmn5jPYVaTX | ||
b38kkaynaXmAureZQtHtb6EE/QKBgQDXByZiITw3xMn7+bkA1wOTUfRcUhYt9izV | ||
NtnP0P8WC0lkSgYmE+s2B6SMhUb/IS+AfOIMsmFdxxqgmHT+QFLJ4XiGwPMBCiL6 | ||
MAM7DbJ6AeadpjDQ1B9m+jyu1wmA14re0xU0XB5hyMZgtQOXN5Ram89H0DOvUFUh | ||
MTywFQzK7wKBgQCSo1zgJCGXK0j2jqMPkmWI5mSUKvsCtvnxj8cBacpQKUq9cLqL | ||
64jnYts/FRkvb57SxNRt16qCb41m7hPWwGpFJP0OINfR4umZW7nB66VL5Zw4d3kH | ||
NhimXl+PEIRqhdDQz8JtSoyALWXmeRfVooU04TEpwyypK2ZdSIpAGOQn4QKBgQDG | ||
G5RFfJFaYDgnqp/EIlTs+ejE1ewRVGlh1zM9wDQEP0nS2FBp7JgcI1Z7EJ+klxKI | ||
soYhZIdIOxRROaUwSlr8HHtKy6IXJxuqnWmckrYIqo+qV19KRuTXn10hSIU861jK | ||
indS0jw7oxsCJkO0okRQZpTGeQ/lSYHlHtPm9r3eiQKBgGys6eZ7AJ3/c3RmvYM0 | ||
R+QFug9r3/l76Q+gusfRSGkvuL3fH+gpD5glSQu5cukJefAUCTecbLJ7SBEgSb7E | ||
9TLgWGTi9MGDJSiPadvNdnOSXcJifPRDbVTzzoseZUy8reIgchMKQgRpeBrPJt3M | ||
nsC2oUnADd7/6pzrGjPyxl0D | ||
-----END PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIEUDCCArigAwIBAgIRAKuTG+GjDnE/HARizF2WJ18wDQYJKoZIhvcNAQELBQAw | ||
gYcxHjAcBgNVBAoTFW1rY2VydCBkZXZlbG9wbWVudCBDQTEuMCwGA1UECwwlU0Mt | ||
MjAyNDAyMjYyMzA5XEFkbWluQFNDLTIwMjQwMjI2MjMwOTE1MDMGA1UEAwwsbWtj | ||
ZXJ0IFNDLTIwMjQwMjI2MjMwOVxBZG1pbkBTQy0yMDI0MDIyNjIzMDkwHhcNMjQw | ||
ODI0MDc0ODM3WhcNMjYxMTI0MDc0ODM3WjBZMScwJQYDVQQKEx5ta2NlcnQgZGV2 | ||
ZWxvcG1lbnQgY2VydGlmaWNhdGUxLjAsBgNVBAsMJVNDLTIwMjQwMjI2MjMwOVxB | ||
ZG1pbkBTQy0yMDI0MDIyNjIzMDkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK | ||
AoIBAQCkM4avGmv88fB8Yh7Xk4RNbj5KdNAhInF7lSa0gmt9ZTXLdBQ6Ep80Qn0A | ||
fmxu8N5MplmQqcx5M1vJJtTBtbKWGurT0GeLna1Fp0ASIbeRuxAJMWwjU2k+P2hq | ||
UGUOIStV5H/azQ5GeTpowObHsbFBqBkvNh+lt1pr2t471+sihhdPe8qvWIddCkmi | ||
BbMFXvb70oIf34B+WnfVoOeSiujtLoxKhmoijox5mntaegDdVNCQEPifTNg/jLHw | ||
x14lt388Y/ri9fZXsYQyVVaLcpINNfxp7GE0U5FdmvZYiIgcKfCuqhtlaGYOpMGe | ||
907v2wH+e6IJ1aOrjy2cgaVCH0ozAgMBAAGjZDBiMA4GA1UdDwEB/wQEAwIFoDAT | ||
BgNVHSUEDDAKBggrBgEFBQcDATAfBgNVHSMEGDAWgBTic1/yG3hd+OqMl94SCVGa | ||
YVILdzAaBgNVHREEEzARgglsb2NhbGhvc3SHBH8AAAEwDQYJKoZIhvcNAQELBQAD | ||
ggGBAB1fmrDJ9BTqsgUtvzJPcmdrdNrUNWfQPflAT712n3DLwN4ZAH6N3UDYknkb | ||
Xp72TX+z0hZlrwOThPgTFwiMPNx686RXPdvNFGqNRouGiINJa85qsjyW81ToARea | ||
RO36mIVnWOClkTuDQqfcHCUK72h9q4KKpop7RC8nQnJ9ZHpgTNkYEoVpeLXa2/DF | ||
CiGjGYCiEC0E+vH8ZW6SZHvjf3JeBh0dHgDdXuSrxnw/nZApBxdTM5utNbx/vY/P | ||
HOhMHluJsBuiyqPIDvrpp8bksQuSPTZha9yx8T5bSx7R/auNoEYBuJfPJ7dRViYV | ||
BNKkM0cI82QGd7FgZWrmOlaFLztcCrtl62vwxcOioJ3se7UFovcHqJCwK/4EY6d2 | ||
lGsK0XDSzr4/Xj2Ta+gDVudhOw+LE6h54i2LDIWnuhR+XRSobjNRim+T9w4GOdsB | ||
fKPGZsP5dXOXXjAT+tPdmNo3VT1c0o+QkpMilBBI9vR0xUr+PZR4VmL1ldIxUdru | ||
SKUHxQ== | ||
-----END CERTIFICATE----- |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还有这里 “1.1”