-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest.proto
More file actions
52 lines (41 loc) · 1.66 KB
/
request.proto
File metadata and controls
52 lines (41 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
syntax = "proto3";
package asjard.api;
option go_package = "github.com/asjard/asjard/pkg/protobuf/requestpb;requestpb";
import "google/protobuf/descriptor.proto";
import "github.com/asjard/protobuf/http.proto";
import "github.com/asjard/protobuf/validate.proto";
import "google/protobuf/empty.proto";
// Default handlers
// provides standard utility endpoints for the service.
service DefaultHandlers {
// Service-level HTTP configuration for routing and versioning.
option (asjard.api.serviceHttp) = {
api : "/",
version : "/",
group : "/"
};
// Favicon returns the site icon typically requested by web browsers.
rpc Favicon(google.protobuf.Empty) returns (google.protobuf.Empty) {
option (asjard.api.http) = {
get : "/favicon.ico"
};
}
}
// ReqWithPage defines common parameters for paginated list requests.
message ReqWithPage {
// page is the requested page number (must be at least 1).
int32 page = 1 [ (asjard.api.validate).rules = "min=1" ];
// size is the number of items per page (must be between 5 and 500).
int32 size = 2 [ (asjard.api.validate).rules = "min=5,max=500" ];
// sort defines the field and direction for ordering results (e.g., "id desc").
string sort = 3;
// search provides a keyword for filtering the result set.
string search = 4;
}
// ReqWithId is used for requests that only require a unique identifier.
message ReqWithId {
// id is the primary identifier of the resource.
int64 id = 1 [ (asjard.api.validate).rules = "required" ];
}
// Empty is a placeholder message used when no input or output data is required.
message Empty {};