Skip to content

Commit 7547902

Browse files
committed
feat(lab): tcp endpoint
1 parent 47040cf commit 7547902

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ jobs:
2424

2525
- uses: actions-rs/cargo@v1
2626
with:
27-
use-cross: true
27+
use-cross: false
2828
command: test
2929

3030
- uses: actions-rs/cargo@v1
3131
with:
32-
use-cross: true
32+
use-cross: false
3333
command: build
3434
args: --release
3535

Cargo.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "cryptography-learning-backend"
3-
version = "0.1.0"
4-
authors = ["zickshen <zickshen@tencent.com>"]
5-
edition = "2018"
3+
version = "0.1.1"
4+
authors = ["CSUwangj <CSUwangj@protonmail.com>"]
5+
edition = "2021"
66

77
[dependencies]
88
async-graphql = "2.0"

src/model.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub type Storage = DashMap<String, String>;
1313
#[Object]
1414
impl Query {
1515
async fn hello(&self) -> String {
16-
"hello world".to_string()
16+
"hello cryptography".to_string()
1717
}
1818

1919
async fn practice<'ctx>(&self, ctx: &'ctx Context<'_>) -> FieldResult<&'ctx Practice> {
@@ -52,7 +52,8 @@ impl Query {
5252
let mut result: LabInstance = LabInstance {
5353
lang: resource.lang.clone(),
5454
name: resource.name.clone(),
55-
endpoints: lab.endpoints.clone(),
55+
ws_endpoints: lab.ws_endpoints.clone(),
56+
tcp_endpoints: lab.tcp_endpoints.clone(),
5657
content: String::new(),
5758
};
5859

@@ -104,7 +105,8 @@ struct Endpoint {
104105
#[derive(Deserialize, Serialize, SimpleObject, Debug, Clone)]
105106
struct Lab {
106107
id: String,
107-
endpoints: Vec<Endpoint>,
108+
ws_endpoints: Vec<Endpoint>,
109+
tcp_endpoints: Vec<Endpoint>,
108110
resources: Vec<ResourceWithTranslation>,
109111
}
110112

@@ -113,7 +115,8 @@ struct LabInstance {
113115
lang: String,
114116
name: String,
115117
content: String,
116-
endpoints: Vec<Endpoint>,
118+
ws_endpoints: Vec<Endpoint>,
119+
tcp_endpoints: Vec<Endpoint>,
117120
}
118121

119122
#[derive(Deserialize, Serialize, SimpleObject, Debug, Clone)]

0 commit comments

Comments
 (0)