李哲 4 лет назад
Родитель
Сommit
3a0a9f0c12

+ 1 - 1
go.mod

@@ -3,7 +3,7 @@ module app.yhyue.com/moapp/jy_docs
 go 1.14
 
 require (
-	app.yhyue.com/moapp/jybase v0.0.0-20210317020927-18b0165f5ff9
+	app.yhyue.com/moapp/jybase v0.0.0-20210318061912-f5594310c8fe
 	app.yhyue.com/moapp/jyfs v0.0.0-20210309070327-ecad67beabb8
 	github.com/golang/protobuf v1.4.3
 	github.com/mailru/easyjson v0.7.7 // indirect

+ 2 - 2
go.sum

@@ -1,5 +1,5 @@
-app.yhyue.com/moapp/jybase v0.0.0-20210317020927-18b0165f5ff9 h1:LVIuqXMqcclMwBbSmqEzXi0nIEiir+a2GpWAqksmfzk=
-app.yhyue.com/moapp/jybase v0.0.0-20210317020927-18b0165f5ff9/go.mod h1:29ShuI8y7qEyg2KviHSx1iamiCioBKdTMm2ndVzWAhk=
+app.yhyue.com/moapp/jybase v0.0.0-20210318061912-f5594310c8fe h1:RSQIrriyi534CCrI/sSLGW+Rd0X/0W4VDDXIalHVo8c=
+app.yhyue.com/moapp/jybase v0.0.0-20210318061912-f5594310c8fe/go.mod h1:29ShuI8y7qEyg2KviHSx1iamiCioBKdTMm2ndVzWAhk=
 app.yhyue.com/moapp/jyfs v0.0.0-20210309070327-ecad67beabb8 h1:Mg5E4O+5mCjRyW2b4/bNRQMz8ilzWfa7qaOjKT7SNRY=
 app.yhyue.com/moapp/jyfs v0.0.0-20210309070327-ecad67beabb8/go.mod h1:iflE6z/Ee5f7YZy2DSj7S6asyL1yCbu3BjK/xMYMiDY=
 github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=

+ 1 - 1
rpc/stdlib/internal/logic/docactivitylogic.go

@@ -31,7 +31,7 @@ func (l *DocActivityLogic) DocActivity(in *stdlib.DocActivityReq) (*stdlib.DocAc
 	if int(in.PageNum) <= 0 {
 		pageNum = 0
 	}
-	res, count := stdlibService.DocActivityList(int(in.PageSize), pageNum, in.AppId)
+	res, count := stdlibService.DocActivityList(int(in.PageSize), pageNum, int(in.ActivityId), in.AppId)
 	docActivityResp := &stdlib.DocActivityResp{Code: 0, Msg: "ok", Total: int32(count)}
 	log.Println("res ", res)
 	log.Println("count ", count)

+ 2 - 0
rpc/stdlib/internal/logic/docgetchecklogic.go

@@ -2,6 +2,7 @@ package logic
 
 import (
 	"context"
+	"log"
 
 	stdlibService "app.yhyue.com/moapp/jy_docs/services/stdlib"
 
@@ -28,5 +29,6 @@ func NewDocGetCheckLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocGe
 func (l *DocGetCheckLogic) DocGetCheck(in *stdlib.DocGetCheckReq) (*stdlib.DocGetCheckResp, error) {
 	// todo: add your logic here and delete this line
 	res := stdlibService.DocGetCheck(in.DocId, in.UserId, in.AppId)
+	log.Println("res ", res)
 	return &res, nil
 }

+ 24 - 24
rpc/stdlib/internal/logic/docquerylogic.go

@@ -2,12 +2,12 @@ package logic
 
 import (
 	"context"
+	"fmt"
+	"strings"
 
 	"app.yhyue.com/moapp/jy_docs/rpc/stdlib/internal/svc"
 	"app.yhyue.com/moapp/jy_docs/rpc/stdlib/stdlib"
 	stdlibService "app.yhyue.com/moapp/jy_docs/services/stdlib"
-	"app.yhyue.com/moapp/jy_docs/services/util"
-	"app.yhyue.com/moapp/jybase/common"
 	"github.com/tal-tech/go-zero/core/logx"
 )
 
@@ -17,6 +17,14 @@ type DocQueryLogic struct {
 	logx.Logger
 }
 
+var (
+	QuerySort = map[string]bool{
+		"uploadDate": true,
+		"viewTimes":  true,
+		"downTimes":  true,
+	}
+)
+
 func NewDocQueryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocQueryLogic {
 	return &DocQueryLogic{
 		ctx:    ctx,
@@ -26,30 +34,22 @@ func NewDocQueryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocQuery
 }
 
 func (l *DocQueryLogic) DocQuery(in *stdlib.DocQueryRequest) (*stdlib.DocQueryResponse, error) {
-	if in.PageNum <= 1 {
+	if in.PageNum < 1 {
 		in.PageNum = 1
 	}
-	total, list := stdlibService.FindDocumentsByKeyWords(in.KeyWord, in.DocClass, in.DocTag, in.UpdateDateSort, in.DownloadSort, in.ViewSort, in.PageNum, in.PageSize)
-	docs := []*stdlib.Doc{}
-	if list != nil {
-		for _, v := range *list {
-			docs = append(docs, &stdlib.Doc{
-				DocId:       common.ObjToString(v["id"]),
-				DocName:     common.ObjToString(v["docName"]),
-				Price:       common.Int64All(v["price"]),
-				DocPageSize: common.Int64All(v["docPageSize"]),
-				DocFileSize: common.Int64All(v["docFileSize"]),
-				DownTimes:   common.Int64All(v["downTimes"]),
-				ViewTimes:   common.Int64All(v["viewTimes"]),
-				UploadDate:  common.ObjToString(v["uploadDate"]),
-				DocSummary:  common.ObjToString(v["docSummary"]),
-				DocFileType: util.DocFileType[common.IntAll(v["docFileType"])],
-			})
+	if in.UserId != "" && in.AppId == "" {
+		return &stdlib.DocQueryResponse{
+			Code: 0,
+			Msg:  "缺少参数appId",
+		}, nil
+	}
+	for _, v := range in.Sort {
+		if !QuerySort[v] && !QuerySort[strings.TrimLeft(v, "-")] {
+			return &stdlib.DocQueryResponse{
+				Code: 0,
+				Msg:  fmt.Sprintf("sort数组中%s值不合法", v),
+			}, nil
 		}
 	}
-	return &stdlib.DocQueryResponse{
-		Total: total,
-		Docs:  docs,
-		Code:  1,
-	}, nil
+	return stdlibService.DocQuery(in), nil
 }

+ 23 - 12
rpc/stdlib/stdlib.proto

@@ -8,10 +8,9 @@ message DocQueryRequest {
   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
+  repeated string sort = 6; //默认正序,倒序字段前加-,uploadDate:上架时间 viewTimes:浏览量 downTimes:下载量
+  string userId = 7; //用户id
+  string appId = 8; //appId
 }
 
 message DocQueryResponse {
@@ -32,6 +31,7 @@ message Doc {
   string uploadDate = 8;//上传时间
   string docSummary = 9; //摘要
   string docFileType = 10;//文档类型
+  int64 isDownload = 11;//是否转存 0:未转存 1:转存
 }
 
 message DocChangeReq {
@@ -57,15 +57,25 @@ message DocGetCheckReq {
 }
 
 message DocGetCheckResp {
-  int32 code = 1;    //响应代码
+  int64 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; //摘要
+  bool isBuy = 3; //是否购买
+  DocInfo DocDeail = 4;
+}
+
+message DocInfo {
+  string docId = 1;//文档id
+  string docName = 2;//文档名称
+  int64 price = 3;//价格
+  int64 docFileSize = 4;//文档大小
+  int64 docPageSize = 5;//文档页码数
+  string tags = 6;//文档标签
+  int64 downTimes = 7;//下载次数
+  int64 viewTimes = 8;//浏览次数
+  string uploadDate = 9;//上传时间
+  string docSummary = 10; //摘要
+  int64 docFileType = 11;//文档类型
+  string previewImgId = 12; //缩略图oss
 }
 
 message DocGetContentResp {
@@ -78,6 +88,7 @@ message DocActivityReq {
   int32 pageNum = 1; //页码 
   int32 pageSize = 2; //每页数量
   string appId = 3; //appId
+  int32 activityId = 4; //活动id
 }
 
 message DocActivity {

+ 351 - 219
rpc/stdlib/stdlib/stdlib.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
-// 	protoc-gen-go v1.23.0
-// 	protoc        v3.11.4
+// 	protoc-gen-go v1.25.0
+// 	protoc        v3.15.6
 // source: stdlib.proto
 
 package stdlib
@@ -34,15 +34,14 @@ type DocQueryRequest struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	PageNum        int64    `protobuf:"varint,1,opt,name=pageNum,proto3" json:"pageNum,omitempty"`               //页码
-	PageSize       int64    `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"`             //每页数量
-	KeyWord        string   `protobuf:"bytes,3,opt,name=keyWord,proto3" json:"keyWord,omitempty"`                //检索词  文档名检索  模糊
-	DocClass       []string `protobuf:"bytes,4,rep,name=docClass,proto3" json:"docClass,omitempty"`              // 分类 []string
-	DocTag         []string `protobuf:"bytes,5,rep,name=docTag,proto3" json:"docTag,omitempty"`                  // 标签 []string
-	UpdateDateSort int64    `protobuf:"varint,6,opt,name=updateDateSort,proto3" json:"updateDateSort,omitempty"` // 上传时间排序 1正序 -1倒序
-	DownloadSort   int64    `protobuf:"varint,7,opt,name=downloadSort,proto3" json:"downloadSort,omitempty"`     // 下载次数排序 1正序 -1倒序
-	ViewSort       int64    `protobuf:"varint,8,opt,name=viewSort,proto3" json:"viewSort,omitempty"`             // 浏览量排序 1正序 -1倒序
-	UserId         string   `protobuf:"bytes,9,opt,name=userId,proto3" json:"userId,omitempty"`                  //用户id
+	PageNum  int64    `protobuf:"varint,1,opt,name=pageNum,proto3" json:"pageNum,omitempty"`   //页码
+	PageSize int64    `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` //每页数量
+	KeyWord  string   `protobuf:"bytes,3,opt,name=keyWord,proto3" json:"keyWord,omitempty"`    //检索词  文档名检索  模糊
+	DocClass []string `protobuf:"bytes,4,rep,name=docClass,proto3" json:"docClass,omitempty"`  // 分类 []string
+	DocTag   []string `protobuf:"bytes,5,rep,name=docTag,proto3" json:"docTag,omitempty"`      // 标签 []string
+	Sort     []string `protobuf:"bytes,6,rep,name=sort,proto3" json:"sort,omitempty"`          //默认正序,倒序字段前加-,uploadDate:上架时间 viewTimes:浏览量 downTimes:下载量
+	UserId   string   `protobuf:"bytes,7,opt,name=userId,proto3" json:"userId,omitempty"`      //用户id
+	AppId    string   `protobuf:"bytes,8,opt,name=appId,proto3" json:"appId,omitempty"`        //appId
 }
 
 func (x *DocQueryRequest) Reset() {
@@ -112,30 +111,23 @@ func (x *DocQueryRequest) GetDocTag() []string {
 	return nil
 }
 
-func (x *DocQueryRequest) GetUpdateDateSort() int64 {
+func (x *DocQueryRequest) GetSort() []string {
 	if x != nil {
-		return x.UpdateDateSort
+		return x.Sort
 	}
-	return 0
-}
-
-func (x *DocQueryRequest) GetDownloadSort() int64 {
-	if x != nil {
-		return x.DownloadSort
-	}
-	return 0
+	return nil
 }
 
-func (x *DocQueryRequest) GetViewSort() int64 {
+func (x *DocQueryRequest) GetUserId() string {
 	if x != nil {
-		return x.ViewSort
+		return x.UserId
 	}
-	return 0
+	return ""
 }
 
-func (x *DocQueryRequest) GetUserId() string {
+func (x *DocQueryRequest) GetAppId() string {
 	if x != nil {
-		return x.UserId
+		return x.AppId
 	}
 	return ""
 }
@@ -226,6 +218,7 @@ type Doc struct {
 	UploadDate  string `protobuf:"bytes,8,opt,name=uploadDate,proto3" json:"uploadDate,omitempty"`    //上传时间
 	DocSummary  string `protobuf:"bytes,9,opt,name=docSummary,proto3" json:"docSummary,omitempty"`    //摘要
 	DocFileType string `protobuf:"bytes,10,opt,name=docFileType,proto3" json:"docFileType,omitempty"` //文档类型
+	IsDownload  int64  `protobuf:"varint,11,opt,name=isDownload,proto3" json:"isDownload,omitempty"`  //是否转存 0:未转存 1:转存
 }
 
 func (x *Doc) Reset() {
@@ -330,6 +323,13 @@ func (x *Doc) GetDocFileType() string {
 	return ""
 }
 
+func (x *Doc) GetIsDownload() int64 {
+	if x != nil {
+		return x.IsDownload
+	}
+	return 0
+}
+
 type DocChangeReq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -571,15 +571,10 @@ type DocGetCheckResp struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Code        int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`               //响应代码
-	Msg         string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`                  //响应消息
-	DocName     string `protobuf:"bytes,3,opt,name=docName,proto3" json:"docName,omitempty"`          //文档名称
-	DocType     int32  `protobuf:"varint,4,opt,name=docType,proto3" json:"docType,omitempty"`         //文档类型
-	DocFileSize int32  `protobuf:"varint,5,opt,name=docFileSize,proto3" json:"docFileSize,omitempty"` //文档大小
-	DocPageSize int32  `protobuf:"varint,6,opt,name=docPageSize,proto3" json:"docPageSize,omitempty"` //文档页码数
-	Tags        string `protobuf:"bytes,7,opt,name=tags,proto3" json:"tags,omitempty"`                //文档标签
-	UserId      string `protobuf:"bytes,8,opt,name=userId,proto3" json:"userId,omitempty"`            //上传人id
-	DocSummary  string `protobuf:"bytes,9,opt,name=docSummary,proto3" json:"docSummary,omitempty"`    //摘要
+	Code     int64    `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`   //响应代码
+	Msg      string   `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`      //响应消息
+	IsBuy    bool     `protobuf:"varint,3,opt,name=isBuy,proto3" json:"isBuy,omitempty"` //是否购买
+	DocDeail *DocInfo `protobuf:"bytes,4,opt,name=DocDeail,proto3" json:"DocDeail,omitempty"`
 }
 
 func (x *DocGetCheckResp) Reset() {
@@ -614,7 +609,7 @@ func (*DocGetCheckResp) Descriptor() ([]byte, []int) {
 	return file_stdlib_proto_rawDescGZIP(), []int{7}
 }
 
-func (x *DocGetCheckResp) GetCode() int32 {
+func (x *DocGetCheckResp) GetCode() int64 {
 	if x != nil {
 		return x.Code
 	}
@@ -628,55 +623,155 @@ func (x *DocGetCheckResp) GetMsg() string {
 	return ""
 }
 
-func (x *DocGetCheckResp) GetDocName() string {
+func (x *DocGetCheckResp) GetIsBuy() bool {
+	if x != nil {
+		return x.IsBuy
+	}
+	return false
+}
+
+func (x *DocGetCheckResp) GetDocDeail() *DocInfo {
+	if x != nil {
+		return x.DocDeail
+	}
+	return nil
+}
+
+type DocInfo struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	DocId        string `protobuf:"bytes,1,opt,name=docId,proto3" json:"docId,omitempty"`                //文档id
+	DocName      string `protobuf:"bytes,2,opt,name=docName,proto3" json:"docName,omitempty"`            //文档名称
+	Price        int64  `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"`               //价格
+	DocFileSize  int64  `protobuf:"varint,4,opt,name=docFileSize,proto3" json:"docFileSize,omitempty"`   //文档大小
+	DocPageSize  int64  `protobuf:"varint,5,opt,name=docPageSize,proto3" json:"docPageSize,omitempty"`   //文档页码数
+	Tags         string `protobuf:"bytes,6,opt,name=tags,proto3" json:"tags,omitempty"`                  //文档标签
+	DownTimes    int64  `protobuf:"varint,7,opt,name=downTimes,proto3" json:"downTimes,omitempty"`       //下载次数
+	ViewTimes    int64  `protobuf:"varint,8,opt,name=viewTimes,proto3" json:"viewTimes,omitempty"`       //浏览次数
+	UploadDate   string `protobuf:"bytes,9,opt,name=uploadDate,proto3" json:"uploadDate,omitempty"`      //上传时间
+	DocSummary   string `protobuf:"bytes,10,opt,name=docSummary,proto3" json:"docSummary,omitempty"`     //摘要
+	DocFileType  int64  `protobuf:"varint,11,opt,name=docFileType,proto3" json:"docFileType,omitempty"`  //文档类型
+	PreviewImgId string `protobuf:"bytes,12,opt,name=previewImgId,proto3" json:"previewImgId,omitempty"` //缩略图oss
+}
+
+func (x *DocInfo) Reset() {
+	*x = DocInfo{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_stdlib_proto_msgTypes[8]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *DocInfo) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DocInfo) ProtoMessage() {}
+
+func (x *DocInfo) ProtoReflect() protoreflect.Message {
+	mi := &file_stdlib_proto_msgTypes[8]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use DocInfo.ProtoReflect.Descriptor instead.
+func (*DocInfo) Descriptor() ([]byte, []int) {
+	return file_stdlib_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *DocInfo) GetDocId() string {
+	if x != nil {
+		return x.DocId
+	}
+	return ""
+}
+
+func (x *DocInfo) GetDocName() string {
 	if x != nil {
 		return x.DocName
 	}
 	return ""
 }
 
-func (x *DocGetCheckResp) GetDocType() int32 {
+func (x *DocInfo) GetPrice() int64 {
 	if x != nil {
-		return x.DocType
+		return x.Price
 	}
 	return 0
 }
 
-func (x *DocGetCheckResp) GetDocFileSize() int32 {
+func (x *DocInfo) GetDocFileSize() int64 {
 	if x != nil {
 		return x.DocFileSize
 	}
 	return 0
 }
 
-func (x *DocGetCheckResp) GetDocPageSize() int32 {
+func (x *DocInfo) GetDocPageSize() int64 {
 	if x != nil {
 		return x.DocPageSize
 	}
 	return 0
 }
 
-func (x *DocGetCheckResp) GetTags() string {
+func (x *DocInfo) GetTags() string {
 	if x != nil {
 		return x.Tags
 	}
 	return ""
 }
 
-func (x *DocGetCheckResp) GetUserId() string {
+func (x *DocInfo) GetDownTimes() int64 {
 	if x != nil {
-		return x.UserId
+		return x.DownTimes
+	}
+	return 0
+}
+
+func (x *DocInfo) GetViewTimes() int64 {
+	if x != nil {
+		return x.ViewTimes
+	}
+	return 0
+}
+
+func (x *DocInfo) GetUploadDate() string {
+	if x != nil {
+		return x.UploadDate
 	}
 	return ""
 }
 
-func (x *DocGetCheckResp) GetDocSummary() string {
+func (x *DocInfo) GetDocSummary() string {
 	if x != nil {
 		return x.DocSummary
 	}
 	return ""
 }
 
+func (x *DocInfo) GetDocFileType() int64 {
+	if x != nil {
+		return x.DocFileType
+	}
+	return 0
+}
+
+func (x *DocInfo) GetPreviewImgId() string {
+	if x != nil {
+		return x.PreviewImgId
+	}
+	return ""
+}
+
 type DocGetContentResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -690,7 +785,7 @@ type DocGetContentResp struct {
 func (x *DocGetContentResp) Reset() {
 	*x = DocGetContentResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_stdlib_proto_msgTypes[8]
+		mi := &file_stdlib_proto_msgTypes[9]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -703,7 +798,7 @@ func (x *DocGetContentResp) String() string {
 func (*DocGetContentResp) ProtoMessage() {}
 
 func (x *DocGetContentResp) ProtoReflect() protoreflect.Message {
-	mi := &file_stdlib_proto_msgTypes[8]
+	mi := &file_stdlib_proto_msgTypes[9]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -716,7 +811,7 @@ func (x *DocGetContentResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use DocGetContentResp.ProtoReflect.Descriptor instead.
 func (*DocGetContentResp) Descriptor() ([]byte, []int) {
-	return file_stdlib_proto_rawDescGZIP(), []int{8}
+	return file_stdlib_proto_rawDescGZIP(), []int{9}
 }
 
 func (x *DocGetContentResp) GetCode() int32 {
@@ -745,15 +840,16 @@ type DocActivityReq struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	PageNum  int32  `protobuf:"varint,1,opt,name=pageNum,proto3" json:"pageNum,omitempty"`   //页码
-	PageSize int32  `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` //每页数量
-	AppId    string `protobuf:"bytes,3,opt,name=appId,proto3" json:"appId,omitempty"`        //appId
+	PageNum    int32  `protobuf:"varint,1,opt,name=pageNum,proto3" json:"pageNum,omitempty"`       //页码
+	PageSize   int32  `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"`     //每页数量
+	AppId      string `protobuf:"bytes,3,opt,name=appId,proto3" json:"appId,omitempty"`            //appId
+	ActivityId int32  `protobuf:"varint,4,opt,name=activityId,proto3" json:"activityId,omitempty"` //活动id
 }
 
 func (x *DocActivityReq) Reset() {
 	*x = DocActivityReq{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_stdlib_proto_msgTypes[9]
+		mi := &file_stdlib_proto_msgTypes[10]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -766,7 +862,7 @@ func (x *DocActivityReq) String() string {
 func (*DocActivityReq) ProtoMessage() {}
 
 func (x *DocActivityReq) ProtoReflect() protoreflect.Message {
-	mi := &file_stdlib_proto_msgTypes[9]
+	mi := &file_stdlib_proto_msgTypes[10]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -779,7 +875,7 @@ func (x *DocActivityReq) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use DocActivityReq.ProtoReflect.Descriptor instead.
 func (*DocActivityReq) Descriptor() ([]byte, []int) {
-	return file_stdlib_proto_rawDescGZIP(), []int{9}
+	return file_stdlib_proto_rawDescGZIP(), []int{10}
 }
 
 func (x *DocActivityReq) GetPageNum() int32 {
@@ -803,6 +899,13 @@ func (x *DocActivityReq) GetAppId() string {
 	return ""
 }
 
+func (x *DocActivityReq) GetActivityId() int32 {
+	if x != nil {
+		return x.ActivityId
+	}
+	return 0
+}
+
 type DocActivity struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -820,7 +923,7 @@ type DocActivity struct {
 func (x *DocActivity) Reset() {
 	*x = DocActivity{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_stdlib_proto_msgTypes[10]
+		mi := &file_stdlib_proto_msgTypes[11]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -833,7 +936,7 @@ func (x *DocActivity) String() string {
 func (*DocActivity) ProtoMessage() {}
 
 func (x *DocActivity) ProtoReflect() protoreflect.Message {
-	mi := &file_stdlib_proto_msgTypes[10]
+	mi := &file_stdlib_proto_msgTypes[11]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -846,7 +949,7 @@ func (x *DocActivity) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use DocActivity.ProtoReflect.Descriptor instead.
 func (*DocActivity) Descriptor() ([]byte, []int) {
-	return file_stdlib_proto_rawDescGZIP(), []int{10}
+	return file_stdlib_proto_rawDescGZIP(), []int{11}
 }
 
 func (x *DocActivity) GetDocId() string {
@@ -912,7 +1015,7 @@ type DocActivityResp struct {
 func (x *DocActivityResp) Reset() {
 	*x = DocActivityResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_stdlib_proto_msgTypes[11]
+		mi := &file_stdlib_proto_msgTypes[12]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -925,7 +1028,7 @@ func (x *DocActivityResp) String() string {
 func (*DocActivityResp) ProtoMessage() {}
 
 func (x *DocActivityResp) ProtoReflect() protoreflect.Message {
-	mi := &file_stdlib_proto_msgTypes[11]
+	mi := &file_stdlib_proto_msgTypes[12]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -938,7 +1041,7 @@ func (x *DocActivityResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use DocActivityResp.ProtoReflect.Descriptor instead.
 func (*DocActivityResp) Descriptor() ([]byte, []int) {
-	return file_stdlib_proto_rawDescGZIP(), []int{11}
+	return file_stdlib_proto_rawDescGZIP(), []int{12}
 }
 
 func (x *DocActivityResp) GetCode() int32 {
@@ -973,7 +1076,7 @@ var File_stdlib_proto protoreflect.FileDescriptor
 
 var file_stdlib_proto_rawDesc = []byte{
 	0x0a, 0x0c, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06,
-	0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x22, 0x95, 0x02, 0x0a, 0x0f, 0x44, 0x6f, 0x63, 0x51, 0x75,
+	0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x22, 0xd7, 0x01, 0x0a, 0x0f, 0x44, 0x6f, 0x63, 0x51, 0x75,
 	0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61,
 	0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x70, 0x61, 0x67,
 	0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65,
@@ -982,137 +1085,152 @@ var file_stdlib_proto_rawDesc = []byte{
 	0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x57, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x6f,
 	0x63, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x64, 0x6f,
 	0x63, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x63, 0x54, 0x61, 0x67,
-	0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x63, 0x54, 0x61, 0x67, 0x12, 0x26,
-	0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x65, 0x53, 0x6f, 0x72, 0x74,
-	0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61,
-	0x74, 0x65, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f,
-	0x61, 0x64, 0x53, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x64, 0x6f,
-	0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x69,
-	0x65, 0x77, 0x53, 0x6f, 0x72, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x76, 0x69,
-	0x65, 0x77, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64,
-	0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x6f,
-	0x0a, 0x10, 0x44, 0x6f, 0x63, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
-	0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x6f, 0x63, 0x73,
-	0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e,
-	0x44, 0x6f, 0x63, 0x52, 0x04, 0x64, 0x6f, 0x63, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74,
-	0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22,
-	0xad, 0x02, 0x0a, 0x03, 0x44, 0x6f, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64,
-	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x12, 0x18, 0x0a,
-	0x07, 0x64, 0x6f, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
-	0x64, 0x6f, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65,
-	0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a,
-	0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01,
-	0x28, 0x03, 0x52, 0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12,
-	0x20, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x05,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x64, 0x6f, 0x63, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a,
-	0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x06,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12,
-	0x1c, 0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01,
-	0x28, 0x03, 0x52, 0x09, 0x76, 0x69, 0x65, 0x77, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x1e, 0x0a,
-	0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a,
-	0x0a, 0x64, 0x6f, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x20, 0x0a,
-	0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22,
-	0x4c, 0x0a, 0x0c, 0x44, 0x6f, 0x63, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12,
-	0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
-	0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
-	0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64,
-	0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x25, 0x0a,
-	0x0d, 0x44, 0x6f, 0x63, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14,
-	0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73,
-	0x74, 0x61, 0x74, 0x65, 0x22, 0x6c, 0x0a, 0x10, 0x44, 0x6f, 0x63, 0x53, 0x74, 0x61, 0x74, 0x69,
-	0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x6f, 0x63, 0x49,
-	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x12, 0x2c,
-	0x0a, 0x11, 0x44, 0x6f, 0x63, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x54,
-	0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x44, 0x6f, 0x63, 0x53, 0x74,
-	0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05,
-	0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70,
-	0x49, 0x64, 0x22, 0x54, 0x0a, 0x0e, 0x44, 0x6f, 0x63, 0x47, 0x65, 0x74, 0x43, 0x68, 0x65, 0x63,
-	0x6b, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73,
-	0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72,
-	0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0xfb, 0x01, 0x0a, 0x0f, 0x44, 0x6f, 0x63,
-	0x47, 0x65, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04,
+	0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x63, 0x54, 0x61, 0x67, 0x12, 0x12,
+	0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6f,
+	0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70,
+	0x70, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64,
+	0x22, 0x6f, 0x0a, 0x10, 0x44, 0x6f, 0x63, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70,
+	0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18,
+	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x6f,
+	0x63, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69,
+	0x62, 0x2e, 0x44, 0x6f, 0x63, 0x52, 0x04, 0x64, 0x6f, 0x63, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74,
+	0x6f, 0x74, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61,
+	0x6c, 0x22, 0xcd, 0x02, 0x0a, 0x03, 0x44, 0x6f, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x6f, 0x63,
+	0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x12,
+	0x18, 0x0a, 0x07, 0x64, 0x6f, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x07, 0x64, 0x6f, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69,
+	0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12,
+	0x20, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x04,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a,
+	0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65,
+	0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x64, 0x6f, 0x63, 0x50, 0x61, 0x67, 0x65, 0x53,
+	0x69, 0x7a, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73,
+	0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x54, 0x69, 0x6d, 0x65,
+	0x73, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x07,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x76, 0x69, 0x65, 0x77, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12,
+	0x1e, 0x0a, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12,
+	0x1e, 0x0a, 0x0a, 0x64, 0x6f, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x09, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12,
+	0x20, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0a,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70,
+	0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18,
+	0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x73, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61,
+	0x64, 0x22, 0x4c, 0x0a, 0x0c, 0x44, 0x6f, 0x63, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65,
+	0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69,
+	0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
+	0x05, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70,
+	0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22,
+	0x25, 0x0a, 0x0d, 0x44, 0x6f, 0x63, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70,
+	0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52,
+	0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x6c, 0x0a, 0x10, 0x44, 0x6f, 0x63, 0x53, 0x74, 0x61,
+	0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x6f,
+	0x63, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64,
+	0x12, 0x2c, 0x0a, 0x11, 0x44, 0x6f, 0x63, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63,
+	0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x44, 0x6f, 0x63,
+	0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14,
+	0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61,
+	0x70, 0x70, 0x49, 0x64, 0x22, 0x54, 0x0a, 0x0e, 0x44, 0x6f, 0x63, 0x47, 0x65, 0x74, 0x43, 0x68,
+	0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06,
+	0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73,
+	0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x7a, 0x0a, 0x0f, 0x44, 0x6f,
+	0x63, 0x47, 0x65, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a,
+	0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64,
+	0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
+	0x6d, 0x73, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x42, 0x75, 0x79, 0x18, 0x03, 0x20, 0x01,
+	0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x42, 0x75, 0x79, 0x12, 0x2b, 0x0a, 0x08, 0x44, 0x6f, 0x63,
+	0x44, 0x65, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x74,
+	0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x44, 0x6f,
+	0x63, 0x44, 0x65, 0x61, 0x69, 0x6c, 0x22, 0xe9, 0x02, 0x0a, 0x07, 0x44, 0x6f, 0x63, 0x49, 0x6e,
+	0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x6f, 0x63, 0x4e,
+	0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x6f, 0x63, 0x4e, 0x61,
+	0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x46,
+	0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x64,
+	0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x6f,
+	0x63, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x0b, 0x64, 0x6f, 0x63, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04,
+	0x74, 0x61, 0x67, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73,
+	0x12, 0x1c, 0x0a, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x07, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x1c,
+	0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x09, 0x76, 0x69, 0x65, 0x77, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a,
+	0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x0a,
+	0x64, 0x6f, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x0a, 0x64, 0x6f, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b,
+	0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22,
+	0x0a, 0x0c, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x49, 0x6d, 0x67, 0x49, 0x64, 0x18, 0x0c,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x49, 0x6d, 0x67,
+	0x49, 0x64, 0x22, 0x59, 0x0a, 0x11, 0x44, 0x6f, 0x63, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74,
+	0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d,
+	0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x1e, 0x0a,
+	0x0a, 0x64, 0x6f, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
+	0x0c, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x7c, 0x0a,
+	0x0e, 0x44, 0x6f, 0x63, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x12,
+	0x18, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
+	0x52, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67,
+	0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67,
+	0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x03,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x61,
+	0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
+	0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x64, 0x22, 0xcb, 0x01, 0x0a, 0x0b,
+	0x44, 0x6f, 0x63, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x64,
+	0x6f, 0x63, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x6f, 0x63, 0x49,
+	0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x64, 0x18,
+	0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49,
+	0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1e, 0x0a,
+	0x0a, 0x64, 0x6f, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x16, 0x0a,
+	0x06, 0x64, 0x6f, 0x63, 0x49, 0x6d, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64,
+	0x6f, 0x63, 0x49, 0x6d, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x06,
+	0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63,
+	0x6f, 0x73, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09,
+	0x63, 0x6f, 0x73, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x22, 0x76, 0x0a, 0x0f, 0x44, 0x6f, 0x63,
+	0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04,
 	0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65,
 	0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d,
-	0x73, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x6f, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x6f, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07,
-	0x64, 0x6f, 0x63, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x64,
-	0x6f, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c,
-	0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x64, 0x6f, 0x63,
-	0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x50,
-	0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x64,
-	0x6f, 0x63, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61,
-	0x67, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x16,
-	0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
-	0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x6f, 0x63, 0x53, 0x75, 0x6d,
-	0x6d, 0x61, 0x72, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x53,
-	0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x22, 0x59, 0x0a, 0x11, 0x44, 0x6f, 0x63, 0x47, 0x65, 0x74,
-	0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63,
-	0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12,
-	0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73,
-	0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x6f, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18,
-	0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
-	0x74, 0x22, 0x5c, 0x0a, 0x0e, 0x44, 0x6f, 0x63, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79,
-	0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x01,
-	0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a,
-	0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
-	0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70,
-	0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22,
-	0xcb, 0x01, 0x0a, 0x0b, 0x44, 0x6f, 0x63, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12,
-	0x14, 0x0a, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
-	0x64, 0x6f, 0x63, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
-	0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76,
-	0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x54, 0x69, 0x74, 0x6c,
-	0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x54, 0x69, 0x74, 0x6c,
-	0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x6f, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18,
-	0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72,
-	0x79, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x63, 0x49, 0x6d, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x06, 0x64, 0x6f, 0x63, 0x49, 0x6d, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69,
-	0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12,
-	0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01,
-	0x28, 0x05, 0x52, 0x09, 0x63, 0x6f, 0x73, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x22, 0x76, 0x0a,
-	0x0f, 0x44, 0x6f, 0x63, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70,
-	0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04,
-	0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x27, 0x0a, 0x04, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x03,
-	0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f,
-	0x63, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x04, 0x64, 0x6f, 0x63, 0x73, 0x12,
-	0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
-	0x74, 0x6f, 0x74, 0x61, 0x6c, 0x32, 0xba, 0x03, 0x0a, 0x06, 0x53, 0x74, 0x64, 0x6c, 0x69, 0x62,
-	0x12, 0x3d, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x17, 0x2e, 0x73,
-	0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65,
-	0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44,
-	0x6f, 0x63, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
-	0x34, 0x0a, 0x05, 0x44, 0x6f, 0x63, 0x4f, 0x6e, 0x12, 0x14, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69,
-	0x62, 0x2e, 0x44, 0x6f, 0x63, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x15,
-	0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x43, 0x68, 0x61, 0x6e, 0x67,
-	0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x35, 0x0a, 0x06, 0x44, 0x6f, 0x63, 0x4f, 0x66, 0x66, 0x12,
-	0x14, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x43, 0x68, 0x61, 0x6e,
-	0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44,
-	0x6f, 0x63, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x40, 0x0a, 0x0d,
-	0x44, 0x6f, 0x63, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x18, 0x2e,
-	0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73,
-	0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62,
-	0x2e, 0x44, 0x6f, 0x63, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3e,
-	0x0a, 0x0b, 0x44, 0x6f, 0x63, 0x47, 0x65, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x16, 0x2e,
-	0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x47, 0x65, 0x74, 0x43, 0x68, 0x65,
-	0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44,
-	0x6f, 0x63, 0x47, 0x65, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x42,
-	0x0a, 0x0d, 0x44, 0x6f, 0x63, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12,
-	0x16, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x47, 0x65, 0x74, 0x43,
-	0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62,
-	0x2e, 0x44, 0x6f, 0x63, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65,
-	0x73, 0x70, 0x12, 0x3e, 0x0a, 0x0b, 0x44, 0x6f, 0x63, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
-	0x79, 0x12, 0x16, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x41, 0x63,
-	0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x73, 0x74, 0x64, 0x6c,
-	0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x65,
-	0x73, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x73, 0x67, 0x12, 0x27, 0x0a, 0x04, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
+	0x32, 0x13, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x41, 0x63, 0x74,
+	0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x04, 0x64, 0x6f, 0x63, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74,
+	0x6f, 0x74, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61,
+	0x6c, 0x32, 0xba, 0x03, 0x0a, 0x06, 0x53, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x12, 0x3d, 0x0a, 0x08,
+	0x44, 0x6f, 0x63, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x17, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69,
+	0x62, 0x2e, 0x44, 0x6f, 0x63, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+	0x74, 0x1a, 0x18, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x51, 0x75,
+	0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x05, 0x44,
+	0x6f, 0x63, 0x4f, 0x6e, 0x12, 0x14, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f,
+	0x63, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x73, 0x74, 0x64,
+	0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x35, 0x0a, 0x06, 0x44, 0x6f, 0x63, 0x4f, 0x66, 0x66, 0x12, 0x14, 0x2e, 0x73, 0x74,
+	0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65,
+	0x71, 0x1a, 0x15, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x43, 0x68,
+	0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x40, 0x0a, 0x0d, 0x44, 0x6f, 0x63, 0x53,
+	0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x18, 0x2e, 0x73, 0x74, 0x64, 0x6c,
+	0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73,
+	0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63,
+	0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3e, 0x0a, 0x0b, 0x44, 0x6f,
+	0x63, 0x47, 0x65, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x16, 0x2e, 0x73, 0x74, 0x64, 0x6c,
+	0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x47, 0x65, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65,
+	0x71, 0x1a, 0x17, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x47, 0x65,
+	0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x42, 0x0a, 0x0d, 0x44, 0x6f,
+	0x63, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x2e, 0x73, 0x74,
+	0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x47, 0x65, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b,
+	0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63,
+	0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3e,
+	0x0a, 0x0b, 0x44, 0x6f, 0x63, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x16, 0x2e,
+	0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44, 0x6f, 0x63, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69,
+	0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x2e, 0x44,
+	0x6f, 0x63, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x62, 0x06,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -1127,7 +1245,7 @@ func file_stdlib_proto_rawDescGZIP() []byte {
 	return file_stdlib_proto_rawDescData
 }
 
-var file_stdlib_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
+var file_stdlib_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
 var file_stdlib_proto_goTypes = []interface{}{
 	(*DocQueryRequest)(nil),   // 0: stdlib.DocQueryRequest
 	(*DocQueryResponse)(nil),  // 1: stdlib.DocQueryResponse
@@ -1137,33 +1255,35 @@ var file_stdlib_proto_goTypes = []interface{}{
 	(*DocStatisticsReq)(nil),  // 5: stdlib.DocStatisticsReq
 	(*DocGetCheckReq)(nil),    // 6: stdlib.DocGetCheckReq
 	(*DocGetCheckResp)(nil),   // 7: stdlib.DocGetCheckResp
-	(*DocGetContentResp)(nil), // 8: stdlib.DocGetContentResp
-	(*DocActivityReq)(nil),    // 9: stdlib.DocActivityReq
-	(*DocActivity)(nil),       // 10: stdlib.DocActivity
-	(*DocActivityResp)(nil),   // 11: stdlib.DocActivityResp
+	(*DocInfo)(nil),           // 8: stdlib.DocInfo
+	(*DocGetContentResp)(nil), // 9: stdlib.DocGetContentResp
+	(*DocActivityReq)(nil),    // 10: stdlib.DocActivityReq
+	(*DocActivity)(nil),       // 11: stdlib.DocActivity
+	(*DocActivityResp)(nil),   // 12: stdlib.DocActivityResp
 }
 var file_stdlib_proto_depIdxs = []int32{
 	2,  // 0: stdlib.DocQueryResponse.docs:type_name -> stdlib.Doc
-	10, // 1: stdlib.DocActivityResp.docs:type_name -> stdlib.DocActivity
-	0,  // 2: stdlib.Stdlib.DocQuery:input_type -> stdlib.DocQueryRequest
-	3,  // 3: stdlib.Stdlib.DocOn:input_type -> stdlib.DocChangeReq
-	3,  // 4: stdlib.Stdlib.DocOff:input_type -> stdlib.DocChangeReq
-	5,  // 5: stdlib.Stdlib.DocStatistics:input_type -> stdlib.DocStatisticsReq
-	6,  // 6: stdlib.Stdlib.DocGetCheck:input_type -> stdlib.DocGetCheckReq
-	6,  // 7: stdlib.Stdlib.DocGetContent:input_type -> stdlib.DocGetCheckReq
-	9,  // 8: stdlib.Stdlib.DocActivity:input_type -> stdlib.DocActivityReq
-	1,  // 9: stdlib.Stdlib.DocQuery:output_type -> stdlib.DocQueryResponse
-	4,  // 10: stdlib.Stdlib.DocOn:output_type -> stdlib.DocChangeResp
-	4,  // 11: stdlib.Stdlib.DocOff:output_type -> stdlib.DocChangeResp
-	4,  // 12: stdlib.Stdlib.DocStatistics:output_type -> stdlib.DocChangeResp
-	7,  // 13: stdlib.Stdlib.DocGetCheck:output_type -> stdlib.DocGetCheckResp
-	8,  // 14: stdlib.Stdlib.DocGetContent:output_type -> stdlib.DocGetContentResp
-	11, // 15: stdlib.Stdlib.DocActivity:output_type -> stdlib.DocActivityResp
-	9,  // [9:16] is the sub-list for method output_type
-	2,  // [2:9] is the sub-list for method input_type
-	2,  // [2:2] is the sub-list for extension type_name
-	2,  // [2:2] is the sub-list for extension extendee
-	0,  // [0:2] is the sub-list for field type_name
+	8,  // 1: stdlib.DocGetCheckResp.DocDeail:type_name -> stdlib.DocInfo
+	11, // 2: stdlib.DocActivityResp.docs:type_name -> stdlib.DocActivity
+	0,  // 3: stdlib.Stdlib.DocQuery:input_type -> stdlib.DocQueryRequest
+	3,  // 4: stdlib.Stdlib.DocOn:input_type -> stdlib.DocChangeReq
+	3,  // 5: stdlib.Stdlib.DocOff:input_type -> stdlib.DocChangeReq
+	5,  // 6: stdlib.Stdlib.DocStatistics:input_type -> stdlib.DocStatisticsReq
+	6,  // 7: stdlib.Stdlib.DocGetCheck:input_type -> stdlib.DocGetCheckReq
+	6,  // 8: stdlib.Stdlib.DocGetContent:input_type -> stdlib.DocGetCheckReq
+	10, // 9: stdlib.Stdlib.DocActivity:input_type -> stdlib.DocActivityReq
+	1,  // 10: stdlib.Stdlib.DocQuery:output_type -> stdlib.DocQueryResponse
+	4,  // 11: stdlib.Stdlib.DocOn:output_type -> stdlib.DocChangeResp
+	4,  // 12: stdlib.Stdlib.DocOff:output_type -> stdlib.DocChangeResp
+	4,  // 13: stdlib.Stdlib.DocStatistics:output_type -> stdlib.DocChangeResp
+	7,  // 14: stdlib.Stdlib.DocGetCheck:output_type -> stdlib.DocGetCheckResp
+	9,  // 15: stdlib.Stdlib.DocGetContent:output_type -> stdlib.DocGetContentResp
+	12, // 16: stdlib.Stdlib.DocActivity:output_type -> stdlib.DocActivityResp
+	10, // [10:17] is the sub-list for method output_type
+	3,  // [3:10] is the sub-list for method input_type
+	3,  // [3:3] is the sub-list for extension type_name
+	3,  // [3:3] is the sub-list for extension extendee
+	0,  // [0:3] is the sub-list for field type_name
 }
 
 func init() { file_stdlib_proto_init() }
@@ -1269,7 +1389,7 @@ func file_stdlib_proto_init() {
 			}
 		}
 		file_stdlib_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*DocGetContentResp); i {
+			switch v := v.(*DocInfo); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1281,7 +1401,7 @@ func file_stdlib_proto_init() {
 			}
 		}
 		file_stdlib_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*DocActivityReq); i {
+			switch v := v.(*DocGetContentResp); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1293,7 +1413,7 @@ func file_stdlib_proto_init() {
 			}
 		}
 		file_stdlib_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*DocActivity); i {
+			switch v := v.(*DocActivityReq); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1305,6 +1425,18 @@ func file_stdlib_proto_init() {
 			}
 		}
 		file_stdlib_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*DocActivity); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_stdlib_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*DocActivityResp); i {
 			case 0:
 				return &v.state
@@ -1323,7 +1455,7 @@ func file_stdlib_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_stdlib_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   12,
+			NumMessages:   13,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 8 - 7
rpc/stdlib/stdlibclient/stdlib.go

@@ -14,18 +14,19 @@ import (
 )
 
 type (
-	DocActivity       = stdlib.DocActivity
-	DocQueryRequest   = stdlib.DocQueryRequest
-	Doc               = stdlib.Doc
-	DocChangeReq      = stdlib.DocChangeReq
-	DocChangeResp     = stdlib.DocChangeResp
-	DocStatisticsReq  = stdlib.DocStatisticsReq
 	DocGetContentResp = stdlib.DocGetContentResp
 	DocActivityReq    = stdlib.DocActivityReq
-	DocActivityResp   = stdlib.DocActivityResp
 	DocQueryResponse  = stdlib.DocQueryResponse
+	Doc               = stdlib.Doc
+	DocChangeResp     = stdlib.DocChangeResp
+	DocStatisticsReq  = stdlib.DocStatisticsReq
 	DocGetCheckReq    = stdlib.DocGetCheckReq
 	DocGetCheckResp   = stdlib.DocGetCheckResp
+	DocActivity       = stdlib.DocActivity
+	DocQueryRequest   = stdlib.DocQueryRequest
+	DocChangeReq      = stdlib.DocChangeReq
+	DocInfo           = stdlib.DocInfo
+	DocActivityResp   = stdlib.DocActivityResp
 
 	Stdlib interface {
 		DocQuery(ctx context.Context, in *DocQueryRequest) (*DocQueryResponse, error)

+ 5 - 2
rpc/stdlib/test/docquery_test.go

@@ -15,10 +15,13 @@ import (
 func Test_Docquery(t *testing.T) {
 	ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
 	std := stdlibclient.NewStdlib(zrpc.MustNewClient(zrpc.RpcClientConf{Etcd: discov.EtcdConf{Hosts: []string{"127.0.0.1:2379"}, Key: "jydocs.stdlib.rpc"}}))
-	res, err := std.DocQuery(ctx, &stdlib.DocQueryRequest{KeyWord: "软件", PageSize: 3})
+	res, err := std.DocQuery(ctx, &stdlib.DocQueryRequest{UserId: "5d6378301c298a5aac7b5402", AppId: "jy", KeyWord: "软件", PageSize: 3, Sort: []string{}})
 	if err != nil {
 		log.Println(err)
 	} else {
-		log.Println(res.Docs[0])
+		log.Println(res.Total, res.Code, res.Msg)
+		for _, v := range res.Docs {
+			log.Println(v)
+		}
 	}
 }

+ 8 - 1
services/model/base_model.go

@@ -1,8 +1,9 @@
 package model
 
 import (
-	"gorm.io/gorm"
 	"time"
+
+	"gorm.io/gorm"
 )
 
 type BaseModel struct {
@@ -19,4 +20,10 @@ const (
 	UserDocCategory_SelfUpload      = 0 //自己上传
 	UserDocCategory_Download        = 1 //转存(下载)
 	UserDocCategory_Collect         = 2 //收藏
+	//es
+	Es_JyDoc = "jydoc" //es中文库的别名
+)
+
+var (
+	DocFileType = map[int]string{1: "doc", 2: "pdf", 3: "xls", 4: "ppt", 5: "txt", 6: "其他"}
 )

+ 3 - 3
services/stdlib/docActivity.go

@@ -7,13 +7,13 @@ import (
 	jyDocsRpcUtil "app.yhyue.com/moapp/jy_docs/services/util"
 )
 
-func DocActivityList(pageSize, pageNum int, appId string) ([]model.DocActivity, int) {
+func DocActivityList(pageSize, pageNum, activityId int, appId string) ([]model.DocActivity, int) {
 	var docActivity []model.DocActivity
 	// var docs []map[string]interface{}
 	var count int64
-	jyDocsRpcUtil.GetJyDocsDB().Model(&model.DocActivity{}).Count(&count)
+	jyDocsRpcUtil.GetJyDocsDB().Model(&model.DocActivity{}).Where("activityId = ?", activityId).Count(&count)
 	if count > 0 {
-		jyDocsRpcUtil.GetJyDocsDB().Offset((pageNum-1)*pageSize).Limit(pageSize).Find(&docActivity, &model.DocActivity{AppId: appId})
+		jyDocsRpcUtil.GetJyDocsDB().Offset((pageNum-1)*pageSize).Limit(pageSize).Find(&docActivity, &model.DocActivity{AppId: appId, ActivityId: activityId})
 	} else {
 		count = 0
 	}

+ 6 - 5
services/stdlib/docChangeService.go

@@ -1,13 +1,14 @@
 package stdlib
 
 import (
+	"errors"
+	"log"
+	"time"
+
 	"app.yhyue.com/moapp/jy_docs/services/model"
 	jyDocsRpcUtil "app.yhyue.com/moapp/jy_docs/services/util"
 	elastic "app.yhyue.com/moapp/jybase/esv7"
-	"errors"
 	"gorm.io/gorm"
-	"log"
-	"time"
 )
 
 const DocOn = 1
@@ -69,7 +70,7 @@ func ChangeDocumentOn(doc *model.Doc, reason int32) bool {
 			"docPageSize": docData.DocPageSize,
 			"docFileType": docData.DocFileType,
 		}
-		if rs := elastic.Save(jyDocsRpcUtil.Es_JyDoc, "_doc", saveData); rs != true {
+		if rs := elastic.Save(model.Es_JyDoc, "_doc", saveData); rs != true {
 			return errors.New("发布到检索库失败")
 		}
 		return nil
@@ -108,7 +109,7 @@ func ChangeDocumentOff(doc *model.Doc, reason int32) bool {
 			return err
 		}
 
-		if rs := elastic.DelById(jyDocsRpcUtil.Es_JyDoc, "doc", doc.Id); rs != true {
+		if rs := elastic.DelById(model.Es_JyDoc, "doc", doc.Id); rs != true {
 			return errors.New("从检索库删除失败")
 		}
 		return nil

+ 28 - 16
services/stdlib/docGet.go

@@ -12,26 +12,38 @@ import (
 func DocGetCheck(docId, userId, appId string) stdlib.DocGetCheckResp {
 	// docPrice := 0
 	var buyCount int64
-	jyDocsRpcUtil.GetJyDocsDB().Table("doc").Where("docId = ? and userId = ? and appId = ?", docId, userId, appId).Count(&buyCount)
+	isbuy := false
+	jyDocsRpcUtil.GetJyDocsDB().Table("download_collection_record").Where("docId = ? and userId = ? and appId = ?", docId, userId, appId).Count(&buyCount)
 	if buyCount > 0 {
-		//已购买
-		doc := &model.Doc{}
-		jyDocsRpcUtil.GetJyDocsDB().Where("id = ? and appId = ?", docId, appId).Find(doc)
-		if doc.DocName != "" {
-			// docPrice = docData["price"].(int)
-			docCheck := stdlib.DocGetCheckResp{
-				Code:        0,
-				Msg:         "ok",
+		isbuy = true
+	}
+	//已购买
+	doc := &model.Doc{}
+	jyDocsRpcUtil.GetJyDocsDB().Where("id = ? and appId = ?", docId, appId).Find(doc)
+	if doc.DocName != "" {
+		// docPrice = docData["price"].(int)
+		docStatistics := map[string]interface{}{}
+		jyDocsRpcUtil.GetJyDocsDB().Table("doc_statistics").Where("docId = ? and appId = ?", docId, appId).First(&docStatistics)
+		docCheck := stdlib.DocGetCheckResp{
+			Code:  0,
+			Msg:   "ok",
+			IsBuy: isbuy,
+			DocDeail: &stdlib.DocInfo{
+				DocId:       doc.Id,
 				DocName:     doc.DocName,
-				DocType:     int32(doc.DocFileType),
-				DocFileSize: int32(doc.DocFileSize),
-				DocPageSize: int32(doc.DocPageSize),
+				Price:       int64(doc.Price),
+				DocFileSize: int64(doc.DocFileSize),
+				DocPageSize: int64(doc.DocPageSize),
 				Tags:        doc.DocTags,
-				UserId:      doc.UserId,
-				DocSummary:  doc.DocSummary,
-			}
-			return docCheck
+				// DownTimes     :doc.DownTimes,
+				// ViewTimes    :doc.ViewTimes,
+				UploadDate:   doc.UploadDate.Format("2006-01-02 15:04:05"),
+				DocSummary:   doc.DocSummary,
+				DocFileType:  int64(doc.DocFileType),
+				PreviewImgId: doc.PreviewImgId,
+			},
 		}
+		return docCheck
 	}
 	return stdlib.DocGetCheckResp{Code: -1, Msg: "查询失败"}
 }

+ 86 - 40
services/stdlib/docService.go

@@ -6,18 +6,23 @@ import (
 	"regexp"
 	"strings"
 
+	"app.yhyue.com/moapp/jy_docs/rpc/stdlib/stdlib"
+	"app.yhyue.com/moapp/jy_docs/services/model"
 	jyDocsRpcUtil "app.yhyue.com/moapp/jy_docs/services/util"
 	"app.yhyue.com/moapp/jybase/common"
 	elastic "app.yhyue.com/moapp/jybase/esv7"
 )
 
 const (
+	Es_Query_All       = `{"query":{"match_all":{}}%s}`
 	Es_Query_Boosting  = `{"query":{"boosting":{"positive":{"bool":{"must":[%s]}},"negative":{"bool":{"must":[%s]}},"negative_boost":2}}%s}`
 	Es_Query_Bool      = `{"query":{"bool":{"filter":[%s]}}%s}`
-	Es_Query_Append    = `,"_source":["id","docName","price","downTimes","viewTimes","docSummary","uploadDate","docFileSize","docPageSize","docFileType"],"sort":{%s},"from":%d,"size":%d,"highlight":{"fields":{"docName":{},"docSummary":{}}}`
-	Multi_Match        = `{"multi_match":{"query":"%s","fields":["docName","docSummary"]}}`
+	Es_Query_Append    = `,"_source":["id","docName","price","downTimes","viewTimes","docSummary","uploadDate","docFileSize","docPageSize","docFileType"],"from":%d,"size":%d`
+	Es_Query_Highlight = `,"highlight":{"fields":{"docName":{},"docSummary":{"fragment_size":100,"number_of_fragments":1}}}`
+	Es_Query_Sort      = `,"sort":{%s}`
+	Multi_Match        = `{"multi_match":{"query":"%s","fields":["docName","docSummary^2"]}}`
 	Multi_Match_Phrase = `{"multi_match":{"query":"%s","fields":["docName.docName_c","docSummary.docSummary_c"],"type":"phrase"}}`
-	Terms              = `{"trems":{"%s":[%s]}}`
+	Terms              = `{"terms":{"%s":[%s]}}`
 )
 
 var (
@@ -28,55 +33,96 @@ func FindDocumentById(id int) {
 	log.Println(jyDocsRpcUtil.GetJyDocsDB().Exec("select * from ").Error)
 }
 
-func FindDocumentsByKeyWords(keyWord string, docClass, docTag []string, publishTimeSort, downloadSort, viewSort, pageNum, pageSize int64) (int64, *[]map[string]interface{}) {
+func DocQuery(in *stdlib.DocQueryRequest) *stdlib.DocQueryResponse {
 	defer common.Catch()
-	keyWord = strings.TrimSpace(keyWord)
+	in.KeyWord = strings.TrimSpace(in.KeyWord)
 	musts := []string{}
 	negative_musts := []string{}
-	sorts := []string{`"_score":"desc"`}
-	//上架时间
-	if publishTimeSort > 0 {
-		sorts = append(sorts, `"create_at":"asc"`)
-	} else if viewSort < 0 {
-		sorts = append(sorts, `"create_at":"desc"`)
-	}
-	//下载量
-	if downloadSort > 0 {
-		sorts = append(sorts, `"downTimes":"asc"`)
-	} else if viewSort < 0 {
-		sorts = append(sorts, `"downTimes":"desc"`)
-	}
-	//浏览量
-	if viewSort > 0 {
-		sorts = append(sorts, `"viewTimes":"asc"`)
-	} else if viewSort < 0 {
-		sorts = append(sorts, `"viewTimes":"desc"`)
-	}
-	//分类
-	if len(docClass) > 0 {
-		musts = append(musts, fmt.Sprintf(Terms, "docClassLevelOne", strings.Join(docClass, ",")))
-	}
-	//标签
-	if len(docTag) > 0 {
-		musts = append(musts, fmt.Sprintf(Terms, "docTags", strings.Join(docTag, ",")))
-	}
+	sorts := []string{}
 	//搜索词
-	if keyWord != "" {
-		for _, v := range strings.Split(keyWord, " ") {
+	if in.KeyWord != "" {
+		sorts = append(sorts, `"_score":"desc"`)
+		for _, v := range strings.Split(in.KeyWord, " ") {
 			v = strings.ReplaceAll(v, `"`, `\"`)
 			musts = append(musts, fmt.Sprintf(Multi_Match, v))
 			negative_musts = append(negative_musts, fmt.Sprintf(Multi_Match_Phrase, v))
 		}
 	}
-	if len(musts) == 0 {
-		return 0, nil
+	for _, v := range in.Sort {
+		if strings.HasPrefix(v, "-") {
+			sorts = append(sorts, fmt.Sprintf(`"%s":"desc"`, strings.TrimLeft(v, "-")))
+		} else {
+			sorts = append(sorts, fmt.Sprintf(`"%s":"asc"`, v))
+		}
+	}
+	//分类
+	if len(in.DocClass) > 0 {
+		musts = append(musts, fmt.Sprintf(Terms, "docClass", `"`+strings.Join(in.DocClass, `","`)+`"`))
+	}
+	//标签
+	if len(in.DocTag) > 0 {
+		musts = append(musts, fmt.Sprintf(Terms, "docTags", `"`+strings.Join(in.DocTag, `","`)+`"`))
 	}
 	query := ""
-	if keyWord != "" {
-		query = fmt.Sprintf(Es_Query_Boosting, strings.Join(musts, ","), strings.Join(negative_musts, ","), fmt.Sprintf(Es_Query_Append, strings.Join(sorts, ","), (pageNum-1)*pageSize, pageSize))
+	query_sort := ""
+	if len(sorts) > 0 {
+		query_sort = fmt.Sprintf(Es_Query_Sort, strings.Join(sorts, ","))
+	}
+	query_append := fmt.Sprintf(Es_Query_Append, (in.PageNum-1)*in.PageSize, in.PageSize)
+	if len(musts) == 0 {
+		query = fmt.Sprintf(Es_Query_All, fmt.Sprint(query_append, query_sort))
+	} else if in.KeyWord != "" {
+		query = fmt.Sprintf(Es_Query_Boosting, strings.Join(musts, ","), strings.Join(negative_musts, ","), fmt.Sprint(query_append, query_sort, Es_Query_Highlight))
 	} else {
-		query = fmt.Sprintf(Es_Query_Bool, strings.Join(musts, ","), fmt.Sprintf(Es_Query_Append, strings.Join(sorts, ","), (pageNum-1)*pageSize, pageSize))
+		query = fmt.Sprintf(Es_Query_Bool, strings.Join(musts, ","), fmt.Sprint(query_append, query_sort))
 	}
 	log.Println("query:", query)
-	return elastic.DfsGet(jyDocsRpcUtil.Es_JyDoc, "", query)
+	total, list := elastic.GetBySearchType(model.Es_JyDoc, "dfs_query_then_fetch", query)
+	docs := []*stdlib.Doc{}
+	//获取我购买的文档
+	if list != nil {
+		myDocs := map[string]int64{}
+		if in.UserId != "" {
+			docIds, whs := []interface{}{}, []string{}
+			for _, v := range *list {
+				whs = append(whs, "?")
+				docIds = append(docIds, common.ObjToString(v["id"]))
+			}
+			args := []interface{}{in.UserId, model.UserDocStatus_Normal, in.AppId}
+			args = append(args, docIds...)
+			userDocs := []*model.UserDoc{}
+			jyDocsRpcUtil.GetJyDocsDB().Exec(`select docId from user_doc where userId=? and isDelete=? and appId=? and isDownload=1 and docId in (`+strings.Join(whs, ",")+`)`, args...).Find(&userDocs)
+			for _, v := range userDocs {
+				myDocs[v.DocId] = 1
+			}
+		}
+		for _, v := range *list {
+			doc := &stdlib.Doc{
+				DocId:       common.ObjToString(v["id"]),
+				DocName:     common.ObjToString(v["docName"]),
+				Price:       common.Int64All(v["price"]),
+				DocPageSize: common.Int64All(v["docPageSize"]),
+				DocFileSize: common.Int64All(v["docFileSize"]),
+				DownTimes:   common.Int64All(v["downTimes"]),
+				ViewTimes:   common.Int64All(v["viewTimes"]),
+				UploadDate:  common.ObjToString(v["uploadDate"]),
+				DocSummary:  common.ObjToString(v["docSummary"]),
+				DocFileType: model.DocFileType[common.IntAll(v["docFileType"])],
+			}
+			highlight, _ := v["highlight"].(map[string][]string)
+			if len(highlight["docName"]) > 0 {
+				doc.DocName = highlight["docName"][0]
+			}
+			if len(highlight["docSummary"]) > 0 {
+				doc.DocSummary = highlight["docSummary"][0]
+			}
+			doc.IsDownload = myDocs[doc.DocId]
+			docs = append(docs, doc)
+		}
+	}
+	return &stdlib.DocQueryResponse{
+		Total: total,
+		Docs:  docs,
+		Code:  1,
+	}
 }

+ 0 - 16
services/util/util.go

@@ -1,16 +0,0 @@
-package util
-
-const (
-	Es_JyDoc = "jydoc" //es中文库的别名
-)
-
-var (
-	DocFileType = map[int]string{
-		1: "doc",
-		2: "pdf",
-		3: "xls",
-		4: "ppt",
-		5: "txt",
-		6: "其他",
-	}
-)