2
0

tulip.proto 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. message Page {
  10. int32 index = 1;
  11. int32 size = 2;
  12. }
  13. optional Page page = 99;
  14. }
  15. message SearchResponse {
  16. message Item {
  17. int32 rank = 1;
  18. string highlight = 2;
  19. int32 book = 3;
  20. int32 paragraph = 4;
  21. string content = 5;
  22. }
  23. repeated Item items = 1;
  24. SearchRequest.Page page = 98;
  25. int32 total = 99;
  26. }
  27. message UpdateRequest {
  28. int32 book = 1;
  29. int32 paragraph = 2;
  30. int32 level = 3;
  31. string bold1 = 4;
  32. string bold2 = 5;
  33. string bold3 = 6;
  34. string content = 7;
  35. int32 pcd_book_id = 8;
  36. }
  37. message UpdateResponse{
  38. int32 count = 1;
  39. }
  40. message UpdateIndexRequest{
  41. int32 book = 1;
  42. optional int32 paragraph = 2;
  43. }
  44. message UpdateIndexResponse{
  45. int32 error = 1;
  46. }
  47. message UploadDictionaryRequest{
  48. string data = 1;
  49. }
  50. message UploadDictionaryResponse{
  51. int32 error = 1;
  52. }
  53. service Search {
  54. rpc Pali(SearchRequest) returns (SearchResponse) {}
  55. rpc Update(UpdateRequest) returns (UpdateResponse) {}
  56. rpc UploadDictionary(UploadDictionaryRequest) returns (UploadDictionaryResponse) {}
  57. rpc UpdateIndex(UpdateIndexRequest) returns (UpdateIndexResponse) {}
  58. }
  59. // ----------------------------------------------------------------------------