stdlib.proto 4.4 KB

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