shushus

Спринт 15. Пишем proto-файл.

May 31st, 2023
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. -----------------------------------------------------------------------
  2. library.proto
  3. -----------------------------------------------------------------------
  4. syntax = "proto3";
  5.  
  6. message Author {
  7.     string first_name = 1;
  8.     string last_name = 2;
  9.     uint32 birth_year = 3;
  10. }
  11.  
  12. message Publishing {
  13.     string name = 1;
  14.     string address = 2;
  15. }
  16.  
  17. message Date {
  18.     uint32 year = 1;
  19.     uint32 month = 2;
  20.     uint32 day = 3;
  21. }
  22.  
  23. message User {
  24.     uint32 id = 1;
  25.     string name = 2;
  26.     Date registration_date = 3;
  27. }
  28.  
  29. message Book {
  30.     Publishing publishing = 1;
  31.     repeated Author author = 2;
  32.     uint32 year = 3;
  33.     string name = 4;
  34.     Date borrow_date = 5;
  35.     Date return_date = 6;
  36.     repeated uint32 holder = 7;
  37. }
  38.  
  39. message Library {
  40.     repeated Book book = 1;
  41.     repeated User reader = 2;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment