-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32dfa96
commit c6682f0
Showing
54 changed files
with
6,557 additions
and
3 deletions.
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
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
32 changes: 32 additions & 0 deletions
32
pilota-build/test_data/thrift_workspace/input/article.thrift
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,32 @@ | ||
include "image.thrift" | ||
include "author.thrift" | ||
include "common.thrift" | ||
|
||
namespace rs article | ||
|
||
enum Status { | ||
NORMAL = 0, | ||
DELETED = 1, | ||
} | ||
|
||
struct Article { | ||
1: required i64 id, | ||
2: required string title, | ||
3: required string content, | ||
4: required author.Author author, | ||
5: required Status status, | ||
6: required list<image.Image> images, | ||
7: required common.CommonData common_data, | ||
} | ||
|
||
struct GetArticleRequest { | ||
1: required i64 id, | ||
} | ||
|
||
struct GetArticleResponse { | ||
1: required Article article, | ||
} | ||
|
||
service ArticleService { | ||
GetArticleResponse GetArticle(1: GetArticleRequest req), | ||
} |
24 changes: 24 additions & 0 deletions
24
pilota-build/test_data/thrift_workspace/input/author.thrift
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,24 @@ | ||
include "image.thrift" | ||
include "common.thrift" | ||
|
||
namespace rs author | ||
|
||
struct Author { | ||
1: required i64 id, | ||
2: required string username, | ||
3: required string email, | ||
4: required image.Image avatar, | ||
5: required common.CommonData common_data, | ||
} | ||
|
||
struct GetAuthorRequest { | ||
1: required i64 id, | ||
} | ||
|
||
struct GetAuthorResponse { | ||
1: required Author author, | ||
} | ||
|
||
service AuthorService { | ||
GetAuthorResponse GetAuthor(1: GetAuthorRequest req), | ||
} |
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,9 @@ | ||
include "common.thrift" | ||
|
||
namespace rs article.image.cdn | ||
|
||
struct CDN { | ||
1: required i64 id, | ||
2: required string url, | ||
3: required common.CommonData common_data, | ||
} |
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,7 @@ | ||
namespace rs common | ||
|
||
struct CommonData { | ||
1: required i64 id, | ||
2: required string name, | ||
3: required string description, | ||
} |
23 changes: 23 additions & 0 deletions
23
pilota-build/test_data/thrift_workspace/input/image.thrift
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,23 @@ | ||
include "common.thrift" | ||
include "cdn.thrift" | ||
|
||
namespace rs article.image | ||
|
||
struct Image { | ||
1: required i64 id, | ||
2: required string url, | ||
3: required cdn.CDN cdn, | ||
4: required common.CommonData common_data, | ||
} | ||
|
||
struct GetImageRequest { | ||
1: required i64 id, | ||
} | ||
|
||
struct GetImageResponse { | ||
1: required Image image, | ||
} | ||
|
||
service ImageService { | ||
GetImageResponse GetImage(1: GetImageRequest req), | ||
} |
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,12 @@ | ||
[workspace] | ||
members = [ | ||
"article", | ||
"author", "common", | ||
"image", | ||
] | ||
|
||
[workspace.dependencies] | ||
anyhow = "1" | ||
pilota = "*" | ||
volo = "*" | ||
volo-thrift = "*" |
19 changes: 19 additions & 0 deletions
19
pilota-build/test_data/thrift_workspace/output/article/Cargo.toml
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,19 @@ | ||
[dependencies.anyhow] | ||
workspace = true | ||
|
||
[dependencies.common] | ||
path = "../common" | ||
|
||
[dependencies.pilota] | ||
workspace = true | ||
|
||
[dependencies.volo] | ||
workspace = true | ||
|
||
[dependencies.volo-thrift] | ||
workspace = true | ||
|
||
[package] | ||
edition = "2021" | ||
name = "article" | ||
version = "0.1.0" |
Oops, something went wrong.