card.proto 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. syntax = "proto3";
  2. package card;
  3. option go_package = "ttmylife.com/zeuszhao/types/card;card";
  4. option java_multiple_files = true;
  5. option java_package = "card";
  6. import "third_party/google/api/annotations.proto";
  7. import "common/user/account.proto";
  8. import "card/common/card.proto";
  9. import "common/aliyun/alioss.proto";
  10. import "common/pagination/pagination.proto";
  11. service Card {
  12. rpc CreateAccountUser (CreateAccountUserRequest) returns (CreateAccountUserReply) {
  13. option (google.api.http) = {
  14. post: "/v1/account/create"
  15. body: "*"
  16. };
  17. }
  18. rpc LoginAccount (LoginAccountRequest) returns (LoginAccountReply) {
  19. option (google.api.http) = {
  20. post: "/v1/account/login"
  21. body: "*"
  22. };
  23. }
  24. rpc WxRegisterLogin(WxRegisterLoginRequest) returns (WxRegisterLoginReply) {
  25. option (google.api.http) = {
  26. post: "/v1/account/wx/login"
  27. body: "*"
  28. };
  29. }
  30. rpc CreateCard(CreateCardRequest) returns (CreateCardReply) {
  31. option (google.api.http) = {
  32. post: "/v1/card/create"
  33. body: "*"
  34. };
  35. }
  36. rpc GetCardInfo(GetCardInfoRequest) returns (GetCardInfoReply) {
  37. option (google.api.http) = {
  38. post: "/v1/card/info"
  39. body: "*"
  40. };
  41. }
  42. rpc GetMyCards(GetMyCardsRequest) returns (GetMyCardsReply) {
  43. option (google.api.http) = {
  44. post: "/v1/cards"
  45. body: "*"
  46. };
  47. }
  48. rpc DelCard(DelCardInfoRequest) returns (DelCardReply) {
  49. option (google.api.http) = {
  50. post: "/v1/card/del"
  51. body: "*"
  52. };
  53. }
  54. rpc SaveCard(SaveCardInfoRequest) returns (SaveCardReply) {
  55. option (google.api.http) = {
  56. post: "/v1/card/save"
  57. body: "*"
  58. };
  59. }
  60. rpc SearchCard(SearchCardRequest) returns (SearchCardReply) {
  61. option (google.api.http) = {
  62. post: "/v1/card/search"
  63. body: "*"
  64. };
  65. }
  66. rpc GetTemplates(GetTemplatesRequest) returns (GetTemplatesReply) {
  67. option (google.api.http) = {
  68. post: "/v1/card/templates"
  69. body: "*"
  70. };
  71. }
  72. rpc CreateShareToken(CreateShareTokenRequest) returns (CreateShareTokenReply) {
  73. option (google.api.http) = {
  74. post: "/v1/card/token/create"
  75. body: "*"
  76. };
  77. }
  78. rpc AddCardByShareToken(AddCardByShareTokenRequest) returns (AddCardByShareTokenReply) {
  79. option (google.api.http) = {
  80. post: "/v1/card/user/bind"
  81. body: "*"
  82. };
  83. }
  84. rpc OCRCard(OCRCardRequest) returns (OCRCardReply) {
  85. option (google.api.http) = {
  86. post: "/v1/card/ocr"
  87. body: "*"
  88. };
  89. }
  90. rpc OssUpload(OssUploadRequest) returns (OssUploadReplay) {
  91. option (google.api.http) = {
  92. post: "/v1/card/ossupload"
  93. body: "*"
  94. };
  95. }
  96. }
  97. message OssUploadRequest{}
  98. message OssUploadReplay {
  99. aliyun.Oss body = 1;
  100. }
  101. message OCRCardRequest {
  102. string url = 1;
  103. }
  104. message OCRCardReply {
  105. common.CardBaseBody body = 1;
  106. repeated common.CardSupplementBaseBody supplements = 2;
  107. }
  108. message AddCardByShareTokenRequest {
  109. string token = 1;
  110. }
  111. message AddCardByShareTokenReply {
  112. bool ok = 1;
  113. }
  114. message CreateShareTokenRequest {
  115. uint32 card_id = 1;
  116. }
  117. message CreateShareTokenReply {
  118. string token = 1;
  119. string expire = 2;
  120. }
  121. message GetTemplatesRequest {}
  122. message GetTemplatesReply {
  123. repeated common.CardTemplateBody templates = 1;
  124. }
  125. message WxRegisterLoginRequest {
  126. string code = 1;
  127. }
  128. message WxRegisterLoginReply {
  129. string token = 1;
  130. }
  131. message GetMyCardsRequest {
  132. }
  133. message GetMyCardsReply {
  134. repeated common.CardBody cards = 1;
  135. repeated common.CardSupplementBaseBody supplements = 2;
  136. repeated common.CardTemplateBody templates = 3;
  137. }
  138. message SearchCardRequest {
  139. common.CardFilterBody filter = 1;
  140. pagination.PaginationBody page = 2;
  141. }
  142. message SearchCardReply {
  143. repeated common.CardBody cards = 1;
  144. repeated common.CardSupplementBaseBody supplements = 2;
  145. uint32 total = 3;
  146. }
  147. message SaveCardInfoRequest {
  148. uint32 card_id = 1;
  149. common.CardBaseBody card = 2;
  150. repeated common.CardSupplementBaseBody supplements = 3;
  151. }
  152. message SaveCardReply {
  153. bool ok = 1;
  154. }
  155. message DelCardInfoRequest {
  156. uint32 card_id = 1;
  157. }
  158. message DelCardReply {
  159. bool ok = 1;
  160. }
  161. message GetCardInfoRequest {
  162. uint32 card_id = 1;
  163. }
  164. message GetCardInfoReply {
  165. common.CardBaseBody card = 1;
  166. repeated common.CardSupplementBaseBody supplements = 2;
  167. common.CardTemplateBaseBody template = 3;
  168. }
  169. message CreateCardRequest {
  170. common.CardBaseBody card = 1;
  171. repeated common.CardSupplementBaseBody supplements = 2;
  172. }
  173. message CreateCardReply {
  174. uint32 id = 1;
  175. }
  176. message LoginAccountRequest {
  177. user.AccountBaseBody account = 1;
  178. }
  179. message LoginAccountReply {
  180. string token = 1;
  181. }
  182. message CreateAccountUserRequest {
  183. user.AccountBaseBody account = 1;
  184. }
  185. message CreateAccountUserReply {
  186. bool ok = 1;
  187. }