syntax = "proto3"; package stdlib; message DocQueryRequest { int64 pageNum = 1; //页码 int64 pageSize = 2; //每页数量 string keyWord = 3; //检索词 文档名检索 模糊 repeated string docClass = 4; // 分类 []string repeated string docTag = 5; // 标签 []string int64 updateDateSort = 6; // 上传时间排序 1正序 -1倒序 int64 downloadSort = 7; // 下载次数排序 1正序 -1倒序 int64 viewSort = 8; // 浏览量排序 1正序 -1倒序 string userId = 9; //用户id } message DocQueryResponse { int64 code = 1; //响应代码 string msg = 2; //响应消息 repeated Doc docs = 3;//文档列表集合,没有分页参数 int64 total = 4; //总数 } message Doc { string docId = 1;//文档id string docName = 2;//文档名称 int64 price = 3;//价格 int64 docFileSize = 4;//文档大小 int64 docPageSize = 5;//文档页码数 int64 downTimes = 6;//下载次数 int64 viewTimes = 7;//浏览次数 string uploadDate = 8;//上传时间 string docSummary = 9; //摘要 string docFileType = 10;//文档类型 } message DocChangeReq { string id = 1; //文档id int32 reason = 2; //处理原因 1机审通过上架 2人审通过上加 10投诉下架 11过期下架 string appId = 3; //appId } message DocChangeResp { bool state = 1; //是否成功 } message DocStatisticsReq { string docId = 1; //文档id int32 DocStatisticsType = 2; //文档统计类型 1增加下载次数 2增加浏览次数 3评分 string appId = 3; //appId } message DocGetCheckReq { string docId = 1; //文档id string userId = 2; //用户id string appId = 3; //appId } 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; //每页数量 string appId = 3; //appId } message DocActivity { string docId = 1; //文档id int32 activityId = 2; //活动id string docTitle = 3; //文档标题 string docSummary = 4; //文档摘要 string docImg = 5; //文档配图 int32 price = 6; //活动价 int32 costPrice = 7; //成本价 } message DocActivityResp { int32 code = 1; //响应代码 string msg = 2; //响应消息 repeated DocActivity docs = 3;//活动文档列表 int32 total = 4; //总数 } 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(DocActivityResp); //活动文档列表 }