api.proto 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. syntax = "proto3";
  2. // use {app_id}.{version} as package name
  3. package card.service.v1;
  4. option go_package = "v1";
  5. message AllGroupReply {
  6. ModelAllGroupResp res = 1;
  7. }
  8. message AllGroupReq {
  9. int64 mid = 2;
  10. }
  11. message CardHotsReply {
  12. repeated ModelCard data_0 = 1;
  13. }
  14. message CardHotsReq {
  15. }
  16. message CardReply {
  17. ModelCard data_0 = 1;
  18. }
  19. message CardReq {
  20. int64 id = 2;
  21. }
  22. message CardsByGidReply {
  23. repeated ModelCard data_0 = 1;
  24. }
  25. message CardsByGidReq {
  26. int64 gid = 2;
  27. }
  28. message DemountEquipReply {
  29. }
  30. message DemountEquipReq {
  31. int64 mid = 2;
  32. }
  33. message EquipReply {
  34. }
  35. message EquipReq {
  36. ModelArgEquip arg = 2;
  37. }
  38. message ModelAllGroupResp {
  39. repeated ModelGroupInfo list = 1;
  40. ModelUserCard user_card = 2;
  41. }
  42. message ModelArgEquip {
  43. int64 mid = 1;
  44. int64 card_id = 2;
  45. }
  46. message ModelCard {
  47. int64 id = 1;
  48. string name = 2;
  49. int32 state = 3;
  50. int32 deleted = 4;
  51. int32 is_hot = 5;
  52. string card_url = 6;
  53. string big_card_url = 7;
  54. int32 card_type = 8;
  55. string card_type_name = 9;
  56. }
  57. message ModelGroupInfo {
  58. int64 group_id = 1;
  59. string group_name = 2;
  60. repeated ModelCard cards = 3;
  61. }
  62. message ModelUserCard {
  63. int64 mid = 1;
  64. int64 id = 2;
  65. string card_url = 3;
  66. int32 card_type = 4;
  67. string name = 5;
  68. int64 expire_time = 6;
  69. string card_type_name = 7;
  70. string big_card_url = 8;
  71. }
  72. message UserCardReply {
  73. ModelUserCard res = 1;
  74. }
  75. message UserCardReq {
  76. int64 mid = 2;
  77. }
  78. message UserCardsReply {
  79. map<int64, ModelUserCard> res = 1;
  80. }
  81. message UserCardsReq {
  82. repeated int64 mids = 2;
  83. }
  84. service Card {
  85. // Card get card info.
  86. rpc Card(CardReq) returns(CardReply);
  87. // CardHots get card hots.
  88. rpc CardHots(CardHotsReq) returns(CardHotsReply);
  89. // CardsByGid get card by gid.
  90. rpc CardsByGid(CardsByGidReq) returns(CardsByGidReply);
  91. // UserCard get user card info.
  92. rpc UserCard(UserCardReq) returns(UserCardReply);
  93. // UserCards get user card infos.
  94. rpc UserCards(UserCardsReq) returns(UserCardsReply);
  95. // Equip user equip card.
  96. rpc Equip(EquipReq) returns(EquipReply);
  97. // DemountEquip delete equip.
  98. rpc DemountEquip(DemountEquipReq) returns(DemountEquipReply);
  99. // AllGroup all group.
  100. rpc AllGroup(AllGroupReq) returns(AllGroupReply);
  101. }