stdlib.proto 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. syntax = "proto3";
  2. package stdlib;
  3. message DocQueryRequest {
  4. int64 pageNum = 1; //页码
  5. int64 pageSize = 2; //每页数量
  6. string keyWord = 3; //检索词 文档名检索 模糊
  7. repeated string classLevelOne = 4; // 一级分类 []string
  8. repeated string classLevelTwo = 5; // 二级分类 []string
  9. repeated string tag = 6; // 标签 []string
  10. int64 updateDateSort = 7; // 上传时间排序 1正序 -1倒序
  11. int64 downloadSort = 8; // 下载次数排序 1正序 -1倒序
  12. int64 viewSort = 9; // 浏览量排序 1正序 -1倒序
  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. string uploadDate = 7;//上传时间
  28. string docSummary = 8; //摘要
  29. }
  30. message DocChangeReq {
  31. string id = 1; //文档id
  32. int32 reason = 2; //处理原因 1机审通过上架 2人审通过上加 10投诉下架 11过期下架
  33. }
  34. message DocChangeResp {
  35. bool state = 1; //是否成功
  36. }
  37. message DocStatisticsReq {
  38. string docId = 1; //文档id
  39. int32 DocStatisticsType = 2; //文档统计类型 1增加下载次数 2增加浏览次数 3评分
  40. }
  41. message DocGetCheckReq {
  42. string docId = 1; //文档id
  43. string userId = 2; //用户id
  44. }
  45. message DocGetCheckResp {
  46. int32 code = 1; //响应代码
  47. string msg = 2; //响应消息
  48. string docName = 3;//文档名称
  49. int32 docType = 4;//文档类型
  50. int32 docFileSize = 5;//文档大小
  51. int32 docPageSize = 6;//文档页码数
  52. string tags = 7;//文档标签
  53. string userId = 8;//上传人id
  54. string docSummary = 9; //摘要
  55. }
  56. message DocGetContentResp {
  57. int32 code = 1; //响应代码
  58. string msg = 2; //响应消息
  59. bytes docContent = 3; //文件内容
  60. }
  61. message DocActivityReq {
  62. int32 pageNum = 1; //页码
  63. int32 pageSize = 2; //每页数量
  64. }
  65. message DocActivity {
  66. string docId = 1; //文档id
  67. int32 activityId = 2; //活动id
  68. string docTitle = 3; //文档标题
  69. string docSummary = 4; //文档摘要
  70. string docImg = 5; //文档配图
  71. int32 price = 6; //活动价
  72. int32 costPrice = 7; //成本价
  73. }
  74. message DocActivityResp {
  75. int32 code = 1; //响应代码
  76. string msg = 2; //响应消息
  77. repeated DocActivity docs = 3;//活动文档列表
  78. int32 total = 4; //总数
  79. }
  80. service Stdlib {
  81. rpc DocQuery(DocQueryRequest) returns(DocQueryResponse); //文档检索
  82. rpc DocOn(DocChangeReq) returns(DocChangeResp); //文档上架
  83. rpc DocOff(DocChangeReq) returns(DocChangeResp); //文档下架
  84. rpc DocStatistics(DocStatisticsReq) returns(DocChangeResp); //文档浏览次数下载次数处理
  85. rpc DocGetCheck(DocGetCheckReq) returns(DocGetCheckResp); //获取文档-检查文档是否可获取,返回页面数据
  86. rpc DocGetContent(DocGetCheckReq) returns(DocGetContentResp); //获取文档-页面打开pdf调用查询oss
  87. rpc DocActivity(DocActivityReq) returns(DocActivityResp); //活动文档列表
  88. }