stdlib.proto 3.1 KB

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