stdlib.proto 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. syntax = "proto3";
  2. package stdlib;
  3. message DocQueryRequest {
  4. int64 pageNum = 1; //页码
  5. int64 pageSize = 2; //每页数量
  6. string keyWord = 3; //检索词 文档名检索 模糊
  7. repeated string docClass = 4; // 分类 []string
  8. repeated string docTag = 5; // 标签 []string
  9. repeated string sort = 6; //默认正序,倒序字段前加-,uploadDate:上架时间 viewTimes:浏览量 downTimes:下载量
  10. string userId = 7; //用户id
  11. string appId = 8; //appId
  12. }
  13. message DocQueryResponse {
  14. int64 code = 1; //响应代码
  15. string msg = 2; //响应消息
  16. repeated Doc docs = 3;//文档列表集合,没有分页参数
  17. int64 total = 4; //总数
  18. }
  19. message Doc {
  20. string docId = 1;//文档id
  21. string docName = 2;//文档名称
  22. int64 price = 3;//价格
  23. int64 docFileSize = 4;//文档大小
  24. int64 docPageSize = 5;//文档页码数
  25. int64 downTimes = 6;//下载次数
  26. int64 viewTimes = 7;//浏览次数
  27. string uploadDate = 8;//上传时间
  28. string docSummary = 9; //摘要
  29. string docFileType = 10;//文档类型
  30. int64 isDownload = 11;//是否转存 0:未转存 1:转存
  31. }
  32. message DocChangeReq {
  33. string id = 1; //文档id
  34. int32 reason = 2; //处理原因 1机审通过上架 2人审通过上加 10投诉下架 11过期下架
  35. string appId = 3; //appId
  36. }
  37. message DocChangeResp {
  38. bool state = 1; //是否成功
  39. }
  40. message DocStatisticsReq {
  41. string docId = 1; //文档id
  42. int32 DocStatisticsType = 2; //文档统计类型 1增加下载次数 2增加浏览次数 3评分
  43. string appId = 3; //appId
  44. }
  45. message DocGetCheckReq {
  46. string docId = 1; //文档id
  47. string userId = 2; //用户id
  48. string appId = 3; //appId
  49. }
  50. message DocGetCheckResp {
  51. int64 code = 1; //响应代码
  52. string msg = 2; //响应消息
  53. bool isBuy = 3; //是否购买
  54. bool isCollect = 4; //是否收藏
  55. DocInfo DocDeail = 5;
  56. }
  57. message DocInfo {
  58. string docId = 1;//文档id
  59. string docName = 2;//文档名称
  60. int64 price = 3;//价格
  61. int64 docFileSize = 4;//文档大小
  62. int64 docPageSize = 5;//文档页码数
  63. string tags = 6;//文档标签
  64. int64 downTimes = 7;//下载次数
  65. int64 viewTimes = 8;//浏览次数
  66. string uploadDate = 9;//上传时间
  67. string docSummary = 10; //摘要
  68. int64 docFileType = 11;//文档类型
  69. string previewImgId = 12; //缩略图oss
  70. string ossPdfId = 13; //pdf oss
  71. string ossDocId = 14; //doc oss
  72. }
  73. message DocGetContentResp {
  74. int32 code = 1; //响应代码
  75. string msg = 2; //响应消息
  76. bytes docContent = 3; //文件内容
  77. }
  78. message DocActivityReq {
  79. int64 pageNum = 1; //页码
  80. int64 pageSize = 2; //每页数量
  81. string appId = 3; //appId
  82. string userId = 4; //当前用户id
  83. int64 activityId = 5; //活动id
  84. }
  85. message DocActivity {
  86. string docId = 1; //文档id
  87. int64 activityId = 2; //活动id
  88. string docTitle = 3; //文档标题
  89. string docSummary = 4; //文档摘要
  90. string docImg = 5; //文档配图
  91. int64 price = 6; //活动价
  92. int64 costPrice = 7; //成本价
  93. int64 downTimes = 8; //下载次数
  94. string sourceUserId = 9; //贡献人
  95. int64 docFileSize = 10; //文件大小
  96. int64 docPageSize = 11; //页码数
  97. int64 docFileType = 12; //文件类型,1 doc 2 pdf 3 xls 4 ppt 5 txt 6 其他
  98. string uploadDate = 13; //上传时间
  99. bool isBuy = 14; //是否购买
  100. }
  101. message DocActivityResp {
  102. int32 code = 1; //响应代码
  103. string msg = 2; //响应消息
  104. repeated DocActivity docs = 3;//活动文档列表
  105. int32 total = 4; //总数
  106. }
  107. service Stdlib {
  108. rpc DocQuery(DocQueryRequest) returns(DocQueryResponse); //文档检索
  109. rpc DocOn(DocChangeReq) returns(DocChangeResp); //文档上架
  110. rpc DocOff(DocChangeReq) returns(DocChangeResp); //文档下架
  111. rpc DocStatistics(DocStatisticsReq) returns(DocChangeResp); //文档浏览次数下载次数处理
  112. rpc DocGetCheck(DocGetCheckReq) returns(DocGetCheckResp); //获取文档-检查文档是否可获取,返回页面数据
  113. rpc DocGetContent(DocGetCheckReq) returns(DocGetContentResp); //获取文档-页面打开pdf调用查询oss
  114. rpc DocActivity(DocActivityReq) returns(DocActivityResp); //活动文档列表
  115. }