stdlib.proto 5.0 KB

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