stdlib.proto 4.9 KB

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