tulip.proto 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. syntax = "proto3";
  2. option java_multiple_files = true;
  3. option java_package = "com.github.iapt_platform.mint.plugins.tulip.v1";
  4. package mint.tulip.v1;
  5. // ----------------------------------------------------------------------------
  6. message SearchRequest {
  7. repeated string keywords = 1;
  8. repeated int32 books = 2;
  9. string match_mode = 3;
  10. message Page {
  11. int32 index = 1;
  12. int32 size = 2;
  13. }
  14. optional Page page = 99;
  15. }
  16. message SearchResponse {
  17. message Item {
  18. float rank = 1;
  19. string highlight = 2;
  20. int32 book = 3;
  21. int32 paragraph = 4;
  22. string content = 5;
  23. }
  24. repeated Item items = 1;
  25. SearchRequest.Page page = 98;
  26. int32 total = 99;
  27. }
  28. message BookListResponse {
  29. message Item {
  30. int32 book = 1;
  31. int32 count = 2;
  32. }
  33. repeated Item items = 1;
  34. }
  35. message UpdateRequest {
  36. int32 book = 1;
  37. int32 paragraph = 2;
  38. int32 level = 3;
  39. string bold1 = 4;
  40. string bold2 = 5;
  41. string bold3 = 6;
  42. string content = 7;
  43. int32 pcd_book_id = 8;
  44. }
  45. message UpdateResponse{
  46. int32 count = 1;
  47. }
  48. message UpdateIndexRequest{
  49. int32 book = 1;
  50. optional int32 paragraph = 2;
  51. }
  52. message UpdateIndexResponse{
  53. int32 error = 1;
  54. }
  55. message UploadDictionaryRequest{
  56. string data = 1;
  57. }
  58. message UploadDictionaryResponse{
  59. int32 error = 1;
  60. }
  61. service Search {
  62. rpc Pali(SearchRequest) returns (SearchResponse) {}
  63. rpc BookList(SearchRequest) returns (BookListResponse) {}
  64. rpc Update(UpdateRequest) returns (UpdateResponse) {}
  65. rpc UpdateIndex(UpdateIndexRequest) returns (UpdateIndexResponse) {}
  66. rpc UploadDictionary(UploadDictionaryRequest) returns (UploadDictionaryResponse) {}
  67. }
  68. // ----------------------------------------------------------------------------