api.proto 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. syntax = "proto3";
  2. // use {app_id}.{version} as package name
  3. package account.vip;
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. option go_package = "v1";
  6. message RegisterOpenIDReq {
  7. int64 mid = 1;
  8. int64 app_id = 2;
  9. }
  10. message RegisterOpenIDReply {
  11. string open_id = 1;
  12. }
  13. message OpenBindByOutOpenIDReq {
  14. string open_id = 1;
  15. string out_open_id = 2;
  16. int64 app_id = 3;
  17. }
  18. message OpenBindByOutOpenIDReply{
  19. }
  20. message UserInfoByOpenIDReq{
  21. string ip = 1;
  22. string open_id = 2;
  23. int64 app_id = 3;
  24. }
  25. message UserInfoByOpenIDReply {
  26. string name = 1;
  27. int32 bind_state =2 [(gogoproto.jsontag) = "bind_state"];
  28. string out_open_id =3;
  29. }
  30. message BindInfoByMidReq{
  31. int64 mid = 1;
  32. int64 app_id = 2;
  33. }
  34. message BindInfoByMidReply{
  35. Account account =1;
  36. BindOuter outer =2;
  37. }
  38. message Account {
  39. int64 mid = 1;
  40. string name = 2;
  41. string face =3;
  42. }
  43. message BindOuter {
  44. string tel = 1;
  45. int32 bind_state = 2 [(gogoproto.jsontag) = "bind_state"];
  46. }
  47. message BilibiliPrizeGrantReq{
  48. string prize_key = 1;
  49. string unique_no =2;
  50. string open_id =3;
  51. int64 app_id =4;
  52. }
  53. message BilibiliPrizeGrantReply{
  54. double amount = 1;
  55. double full_amount =2;
  56. string description =3;
  57. }
  58. message BilibiliVipGrantReq{
  59. string open_id = 1;
  60. string out_open_id = 2;
  61. string out_order_no = 3;
  62. int32 duration = 4;
  63. int64 app_id = 5;
  64. }
  65. message BilibiliVipGrantReply{
  66. }
  67. message CreateAssociateOrderReq {
  68. int64 mid =1;
  69. int32 month =2;
  70. string platform=3;
  71. string mobi_app =4;
  72. string device = 5;
  73. int64 appId = 6;
  74. string appSubId = 7;
  75. int32 orderType = 8;
  76. int32 dtype =9;
  77. string returnUrl = 10;
  78. string coupon_token = 11;
  79. int64 bmid = 12;
  80. string panel_type = 13;
  81. int64 build = 14;
  82. string IP = 15;
  83. }
  84. message CreateAssociateOrderReply{
  85. string pay_param = 1;
  86. double dprice =2;
  87. double oprice =3;
  88. double coupon_money =4;
  89. }
  90. message AssociatePanelReq{
  91. int64 mid = 1;
  92. int32 SortTp =2;
  93. string IP =3;
  94. string MobiApp =4;
  95. string Device =5;
  96. string Platform =6;
  97. int32 Plat =7;
  98. string PanelType =8;
  99. int32 SubType =9;
  100. int32 Month =10;
  101. int64 Build =11;
  102. }
  103. message AssociatePanelReply{
  104. repeated AssociatePanelInfo list = 1;
  105. }
  106. message AssociatePanelInfo {
  107. int64 id =1;
  108. int32 month=2;
  109. string product_name=3;
  110. string product_id=4;
  111. int32 sub_type=5;
  112. int32 suit_type=6;
  113. double original_price =7;
  114. double discount_price =8;
  115. string discount_rate =9;
  116. string remark =10;
  117. int32 selected =11;
  118. int32 pay_state =12 [(gogoproto.jsontag) = "pay_state"];
  119. string pay_message =13;
  120. }
  121. message OpenAuthCallBackReq {
  122. int64 mid =1;
  123. string third_code =2;
  124. int64 app_id =3;
  125. }
  126. message OpenAuthCallBackReply {
  127. }
  128. message EleRedPackagesReq {
  129. }
  130. message EleRedPackagesReply{
  131. repeated ModelEleRedPackage list = 1;
  132. }
  133. message ModelEleRedPackage{
  134. string name =1;
  135. double amount =2;
  136. double sum_condition =3;
  137. }
  138. message EleSpecailFoodsReq{
  139. }
  140. message EleSpecailFoodsReply {
  141. repeated ModelEleSpecailFoods list = 1;
  142. }
  143. message ModelEleSpecailFoods {
  144. string restaurant_name = 1;
  145. string food_name =2;
  146. string food_url =3;
  147. double discount =4;
  148. double amount = 5;
  149. double original_amount = 6;
  150. double rating_point =7;
  151. }
  152. message EleVipGrantReq{
  153. string order_no =1;
  154. }
  155. message EleVipGrantReply{
  156. }
  157. message VipUserPanelReq{
  158. int64 mid = 1;
  159. int32 sortTp = 2;
  160. string ip = 3;
  161. string mobiApp = 4;
  162. string device = 5;
  163. string platform = 6;
  164. int32 plat = 7;
  165. string panelType = 8;
  166. int32 subType = 9;
  167. int32 month = 10;
  168. int64 build = 11;
  169. string lang = 12;
  170. }
  171. message VipUserPanelReply{
  172. repeated ModelVipPanelInfo price_list =1;
  173. CouponBySuitIDReply coupon =2;
  174. int32 coupon_switch =3;
  175. int32 code_switch = 4;
  176. int32 give_switch = 5;
  177. map<int32,ModelPrivilegeResp> privileges = 6;
  178. }
  179. message CouponBySuitIDReply{
  180. string coupon_tip = 1;
  181. ModelCouponAllowancePanelInfo coupon_info = 2;
  182. }
  183. message ModelCouponAllowancePanelInfo{
  184. string coupon_token = 1;
  185. double coupon_amount = 2 [(gogoproto.jsontag) = "coupon_amount"];
  186. int32 state = 3 [(gogoproto.jsontag) = "state"];
  187. string full_limit_explain = 4;
  188. string scope_explain = 5;
  189. double full_amount = 6 [(gogoproto.jsontag) = "full_amount"];
  190. double coupon_discount_price = 7 [(gogoproto.jsontag) = "coupon_discount_price"];
  191. int64 start_time = 8 [(gogoproto.jsontag) = "start_time"];
  192. int64 expire_time = 9 [(gogoproto.jsontag) = "expire_time"];
  193. int32 selected = 10 [(gogoproto.jsontag) = "selected"];
  194. string disables_explains = 11;
  195. string order_no = 12;
  196. string name = 13;
  197. int32 usable = 14 [(gogoproto.jsontag) = "usable"];
  198. }
  199. message ModelVipPanelInfo {
  200. int32 month = 1 [(gogoproto.jsontag) = "month"];
  201. string product_name = 2;
  202. string product_id = 3;
  203. int32 sub_type = 4 [(gogoproto.jsontag) = "sub_type"];
  204. int32 suit_type = 5 [(gogoproto.jsontag) = "suit_type"];
  205. double original_price = 6 [(gogoproto.jsontag) = "original_price"];
  206. double discount_price = 7 [(gogoproto.jsontag) = "discount_price"];
  207. string discount_rate = 8;
  208. string remark = 9;
  209. int32 selected = 10 [(gogoproto.jsontag) = "selected"];
  210. int64 id = 11 [(gogoproto.jsontag) = "id"];
  211. int32 type = 12 [(gogoproto.jsontag) = "type"];
  212. }
  213. message ModelPrivilegeResp{
  214. string title = 1;
  215. repeated ModelPrivilege list = 2;
  216. }
  217. message ModelPrivilege {
  218. string name = 1;
  219. string icon_url = 2;
  220. int32 type =3 [(gogoproto.jsontag) = "type"];
  221. }
  222. message CouponBySuitIDReq {
  223. int64 mid = 1;
  224. int64 sid = 2;
  225. string mobiApp = 3;
  226. string device = 4;
  227. string platform = 5;
  228. string panelType = 6;
  229. int64 build = 7;
  230. }
  231. message WelfareReq{
  232. int64 tid = 1;
  233. int64 recommend = 2;
  234. int64 ps = 3;
  235. int64 pn = 4;
  236. }
  237. message WelfareReply{
  238. int64 count = 1;
  239. repeated WelfareListDetail list = 2;
  240. }
  241. message WelfareListDetail{
  242. int32 id = 1 [(gogoproto.jsontag) = "id"];
  243. string name = 2 [(gogoproto.jsontag) = "name"];
  244. string homepage_uri = 3 [(gogoproto.jsontag) = "homepage_uri"];
  245. string backdrop_uri = 4 [(gogoproto.jsontag) = "backdrop_uri"];
  246. int32 tid = 5 [(gogoproto.jsontag) = "tid"];
  247. int32 rank = 6 [(gogoproto.jsontag) = "rank"];
  248. }
  249. message WelfareTypeReq{
  250. }
  251. message WelfareTypeReply{
  252. repeated WelfareTypeListDetail list = 1;
  253. }
  254. message WelfareTypeListDetail{
  255. int32 id = 1 [(gogoproto.jsontag) = "id"];
  256. string name = 2 [(gogoproto.jsontag) = "name"];
  257. }
  258. message WelfareInfoReq{
  259. int64 id = 1;
  260. int64 mid = 2;
  261. }
  262. message WelfareInfoReply{
  263. int32 id = 1 [(gogoproto.jsontag) = "id"];
  264. string name = 2 [(gogoproto.jsontag) = "name"];
  265. string desc = 3 [(gogoproto.jsontag) = "desc"];
  266. string homepage_uri = 4 [(gogoproto.jsontag) = "homepage_uri"];
  267. string backdrop_uri = 5 [(gogoproto.jsontag) = "backdrop_uri"];
  268. bool finished = 6 [(gogoproto.jsontag) = "finished"];
  269. bool received = 7 [(gogoproto.jsontag) = "received"];
  270. int64 vip_type = 8 [(gogoproto.jsontag) = "vip_type"];
  271. int64 stime = 9 [(gogoproto.jsontag) = "stime"];
  272. int64 etime = 10 [(gogoproto.jsontag) = "etime"];
  273. }
  274. message WelfareReceiveReq{
  275. int64 wid = 1;
  276. int64 mid = 2;
  277. }
  278. message WelfareReceiveReply{
  279. }
  280. message MyWelfareReq{
  281. int64 mid = 1;
  282. }
  283. message MyWelfareReply{
  284. repeated MyWelfareDetail list = 1;
  285. }
  286. message MyWelfareDetail{
  287. int32 wid = 1 [(gogoproto.jsontag) = "wid"];
  288. string name = 2 [(gogoproto.jsontag) = "name"];
  289. string desc = 3 [(gogoproto.jsontag) = "desc"];
  290. int32 usage_form = 4 [(gogoproto.jsontag) = "usage_form"];
  291. string receive_uri = 5 [(gogoproto.jsontag) = "receive_uri"];
  292. string code = 6 [(gogoproto.jsontag) = "code"];
  293. int64 stime = 7 [(gogoproto.jsontag) = "stime"];
  294. int64 etime = 8 [(gogoproto.jsontag) = "etime"];
  295. bool expired = 9 [(gogoproto.jsontag) = "expired"];
  296. }
  297. service Vip {
  298. // RegisterOpenIDReq register by mid.
  299. rpc RegisterOpenID(RegisterOpenIDReq) returns(RegisterOpenIDReply);
  300. // OpenBindByOutOpenID associate user bind by out_open_id [third -> bilibili].
  301. rpc OpenBindByOutOpenID(OpenBindByOutOpenIDReq) returns(OpenBindByOutOpenIDReply);
  302. // UserInfoByOpenID get userinfo by open_id.
  303. rpc UserInfoByOpenID(UserInfoByOpenIDReq) returns(UserInfoByOpenIDReply);
  304. // BindInfoByMid bind info by mid[bilibili->third].
  305. rpc BindInfoByMid(BindInfoByMidReq) returns(BindInfoByMidReply);
  306. // BilibiliPrizeGrant bilibili associate vip grant.
  307. rpc BilibiliPrizeGrant(BilibiliPrizeGrantReq) returns(BilibiliPrizeGrantReply);
  308. // BilibiliVipGrant bilibili associate vip grant.
  309. rpc BilibiliVipGrant(BilibiliVipGrantReq) returns(BilibiliVipGrantReply);
  310. // CreateAssociateOrder create associate order.
  311. rpc CreateAssociateOrder(CreateAssociateOrderReq) returns(CreateAssociateOrderReply);
  312. // AssociatePanel associate panel.
  313. rpc AssociatePanel(AssociatePanelReq) returns(AssociatePanelReply);
  314. // OpenAuthCallBack third open call back.
  315. rpc OpenAuthCallBack(OpenAuthCallBackReq) returns(OpenAuthCallBackReply);
  316. // EleRedPackages ele red packages.
  317. rpc EleRedPackages(EleRedPackagesReq) returns(EleRedPackagesReply);
  318. // EleRedPackages ele specail foods.
  319. rpc EleSpecailFoods(EleSpecailFoodsReq) returns(EleSpecailFoodsReply);
  320. // EleVipGrant ele vip grant [bilibili -> third].
  321. rpc EleVipGrant(EleVipGrantReq) returns(EleVipGrantReply);
  322. // VipUserPanel vip user panel
  323. rpc VipUserPanel(VipUserPanelReq) returns(VipUserPanelReply);
  324. // CouponBySuitID get coupon by mid and suit info.
  325. rpc CouponBySuitID(CouponBySuitIDReq) returns(CouponBySuitIDReply);
  326. // WelfareList get Welfare list
  327. rpc WelfareList(WelfareReq) returns(WelfareReply);
  328. // WelfareTypeList get Welfare type list
  329. rpc WelfareTypeList(WelfareTypeReq) returns(WelfareTypeReply);
  330. // WelfareInfo get Welfare detail
  331. rpc WelfareInfo(WelfareInfoReq) returns(WelfareInfoReply);
  332. // WelfareReceive receive welfare
  333. rpc WelfareReceive(WelfareReceiveReq) returns(WelfareReceiveReply);
  334. // MyWelfare get my welfares
  335. rpc MyWelfare(MyWelfareReq) returns(MyWelfareReply);
  336. }