Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
P
Protocol Buffer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tammam.alsoleman
Protocol Buffer
Commits
29881ae8
Commit
29881ae8
authored
Nov 05, 2025
by
tammam.alsoleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create book.proto
parent
46b5fd21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
book.proto
src/proto/book.proto
+62
-0
No files found.
src/proto/book.proto
0 → 100644
View file @
29881ae8
syntax
=
"proto3"
;
option
java_multiple_files
=
true
;
option
java_package
=
"org.ds.proto"
;
enum
BookType
{
UNKNOWN
=
0
;
FICTION
=
1
;
SCIENCE
=
2
;
TECHNOLOGY
=
3
;
HISTORY
=
4
;
}
message
Author
{
string
name
=
1
;
string
country
=
2
;
string
email
=
3
;
}
message
Publisher
{
string
name
=
1
;
string
city
=
2
;
int32
established_year
=
3
;
}
message
Book
{
string
title
=
1
;
Author
author
=
2
;
// nested message
string
isbn
=
3
;
int32
publication_year
=
4
;
BookType
type
=
5
;
// enum
Publisher
publisher
=
6
;
// nested message
repeated
string
genres
=
7
;
// repeated field
double
price
=
8
;
bool
available
=
9
;
int32
page_count
=
10
;
}
message
Library
{
repeated
Book
books
=
1
;
}
service
LibraryService
{
rpc
AddBook
(
Book
)
returns
(
OperationResponse
);
rpc
FindBooks
(
SearchRequest
)
returns
(
Library
);
rpc
GetBook
(
BookRequest
)
returns
(
Book
);
}
message
OperationResponse
{
bool
success
=
1
;
string
message
=
2
;
string
book_id
=
3
;
}
message
SearchRequest
{
string
query
=
1
;
BookType
type
=
2
;
}
message
BookRequest
{
string
isbn
=
1
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment