syntax = "proto3"; package stdlib; message DocQueryRequest { int32 pageNum = 1; //页码 int32 pageSize = 2; //每页数量 string keyWords = 3; //检索词 文档名检索 模糊 repeated string itemArr = 4; // 分类 []string repeated string tagArr = 5; // 标签 []string int32 publishTimeSort = 6; // 发布时间排序 1正序 2倒序 int32 downloadSort = 7; // 下载次数排序 1正序 2倒序 int32 viewSort = 8; // 浏览量排序 1正序 2倒序 } message DocQueryResponse { int32 code = 1; //响应代码 string msg = 2; //响应消息 repeated Doc docs = 3;//文档列表集合,没有分页参数 int32 total = 4; //总数 } message Doc { string docId = 1;//文档id string docName = 2;//文档名称 int32 docType = 3;//文档类型 int32 docFileSize = 4;//文档大小 int32 docPageSize = 5;//文档页码数 string tags = 6;//文档标签 string userId = 7;//上传人id string docSummary = 8; //摘要 } message DocChangeReq { string id = 1; //文档id int32 reason = 2; //处理原因 1机审通过上架 2人审通过上加 10投诉下架 11过期下架 } message DocChangeResp { bool state = 1; //是否成功 } message DocStatisticsReq { string docId = 1; //文档id int32 DocStatisticsType = 2; //文档统计类型 1增加下载次数 2增加浏览次数 3评分 } message DocGetCheckReq { string docId = 1; //文档id string userId = 2; //用户id } message DocGetCheckResp { int32 code = 1; //响应代码 string msg = 2; //响应消息 string docName = 3;//文档名称 int32 docType = 4;//文档类型 int32 docFileSize = 5;//文档大小 int32 docPageSize = 6;//文档页码数 string tags = 7;//文档标签 string userId = 8;//上传人id string docSummary = 9; //摘要 } message DocGetContentResp { int32 code = 1; //响应代码 string msg = 2; //响应消息 bytes docContent = 3; //文件内容 } message DocActivityReq { int32 pageNum = 1; //页码 int32 pageSize = 2; //每页数量 } service Stdlib { rpc DocQuery(DocQueryRequest) returns(DocQueryResponse); //文档检索 rpc DocOn(DocChangeReq) returns(DocChangeResp); //文档上架 rpc DocOff(DocChangeReq) returns(DocChangeResp); //文档下架 rpc DocStatistics(DocStatisticsReq) returns(DocChangeResp); //文档浏览次数下载次数处理 rpc DocGetCheck(DocGetCheckReq) returns(DocGetCheckResp); //获取文档-检查文档是否可获取,返回页面数据 rpc DocGetContent(DocGetCheckReq) returns(DocGetContentResp); //获取文档-页面打开pdf调用查询oss rpc DocActivity(DocActivityReq) returns(DocQueryResponse); //活动文档列表 }