mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-23 15:51:24 +00:00
feat: add joke api (#294)
* feat: add joke api close #124 * chore: count boundary * fix: bug fix chore: update README.md * feat: add publicapi.json
This commit is contained in:
28
joke/proto/joke.proto
Normal file
28
joke/proto/joke.proto
Normal file
@@ -0,0 +1,28 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package joke;
|
||||
|
||||
option go_package = "./proto;joke";
|
||||
|
||||
service Joke {
|
||||
// get n random jokes
|
||||
rpc Random(RandomRequest) returns (RandomResponse) {}
|
||||
}
|
||||
|
||||
message RandomRequest {
|
||||
// the count of random jokes want, maximum: 10
|
||||
int32 count = 1;
|
||||
}
|
||||
|
||||
message JokeInfo {
|
||||
string id = 1;
|
||||
string title = 2;
|
||||
string body = 3;
|
||||
string category = 4;
|
||||
// the source of joke
|
||||
string source = 5;
|
||||
}
|
||||
|
||||
message RandomResponse {
|
||||
repeated JokeInfo jokes = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user