article.proto 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. syntax = "proto3";
  2. import "base.proto";
  3. package com.ywt.gapi.user;
  4. option java_generic_services = true;
  5. option java_multiple_files = true;
  6. option java_package = "com.ywt.gapi.user";
  7. option go_package = "/gapi";
  8. //资讯 created by daiyihua
  9. message Article {
  10. int32 artId = 1; //资讯ID
  11. string artTitle = 2; //资讯标题
  12. int32 status = 3; //状态,0-未读,1-已读
  13. int32 viewCount = 4; //浏览数
  14. int32 doctorCount = 5; //推荐医生数
  15. int32 type = 6; //1-图文,2-视频, 3-文件
  16. string artContent = 7;
  17. string urlData = 8; //当type=2时,存放视频地址
  18. int32 classificationId = 9; //快讯分类id,对应articles_type_id
  19. }
  20. //快讯分类
  21. message ArticleClassification {
  22. string name = 1; //分类名称
  23. int32 id = 2; //分类id
  24. repeated Article article = 3; //快讯列表
  25. }
  26. //获取分类快讯列表请求
  27. message GetClassifiedArticlesRequest {
  28. int32 userId = 1; //用户id
  29. }
  30. //获取分类快讯列表响应
  31. message GetClassifiedArticlesResponse {
  32. Result result = 1;
  33. repeated ArticleClassification classification = 2; //分类列表
  34. int32 noReadCount = 3; //未读数量
  35. }
  36. //得到用户资讯列表Request created by daiyihua
  37. message GetArticlesRequest {
  38. int32 userId = 1;
  39. int32 pageIndex = 2; //当前页
  40. int32 pageSize = 3; //每页大小
  41. }
  42. //得到用户资讯列表 created by daiyihua
  43. message GetArticlesResponse {
  44. Result result = 1;
  45. repeated Article article = 2; //资讯
  46. int32 count = 3; //总条数
  47. int32 totalPages = 4; //总页数
  48. int32 noReadCount = 5; //未读数量
  49. }
  50. //根据资讯ID得到资讯内容Request created by daiyihua
  51. message GetArticleByIdRequest {
  52. int32 artId = 1;
  53. int32 doctorId = 2; //医生ID,用于判断医生有没有阅读文章
  54. }
  55. //根据资讯ID得到资讯内容Response created by daiyihua
  56. message GetArticleByIdResponse {
  57. Result result = 1;
  58. Article article = 2; //资讯
  59. }
  60. message GetDisplayArticleListRequest {
  61. int32 pageIndex = 1;
  62. int32 pageSize = 2;
  63. int32 doctorId = 3;
  64. }
  65. message GetDisplayArticleListResponse {
  66. int32 code = 1;
  67. string msg = 2;
  68. repeated Article article = 3; //资讯
  69. int32 count = 4; //总条数
  70. int32 totalPages = 5; //总页数
  71. }
  72. //获取资讯详情,并记录浏览相关信息
  73. message GetArticleRequest {
  74. int32 artId = 1;
  75. int32 ownerId = 2;
  76. int32 userId = 3;
  77. int32 type = 4;
  78. }
  79. message GetArticleResponse {
  80. int32 code = 1;
  81. string msg = 2;
  82. Article article = 3; //资讯
  83. }
  84. message GetPdfInfoRequest {
  85. int32 infoId = 1; //快讯id
  86. }
  87. message GetPdfInfoResponse {
  88. Result result = 1;
  89. bytes pdf = 2;
  90. }
  91. //获取医学界文章分页列表request
  92. message GetArticlesPagedListRequest {
  93. int32 terminal = 1;//终端类型
  94. string keyword = 2;//keyword for searching
  95. int32 pageIndex = 3;
  96. int32 pageSize = 4;
  97. int32 userId = 5;
  98. int32 providerId = 6;
  99. }
  100. //医学界文章
  101. message ArticleItem {
  102. int32 artId = 1; //资讯ID
  103. string title = 2; //资讯标题
  104. int32 viewCount = 3; //浏览数
  105. int32 type = 4; //1-图文,2-视频, 3-文件
  106. string digest = 5;//摘要
  107. int32 price = 6;//价格
  108. string previewUrl = 7;//预览图
  109. string author = 8;//作者
  110. string jobTitle = 9;//职称
  111. string dept = 10;//科室
  112. string hospital = 11;//医院
  113. string publishTime = 12;//发表时间
  114. int32 hasPaid = 13;//是否已购
  115. string diagnosis = 14;//诊断分类
  116. int32 likeCount = 15;//点赞数
  117. int32 videoStatus = 16;//视频转码状态:0-转码中;1-成功;2-失败
  118. string videoConvertingRemark = 17;//视频转码备注
  119. int32 auditStatus = 18;//审核状态:0-审核中;1-审核不通过;2-审核通过
  120. }
  121. //获取医学界文章分页列表response
  122. message GetArticlesPagedListResponse {
  123. int32 code = 1;
  124. string msg = 2;
  125. repeated ArticleItem article = 3; //文章
  126. int32 count = 4; //总条数
  127. int32 totalPages = 5; //总页数
  128. }
  129. message GetArticleDetailRequest {
  130. int32 artId = 1;
  131. int32 userId = 2;
  132. int32 terminal = 3;
  133. }
  134. message ArticleComment {
  135. int32 id = 1;
  136. int32 articleId = 2;
  137. int32 replyId = 3;
  138. int32 parentId = 4;
  139. string content = 5;
  140. int32 userId = 6;
  141. string createTime = 7;
  142. string updateTime = 8;
  143. string name = 9;
  144. string jobTitle = 10;
  145. string dept = 11;
  146. string hospital = 12;
  147. string avatar = 13;
  148. repeated ArticleComment replies = 14;
  149. string replyName = 15;//回复的二级评论评论者名称
  150. }
  151. message GetCommentsRequest {
  152. int32 articleId = 1;
  153. int32 pageIndex = 2;
  154. int32 pageSize = 3;
  155. int32 userId = 4;
  156. }
  157. message GetCommentsResponse {
  158. int32 code = 1;
  159. string msg = 2;
  160. repeated ArticleComment comments = 3; //评论
  161. int32 count = 4; //总条数
  162. int32 totalPages = 5; //总页数
  163. }
  164. message AddCommentRequest {
  165. int32 articleId = 1;
  166. int32 replyId = 2;
  167. int32 parentId = 3;
  168. string content = 4;
  169. int32 userId = 5;
  170. }
  171. message GetArticleDetailResponse {
  172. int32 artId = 1;
  173. string title = 2;
  174. string publishTime = 3;
  175. int32 viewCount = 4;
  176. string author = 5;
  177. string dept = 6;
  178. string hospital = 7;
  179. string jobTitle = 8;
  180. string urlData = 9;
  181. int32 type = 10;
  182. string content = 11;
  183. int32 hasPaid = 12;
  184. int32 commentCounts = 13;
  185. int32 isFavorite = 14;
  186. int32 code = 15;
  187. string msg = 16;
  188. string extra = 17;
  189. string previewUrl = 18;
  190. int32 isLike = 19;
  191. int32 likeCount = 20;
  192. repeated string likedUsers = 21;//点赞用户名
  193. string qrCode1Url = 22;
  194. string qrCode2Url = 23;
  195. string qrCode1Remark = 24;
  196. string qrCode2Remark = 25;
  197. }
  198. message OperateFavoritesRequest {
  199. int32 artId = 1;
  200. int32 userId = 2;
  201. int32 isFavorite = 3;
  202. }
  203. message GetArticlesFavoritesRequest {
  204. int32 userId = 1;
  205. int32 pageIndex = 2;
  206. int32 pageSize = 3;
  207. }
  208. message GetPaidArticlesRequest {
  209. int32 userId = 1;
  210. int32 pageIndex = 2;
  211. int32 pageSize = 3;
  212. }
  213. message GetPublishArticlesRequest {
  214. int32 userId = 1;
  215. int32 pageIndex = 2;
  216. int32 pageSize = 3;
  217. int32 currentUserId = 4;
  218. int32 terminal = 5;
  219. }
  220. message PublishMedicalFieldArticleRequest {
  221. int32 providerId = 1;
  222. string title = 2;
  223. string content = 3;
  224. string previewUrl = 4;
  225. string qrCode1Url = 5;
  226. string qrCode2Url = 6;
  227. string qrCode1Remark = 7;
  228. string qrCode2Remark = 8;
  229. }
  230. message PublishMedicalFieldArticleResponse {
  231. Result result = 1;
  232. int32 articleId = 2;
  233. }
  234. message PublishMedicalFieldVideoRequest {
  235. int32 providerId = 1;
  236. string title = 2;
  237. string videoUrl = 3;
  238. string previewUrl = 4;
  239. string specialistIntro = 5;
  240. string contentIntro = 6;
  241. string qrCode1Url = 7;
  242. string qrCode2Url = 8;
  243. string qrCode1Remark = 9;
  244. string qrCode2Remark = 10;
  245. }
  246. message PublishMedicalFieldVideoResponse {
  247. Result result = 1;
  248. int32 articleId = 2;
  249. }
  250. message EditArticleSettingRequest {
  251. int32 articleId = 1;
  252. int32 price = 2;
  253. int32 pushType = 3;
  254. int32 userId = 4;
  255. string diagnosisType = 5;//诊断分类
  256. }
  257. message GetArticleSettingRequest {
  258. int32 articleId = 1;
  259. }
  260. message GetLastArticleSettingRequest {
  261. int32 userId = 1;
  262. }
  263. message GetArticleSettingResponse {
  264. Result result = 1;
  265. int32 pushType = 2;
  266. int32 price = 3;
  267. string diagnosisType = 4;//诊断分类
  268. }
  269. message CreateOrderRequest {
  270. int32 userId = 1;
  271. int32 articleId = 2;
  272. }
  273. message CreateOrderResponse {
  274. Result result = 1;
  275. int32 orderId = 2;
  276. string orderNo = 3;
  277. int32 amount = 4;
  278. }
  279. message OrderPaymentCallbackNotifyRequest {
  280. string orderNo = 1;
  281. int32 orderId = 2;
  282. int32 payType = 3; //1: 微信; 2: 管理员线下收费
  283. string custom = 4; //回发创建单时设置的自定义数据
  284. int32 bizId = 5;
  285. string paymentNo = 6; //订单中心支付流水号
  286. int32 userId = 7;//用户id
  287. string prepayId = 8; //本次支付微信 prepay_id
  288. int32 terminal = 9; //发起支付终端
  289. string openid = 10; //完成微信支付的微信用户 openid
  290. int32 paymentChannel = 11;
  291. string oneTimeCustom = 12;//本次操作自定义数据
  292. }
  293. message OperateLikeRequest {
  294. int32 artId = 1;
  295. int32 userId = 2;
  296. int32 isLike = 3;
  297. }
  298. message GetLikedUsersRequest {
  299. int32 articleId = 1;
  300. }
  301. message LikedUserInfo {
  302. int32 id = 1;
  303. string name = 2;
  304. string avatar = 3;
  305. int32 isVirtual = 4;//是否真实点赞用户,0-真实用户,1-虚拟用户
  306. int32 userType = 5;//用户类型
  307. }
  308. message GetLikedUsersResponse {
  309. Result result = 1;
  310. repeated LikedUserInfo likedUsers = 2;
  311. }
  312. message ConvertVideoCallbackRequest {
  313. string newVideoUrl = 1;
  314. int32 articleId = 2;
  315. int32 status = 3;
  316. string remark = 4;
  317. }
  318. //药商及代表相关服务 // 对应 rpc 项目的 ArticleServiceImpl 类
  319. service ArticleService {
  320. //得到用户资讯列表 created by daiyihua
  321. rpc getArticles (GetArticlesRequest) returns (GetArticlesResponse);
  322. //根据资讯ID得到资讯内容 created by daiyihua
  323. rpc getArticleById (GetArticleByIdRequest) returns (GetArticleByIdResponse);
  324. //得到药商推送给医生的资讯列表 created by daiyihua
  325. rpc getDoctorArticles (GetArticlesRequest) returns (GetArticlesResponse);
  326. //根据资讯ID得到资讯内容 created by daiyihua
  327. rpc getDoctorArticleById (GetArticleByIdRequest) returns (GetArticleByIdResponse);
  328. //获取医生显示的文章列表
  329. rpc getDisplayArticleList (GetDisplayArticleListRequest) returns (GetDisplayArticleListResponse);
  330. //获取资讯详情,并记录浏览相关信息
  331. rpc getArticle (GetArticleRequest) returns (GetArticleResponse);
  332. //获取快讯分类列表
  333. rpc getClassifiedArticles (GetClassifiedArticlesRequest) returns (GetClassifiedArticlesResponse);
  334. //获取快讯pdf
  335. rpc getPdfInfo (GetPdfInfoRequest) returns (GetPdfInfoResponse);
  336. //获取药商推送给医生的快讯分类列表
  337. rpc getDoctorClassifiedArticles (GetClassifiedArticlesRequest) returns (GetClassifiedArticlesResponse);
  338. //获取医学界文章分页列表
  339. rpc getArticlesPagedList (GetArticlesPagedListRequest) returns (GetArticlesPagedListResponse);
  340. //获取医学界文章详情
  341. rpc getArticleDetail (GetArticleDetailRequest) returns (GetArticleDetailResponse);
  342. //处理收藏/取消收藏文章
  343. rpc operateArticleFavorite (OperateFavoritesRequest) returns (Result);
  344. //获取收藏列表
  345. rpc getArticlesFavoritesList (GetArticlesFavoritesRequest) returns (GetArticlesPagedListResponse);
  346. //获取已购列表
  347. rpc getPaidArticles (GetPaidArticlesRequest) returns (GetArticlesPagedListResponse);
  348. //获取发表列表
  349. rpc getPublishArticles (GetPublishArticlesRequest) returns (GetArticlesPagedListResponse);
  350. //发表医学界文章
  351. rpc publishMedicalFieldArticle (PublishMedicalFieldArticleRequest) returns (PublishMedicalFieldArticleResponse);
  352. //发表医学界视频
  353. rpc publishMedicalFieldVideo (PublishMedicalFieldVideoRequest) returns (PublishMedicalFieldVideoResponse);
  354. //添加评论
  355. rpc addComment (AddCommentRequest) returns (Result);
  356. //获取评论列表
  357. rpc getCommentList (GetCommentsRequest) returns (GetCommentsResponse);
  358. //修改文章设置
  359. rpc editArticleSetting (EditArticleSettingRequest) returns (Result);
  360. //获取文章设置
  361. rpc getArticleSetting (GetArticleSettingRequest) returns (GetArticleSettingResponse);
  362. //获取上一次的文章设置
  363. rpc getLastArticleSetting (GetLastArticleSettingRequest) returns (GetArticleSettingResponse);
  364. //创建订单
  365. rpc createOrder (CreateOrderRequest) returns (CreateOrderResponse);
  366. //订单支付回调
  367. rpc orderPaymentCallbackNotify (OrderPaymentCallbackNotifyRequest) returns (Result);
  368. //文章点赞操作
  369. rpc operateArticleLike (OperateLikeRequest) returns (Result);
  370. //获取点赞列表
  371. rpc getLikedUsers (GetLikedUsersRequest) returns (GetLikedUsersResponse);
  372. //视频转换后的回调方法
  373. rpc convertVideoCallback (ConvertVideoCallbackRequest) returns (Result);
  374. }