stdlib.proto 4.1 KB

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