李哲 4 年之前
父節點
當前提交
f5c1f4dc9e

+ 21 - 14
docs/ElasticSearch.md → docs/es_jydoc.md

@@ -1,20 +1,24 @@
-## 文库jydoc mapping字段说明
+#### 文库jydoc mapping字段说明
 
-_id 文档id 类型:string<br>
-文档名:docName 类型:string<br>
-文档标签(多个,用逗号隔开):docTags 类型:string<br>
-文档分类(多个,用逗号隔开):docClass 类型:string<br>
-积分价格:price 类型:long<br>
-下载次数:downTimes 类型:long<br>
-浏览次数:viewTimes 类型:long<br>
-文档摘要:docSummary 类型:string<br>
-上传时间:uploadDate 类型:date 格式:yyyy-MM-dd HH:mm:ss<br>
-文件大小:docFileSize 类型:long<br>
-页码数:docPageSize 类型:long<br>
+| 字段        | 字段名                       | 类型   | 格式化              |
+| ----------- | ---------------------------- | ------ | ------------------- |
+| _id         | 文档id                       | string |                     |
+| docName     | 文档名                       | string |                     |
+| docTags     | 文档标签(多个,用逗号隔开) | string |                     |
+| docClass    | 文档分类(多个,用逗号隔开) | string |                     |
+| price       | 积分价格                     | long   |                     |
+| downTimes   | 下载次数                     | long   |                     |
+| viewTimes   | 浏览次数                     | long   |                     |
+| docSummary  | 文档摘要                     | string |                     |
+| uploadDate  | 上传时间                     | long   | yyyy-MM-dd HH:mm:ss |
+| docFileSize | 文件大小                     | long   |                     |
+| docPageSize | 页码数                       | long   |                     |
+| docFileType | 文件类型                     | long   |
+|             |                             |        |
 
-## 创建文库jydoc索引
+#### 创建文库jydoc索引
 ```
-curl -XPUT http://localhost:9200/jydoc_v1 -H 'Content-Type:application/json' -d '{
+curl -XPUT http://localhost:9200/jydoc_v1 -u elastic:elastic -H 'Content-Type:application/json' -d '{
 	"mappings": {
 		"properties": {
 			"id": {
@@ -68,6 +72,9 @@ curl -XPUT http://localhost:9200/jydoc_v1 -H 'Content-Type:application/json' -d
 			"uploadDate": {
 				"type": "date",
 				"format": "yyyy-MM-dd HH:mm:ss"
+			},
+			"docFileType": {
+				"type": "long"
 			}
 		}
 	},

+ 2 - 1
go.mod

@@ -3,7 +3,8 @@ module app.yhyue.com/moapp/jy_docs
 go 1.14
 
 require (
-	app.yhyue.com/moapp/jybase v0.0.0-20210316070116-ec6a9a875194
+	app.yhyue.com/moapp/jyPoints v0.0.0-20210316030700-afaec87a982b
+	app.yhyue.com/moapp/jybase v0.0.0-20210317020927-18b0165f5ff9
 	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

+ 4 - 2
go.sum

@@ -1,5 +1,7 @@
-app.yhyue.com/moapp/jybase v0.0.0-20210316070116-ec6a9a875194 h1:86uHUxF4pgzU1KBE2MB85HC46Nz7l1raArCb9xiIxKQ=
-app.yhyue.com/moapp/jybase v0.0.0-20210316070116-ec6a9a875194/go.mod h1:29ShuI8y7qEyg2KviHSx1iamiCioBKdTMm2ndVzWAhk=
+app.yhyue.com/moapp/jyPoints v0.0.0-20210316030700-afaec87a982b h1:5HuXJ4k+0WwyJgkakUx8swhxz16xBJjH6FNogkupURY=
+app.yhyue.com/moapp/jyPoints v0.0.0-20210316030700-afaec87a982b/go.mod h1:nz39UQcXwZV90vOC7rIfos4LgrjGDcywHo96rdywdzk=
+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/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=

+ 3 - 1
rpc/stdlib/etc/stdlib.yaml

@@ -9,8 +9,10 @@ JyDocsMysqlDB:
 EsConfig:
   Addr: "http://192.168.3.241:9200,http://192.168.3.242:9200"
   Pool: 15
+  UserName: elastic
+  Password: elastic
 Etcd:
   Hosts:
-    - 192.168.3.240:2379
+    - 127.0.0.1:2379
   Key: jydocs.stdlib.rpc
 BucketName: "jydoc-std"

+ 2 - 2
rpc/stdlib/internal/logic/docofflogic.go

@@ -3,6 +3,7 @@ package logic
 import (
 	"app.yhyue.com/moapp/jy_docs/rpc/stdlib/internal/svc"
 	"app.yhyue.com/moapp/jy_docs/rpc/stdlib/stdlib"
+	"app.yhyue.com/moapp/jy_docs/services/model"
 	stdlibService "app.yhyue.com/moapp/jy_docs/services/stdlib"
 	"context"
 	"github.com/tal-tech/go-zero/core/logx"
@@ -24,8 +25,7 @@ func NewDocOffLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocOffLogi
 }
 
 func (l *DocOffLogic) DocOff(in *stdlib.DocChangeReq) (*stdlib.DocChangeResp, error) {
-	// todo: add your logic here and delete this line
-	status := stdlibService.ChangeDocumentOff(in.Id, in.Reason)
+	status := stdlibService.ChangeDocumentOff(&model.Doc{Id: in.Id, AppId: in.AppId}, in.Reason)
 	log.Println(status, "返回值-----------")
 	return &stdlib.DocChangeResp{State: status}, nil
 

+ 4 - 2
rpc/stdlib/internal/logic/doconlogic.go

@@ -3,9 +3,11 @@ package logic
 import (
 	"app.yhyue.com/moapp/jy_docs/rpc/stdlib/internal/svc"
 	"app.yhyue.com/moapp/jy_docs/rpc/stdlib/stdlib"
+	"app.yhyue.com/moapp/jy_docs/services/model"
 	stdlibService "app.yhyue.com/moapp/jy_docs/services/stdlib"
 	"context"
 	"github.com/tal-tech/go-zero/core/logx"
+	"log"
 )
 
 type DocOnLogic struct {
@@ -23,7 +25,7 @@ func NewDocOnLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocOnLogic
 }
 
 func (l *DocOnLogic) DocOn(in *stdlib.DocChangeReq) (*stdlib.DocChangeResp, error) {
-	// todo: add your logic here and delete this line
-	status := stdlibService.ChangeDocumentOn(in.Id, in.Reason)
+	status := stdlibService.ChangeDocumentOn(&model.Doc{Id: in.Id, AppId: in.AppId}, in.Reason)
+	log.Println(status, "返回值-----------")
 	return &stdlib.DocChangeResp{State: status}, nil
 }

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

@@ -25,8 +25,8 @@ func NewDocQueryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocQuery
 }
 
 func (l *DocQueryLogic) DocQuery(in *stdlib.DocQueryRequest) (*stdlib.DocQueryResponse, error) {
-	if in.PageNum <= 0 {
-		in.PageNum = 0
+	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{}

+ 1 - 1
rpc/stdlib/stdlib.go

@@ -22,7 +22,7 @@ func main() {
 	conf.MustLoad(*configFile, &c)
 	if c.JyDocsMysqlDB.DataSourceName != "" && c.EsConfig.Addr != "" {
 		jyDocsRpcUtil.InitDB(c.JyDocsMysqlDB.DataSourceName, c.JyDocsMysqlDB.DriverName, c.JyDocsMysqlDB.MaxOpenConn, c.JyDocsMysqlDB.MaxIdleConn)
-		jyDocsRpcUtil.InitEs(c.EsConfig.Addr, c.EsConfig.Pool)
+		jyDocsRpcUtil.InitEs(c.EsConfig.Addr, c.EsConfig.Pool, c.EsConfig.UserName, c.EsConfig.Password)
 		// jyDocsRpcUtil.InitOss(c.Etcd)
 		ctx := svc.NewServiceContext(c)
 		srv := server.NewStdlibServer(ctx)

+ 4 - 2
rpc/stdlib/stdlib.proto

@@ -9,8 +9,9 @@ message DocQueryRequest {
   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倒序
+  int64 downloadSort = 7;    // 下载次数排序 1正序 -1倒序
+  int64  viewSort = 8;      // 浏览量排序 1正序 -1倒序
+  string userId = 9; //用户id
 }
 
 message DocQueryResponse {
@@ -34,6 +35,7 @@ message Doc {
 message DocChangeReq {
   string id = 1; //文档id
   int32 reason = 2; //处理原因 1机审通过上架 2人审通过上加  10投诉下架 11过期下架
+  string appId = 3; //appId
 }
 
 message DocChangeResp {

+ 130 - 111
rpc/stdlib/stdlib/stdlib.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
 // 	protoc-gen-go v1.25.0
-// 	protoc        v3.15.6
+// 	protoc        v3.15.1
 // source: stdlib.proto
 
 package stdlib
@@ -42,6 +42,7 @@ type DocQueryRequest struct {
 	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
 }
 
 func (x *DocQueryRequest) Reset() {
@@ -132,6 +133,13 @@ func (x *DocQueryRequest) GetViewSort() int64 {
 	return 0
 }
 
+func (x *DocQueryRequest) GetUserId() string {
+	if x != nil {
+		return x.UserId
+	}
+	return ""
+}
+
 type DocQueryResponse struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -313,6 +321,7 @@ type DocChangeReq struct {
 
 	Id     string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`          //文档id
 	Reason int32  `protobuf:"varint,2,opt,name=reason,proto3" json:"reason,omitempty"` //处理原因 1机审通过上架 2人审通过上加  10投诉下架 11过期下架
+	AppId  string `protobuf:"bytes,3,opt,name=appId,proto3" json:"appId,omitempty"`    //appId
 }
 
 func (x *DocChangeReq) Reset() {
@@ -361,6 +370,13 @@ func (x *DocChangeReq) GetReason() int32 {
 	return 0
 }
 
+func (x *DocChangeReq) GetAppId() string {
+	if x != nil {
+		return x.AppId
+	}
+	return ""
+}
+
 type DocChangeResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -917,7 +933,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, 0xfd, 0x01, 0x0a, 0x0f, 0x44, 0x6f, 0x63, 0x51, 0x75,
+	0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x22, 0x95, 0x02, 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,
@@ -933,119 +949,122 @@ var file_stdlib_proto_rawDesc = []byte{
 	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, 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, 0xed, 0x01, 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, 0x1e, 0x0a, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61,
-	0x64, 0x44, 0x61, 0x74, 0x65, 0x18, 0x07, 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, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63,
-	0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x22, 0x36, 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, 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, 0x56, 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, 0x22, 0x3e,
-	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, 0x22, 0xfb,
-	0x01, 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, 0x05,
+	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, 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, 0x46, 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, 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,
+	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,
+	0xed, 0x01, 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,
+	0x1e, 0x0a, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x65, 0x18, 0x07, 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, 0x08, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 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, 0x56, 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, 0x22, 0x3e, 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, 0x22, 0xfb, 0x01, 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, 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,
+	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, 0x46, 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, 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, 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,
+	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 (

+ 4 - 4
rpc/stdlib/stdlibclient/stdlib.go

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

+ 3 - 3
rpc/stdlib/test/doc_test.go

@@ -15,7 +15,7 @@ import (
 func Test_DocOn(t *testing.T) {
 	ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
 	std := stdlibclient.NewStdlib(zrpc.MustNewClient(zrpc.RpcClientConf{Etcd: discov.EtcdConf{Hosts: []string{"192.168.3.240:2379"}, Key: "jydocs.stdlib.rpc"}}))
-	req := &stdlib.DocChangeReq{Id: "123", Reason: 1}
+	req := &stdlib.DocChangeReq{Id: "123", Reason: 1,AppId: "app_id_123"}
 	res, err := std.DocOn(ctx, req)
 	log.Println("err ", err)
 	if res.State == true {
@@ -25,9 +25,9 @@ func Test_DocOn(t *testing.T) {
 	}
 }
 func Test_DocOff(t *testing.T) {
-	ctx, _ := context.WithTimeout(context.Background(), 120*time.Second)
+	ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
 	std := stdlibclient.NewStdlib(zrpc.MustNewClient(zrpc.RpcClientConf{Etcd: discov.EtcdConf{Hosts: []string{"192.168.3.240:2379"}, Key: "jydocs.stdlib.rpc"}}))
-	req := &stdlib.DocChangeReq{Id: "123", Reason: 10}
+	req := &stdlib.DocChangeReq{Id: "123", Reason: 10,AppId: "app_id_123"}
 	res, err := std.DocOff(ctx, req)
 	log.Println("err ", err)
 	if res.State == true {

+ 1 - 1
rpc/stdlib/test/docquery_test.go

@@ -15,7 +15,7 @@ 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{KeyWords: "test"})
+	res, err := std.DocQuery(ctx, &stdlib.DocQueryRequest{KeyWord: "委托书"})
 	if err != nil {
 		log.Println(err)
 	} else {

+ 40 - 4
rpc/userlib/internal/logic/userdocslogic.go

@@ -1,10 +1,10 @@
 package logic
 
 import (
-	"context"
-
 	"app.yhyue.com/moapp/jy_docs/rpc/userlib/internal/svc"
 	"app.yhyue.com/moapp/jy_docs/rpc/userlib/userlib"
+	userLibService "app.yhyue.com/moapp/jy_docs/services/userlib"
+	"context"
 
 	"github.com/tal-tech/go-zero/core/logx"
 )
@@ -23,8 +23,44 @@ func NewUserDocsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserDocs
 	}
 }
 
+//我的文档 收藏和兑换
 func (l *UserDocsLogic) UserDocs(in *userlib.UserDocsRequest) (*userlib.UserDocsResponse, error) {
 	// todo: add your logic here and delete this line
-
-	return &userlib.UserDocsResponse{}, nil
+	result := &userlib.UserDocsResponse{}
+	data, count, code, msg := userLibService.UserDocsList(in)
+	docList := []*userlib.UserDocs{}
+	for _, value := range data {
+		docList = append(docList, &userlib.UserDocs{
+			ID:              int64(value.ID),
+			CreateAt:        value.CreateAt.String(),
+			UpdateAt:        value.UpdateAt.String(),
+			DeletedAt:       value.DeletedAt.String(),
+			AppId:           value.AppId,
+			UserId:          value.UserId,
+			DocId:           value.DocId,
+			DocCategory:     int64(value.DocCategory),
+			IsDelete:        int64(value.IsDelete),
+			DocName:         value.DocName,
+			DocFileType:     int64(value.DocFileType),
+			DocFileSuffix:   value.DocFileSuffix,
+			DocFileSize:     int64(value.DocFileSize),
+			DocPageSize:     int64(value.DocPageSize),
+			DocSummary:      value.DocSummary,
+			DocSourceUserId: value.DocSourceUserId,
+			IsDownload:      int64(value.IsDownload),
+			IsCollection:    int64(value.IsCollection),
+		})
+	}
+	if code {
+		result.Code = 1
+		result.Message = msg
+		result.Data = docList
+		result.Count = count
+		return result, nil
+	}
+	result.Code = 0
+	result.Message = msg
+	result.Data = docList
+	result.Count = count
+	return result, nil
 }

+ 21 - 1
rpc/userlib/test/userLib_test.go

@@ -104,7 +104,27 @@ func Test_UserDocPermanentDelete(t *testing.T) {
 	}
 	log.Print("UserDoc Collect call response:", resp)
 }
-
+//我的文库0兑换的 1收藏的 2回收站的
+func Test_UserDocList(t *testing.T)  {
+	client := zrpc.MustNewClient(zrpc.RpcClientConf{
+		Etcd: discov.EtcdConf{
+			Hosts: []string{"127.0.0.1:2380"},
+			Key:   "jydocs.userlib.rpc",
+		},
+	})
+	userLib := userlibclient.NewUserLib(client)
+	resp, err := userLib.UserDocs(context.Background(), &userlibclient.UserDocsRequest{
+		UserId: "wh11",
+		AppId:int64(10000),
+		PageSize:2,
+		Page:1,
+		UserDocCategory:2,
+	})
+	if err != nil {
+		log.Println("UserDoc Collect call error:", err)
+	}
+	log.Print("UserDoc Collect call response:", resp)
+}
 //用户转存单元测试
 func Test_UserDocDwnload(t *testing.T) {
 	client := zrpc.MustNewClient(zrpc.RpcClientConf{

+ 25 - 1
rpc/userlib/userlib.proto

@@ -53,12 +53,16 @@ message UserRestoreResponse {
 message UserDocsRequest {
     string userId=1;//用户id
     int64 appId=2;//剑鱼标识
-    UserDocCategory userDocCategory=3;//用户文档分类
+    int64 userDocCategory=3;//用户文档分类 0兑换的 1收藏的 2回收站的
+    int64 page = 4;
+    int64 pageSize = 5;
 }
 
 message UserDocsResponse {
     int32 code =1;    //响应代码
     string message=2; //响应消息
+    int64 count = 3;  //总数
+    repeated userDocs data=4; //列表
 }
 message UserRecoveryRequest {
     int32 userDocId =1;   //记录标识
@@ -69,6 +73,26 @@ enum UserDocStatus {
     LogicDelete =1;//删除
     PermanentlyDelete =2;//永久删除
 }
+message userDocs {
+    int64   ID=1;
+   	string  CreateAt=2;//创建时间
+    string	UpdateAt=3;//修改时间
+    string	DeletedAt=4;//删除时间
+    int64	AppId=5; //剑鱼标识
+    string	UserId=6;//用户标识
+    string	DocId=7;//文档标识
+    int64 	DocCategory=8;
+    int64	IsDelete=9;//是否删除,0 未删除  1 已逻辑删除 2永久删除
+    string	DocName=10;//文档名
+    int64 	DocFileType=11;//文件类型,0-doc ,1-pdf ,2-xls 3 ppt 4- txt 5- 其他
+    string	DocFileSuffix=12;//文件后辍
+    int64	DocFileSize=13;//文件大小
+    int64	DocPageSize=14;//页数
+    string	DocSummary=15;//文档摘要
+    string 	DocSourceUserId=16;//文档原用户id
+    int64 	IsDownload=17;//是否转存0未转存1转存
+    int64	IsCollection=18;//是否收藏0未收藏1收藏
+}
 service  UserLib {
     rpc UserDocs(UserDocsRequest) returns (UserDocsResponse);//用户文档列表
   	rpc DocCollect(UserCollectRequest) returns(UserCollectResponse); //文档收藏

+ 335 - 67
rpc/userlib/userlib/userlib.pb.go

@@ -534,9 +534,11 @@ type UserDocsRequest struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	UserId          string          `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"`                                                 //用户id
-	AppId           int64           `protobuf:"varint,2,opt,name=appId,proto3" json:"appId,omitempty"`                                                  //剑鱼标识
-	UserDocCategory UserDocCategory `protobuf:"varint,3,opt,name=userDocCategory,proto3,enum=userlib.UserDocCategory" json:"userDocCategory,omitempty"` //用户文档分类
+	UserId          string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"`                    //用户id
+	AppId           int64  `protobuf:"varint,2,opt,name=appId,proto3" json:"appId,omitempty"`                     //剑鱼标识
+	UserDocCategory int64  `protobuf:"varint,3,opt,name=userDocCategory,proto3" json:"userDocCategory,omitempty"` //用户文档分类 0兑换的 1收藏的 2回收站的
+	Page            int64  `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"`
+	PageSize        int64  `protobuf:"varint,5,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
 }
 
 func (x *UserDocsRequest) Reset() {
@@ -585,11 +587,25 @@ func (x *UserDocsRequest) GetAppId() int64 {
 	return 0
 }
 
-func (x *UserDocsRequest) GetUserDocCategory() UserDocCategory {
+func (x *UserDocsRequest) GetUserDocCategory() int64 {
 	if x != nil {
 		return x.UserDocCategory
 	}
-	return UserDocCategory_SelfUpload
+	return 0
+}
+
+func (x *UserDocsRequest) GetPage() int64 {
+	if x != nil {
+		return x.Page
+	}
+	return 0
+}
+
+func (x *UserDocsRequest) GetPageSize() int64 {
+	if x != nil {
+		return x.PageSize
+	}
+	return 0
 }
 
 type UserDocsResponse struct {
@@ -597,8 +613,10 @@ type UserDocsResponse struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Code    int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`      //响应代码
-	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` //响应消息
+	Code    int32       `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`      //响应代码
+	Message string      `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` //响应消息
+	Count   int64       `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`    //总数
+	Data    []*UserDocs `protobuf:"bytes,4,rep,name=data,proto3" json:"data,omitempty"`       //列表
 }
 
 func (x *UserDocsResponse) Reset() {
@@ -647,6 +665,20 @@ func (x *UserDocsResponse) GetMessage() string {
 	return ""
 }
 
+func (x *UserDocsResponse) GetCount() int64 {
+	if x != nil {
+		return x.Count
+	}
+	return 0
+}
+
+func (x *UserDocsResponse) GetData() []*UserDocs {
+	if x != nil {
+		return x.Data
+	}
+	return nil
+}
+
 type UserRecoveryRequest struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -702,6 +734,189 @@ func (x *UserRecoveryRequest) GetAppId() int64 {
 	return 0
 }
 
+type UserDocs struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	ID              int64  `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
+	CreateAt        string `protobuf:"bytes,2,opt,name=CreateAt,proto3" json:"CreateAt,omitempty"`   //创建时间
+	UpdateAt        string `protobuf:"bytes,3,opt,name=UpdateAt,proto3" json:"UpdateAt,omitempty"`   //修改时间
+	DeletedAt       string `protobuf:"bytes,4,opt,name=DeletedAt,proto3" json:"DeletedAt,omitempty"` //删除时间
+	AppId           int64  `protobuf:"varint,5,opt,name=AppId,proto3" json:"AppId,omitempty"`        //剑鱼标识
+	UserId          string `protobuf:"bytes,6,opt,name=UserId,proto3" json:"UserId,omitempty"`       //用户标识
+	DocId           string `protobuf:"bytes,7,opt,name=DocId,proto3" json:"DocId,omitempty"`         //文档标识
+	DocCategory     int64  `protobuf:"varint,8,opt,name=DocCategory,proto3" json:"DocCategory,omitempty"`
+	IsDelete        int64  `protobuf:"varint,9,opt,name=IsDelete,proto3" json:"IsDelete,omitempty"`               //是否删除,0 未删除  1 已逻辑删除 2永久删除
+	DocName         string `protobuf:"bytes,10,opt,name=DocName,proto3" json:"DocName,omitempty"`                 //文档名
+	DocFileType     int64  `protobuf:"varint,11,opt,name=DocFileType,proto3" json:"DocFileType,omitempty"`        //文件类型,0-doc ,1-pdf ,2-xls 3 ppt 4- txt 5- 其他
+	DocFileSuffix   string `protobuf:"bytes,12,opt,name=DocFileSuffix,proto3" json:"DocFileSuffix,omitempty"`     //文件后辍
+	DocFileSize     int64  `protobuf:"varint,13,opt,name=DocFileSize,proto3" json:"DocFileSize,omitempty"`        //文件大小
+	DocPageSize     int64  `protobuf:"varint,14,opt,name=DocPageSize,proto3" json:"DocPageSize,omitempty"`        //页数
+	DocSummary      string `protobuf:"bytes,15,opt,name=DocSummary,proto3" json:"DocSummary,omitempty"`           //文档摘要
+	DocSourceUserId string `protobuf:"bytes,16,opt,name=DocSourceUserId,proto3" json:"DocSourceUserId,omitempty"` //文档原用户id
+	IsDownload      int64  `protobuf:"varint,17,opt,name=IsDownload,proto3" json:"IsDownload,omitempty"`          //是否转存0未转存1转存
+	IsCollection    int64  `protobuf:"varint,18,opt,name=IsCollection,proto3" json:"IsCollection,omitempty"`      //是否收藏0未收藏1收藏
+}
+
+func (x *UserDocs) Reset() {
+	*x = UserDocs{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_userlib_proto_msgTypes[9]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *UserDocs) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UserDocs) ProtoMessage() {}
+
+func (x *UserDocs) ProtoReflect() protoreflect.Message {
+	mi := &file_userlib_proto_msgTypes[9]
+	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 UserDocs.ProtoReflect.Descriptor instead.
+func (*UserDocs) Descriptor() ([]byte, []int) {
+	return file_userlib_proto_rawDescGZIP(), []int{9}
+}
+
+func (x *UserDocs) GetID() int64 {
+	if x != nil {
+		return x.ID
+	}
+	return 0
+}
+
+func (x *UserDocs) GetCreateAt() string {
+	if x != nil {
+		return x.CreateAt
+	}
+	return ""
+}
+
+func (x *UserDocs) GetUpdateAt() string {
+	if x != nil {
+		return x.UpdateAt
+	}
+	return ""
+}
+
+func (x *UserDocs) GetDeletedAt() string {
+	if x != nil {
+		return x.DeletedAt
+	}
+	return ""
+}
+
+func (x *UserDocs) GetAppId() int64 {
+	if x != nil {
+		return x.AppId
+	}
+	return 0
+}
+
+func (x *UserDocs) GetUserId() string {
+	if x != nil {
+		return x.UserId
+	}
+	return ""
+}
+
+func (x *UserDocs) GetDocId() string {
+	if x != nil {
+		return x.DocId
+	}
+	return ""
+}
+
+func (x *UserDocs) GetDocCategory() int64 {
+	if x != nil {
+		return x.DocCategory
+	}
+	return 0
+}
+
+func (x *UserDocs) GetIsDelete() int64 {
+	if x != nil {
+		return x.IsDelete
+	}
+	return 0
+}
+
+func (x *UserDocs) GetDocName() string {
+	if x != nil {
+		return x.DocName
+	}
+	return ""
+}
+
+func (x *UserDocs) GetDocFileType() int64 {
+	if x != nil {
+		return x.DocFileType
+	}
+	return 0
+}
+
+func (x *UserDocs) GetDocFileSuffix() string {
+	if x != nil {
+		return x.DocFileSuffix
+	}
+	return ""
+}
+
+func (x *UserDocs) GetDocFileSize() int64 {
+	if x != nil {
+		return x.DocFileSize
+	}
+	return 0
+}
+
+func (x *UserDocs) GetDocPageSize() int64 {
+	if x != nil {
+		return x.DocPageSize
+	}
+	return 0
+}
+
+func (x *UserDocs) GetDocSummary() string {
+	if x != nil {
+		return x.DocSummary
+	}
+	return ""
+}
+
+func (x *UserDocs) GetDocSourceUserId() string {
+	if x != nil {
+		return x.DocSourceUserId
+	}
+	return ""
+}
+
+func (x *UserDocs) GetIsDownload() int64 {
+	if x != nil {
+		return x.IsDownload
+	}
+	return 0
+}
+
+func (x *UserDocs) GetIsCollection() int64 {
+	if x != nil {
+		return x.IsCollection
+	}
+	return 0
+}
+
 var File_userlib_proto protoreflect.FileDescriptor
 
 var file_userlib_proto_rawDesc = []byte{
@@ -733,70 +948,110 @@ var file_userlib_proto_rawDesc = []byte{
 	0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
 	0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
 	0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
-	0x65, 0x22, 0x83, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x65,
+	0x65, 0x22, 0x99, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x65,
 	0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18,
 	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a,
 	0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x61, 0x70,
-	0x70, 0x49, 0x64, 0x12, 0x42, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x43, 0x61,
-	0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x75,
-	0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x43, 0x61,
-	0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x43,
-	0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x22, 0x40, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x44,
-	0x6f, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63,
-	0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12,
-	0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x49, 0x0a, 0x13, 0x55, 0x73, 0x65,
-	0x72, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
-	0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x49, 0x64, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x05, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x49, 0x64, 0x12, 0x14,
-	0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x61,
-	0x70, 0x70, 0x49, 0x64, 0x2a, 0x3c, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x43,
-	0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x65, 0x6c, 0x66, 0x55,
-	0x70, 0x6c, 0x6f, 0x61, 0x64, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x6f, 0x77, 0x6e, 0x6c,
-	0x6f, 0x61, 0x64, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
-	0x10, 0x02, 0x2a, 0x4c, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x46, 0x69, 0x6c,
-	0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x57, 0x6f, 0x72, 0x64, 0x10, 0x00, 0x12,
-	0x07, 0x0a, 0x03, 0x50, 0x44, 0x46, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x58, 0x43, 0x45,
-	0x4c, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x50, 0x54, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03,
-	0x54, 0x58, 0x54, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x10, 0x05,
-	0x2a, 0x43, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75,
-	0x73, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x10, 0x00, 0x12, 0x0f, 0x0a,
-	0x0b, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x10, 0x01, 0x12, 0x15,
-	0x0a, 0x11, 0x50, 0x65, 0x72, 0x6d, 0x61, 0x6e, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x44, 0x65, 0x6c,
-	0x65, 0x74, 0x65, 0x10, 0x02, 0x32, 0x8e, 0x04, 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69,
-	0x62, 0x12, 0x3f, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x18, 0x2e,
-	0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x73,
-	0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69,
-	0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
-	0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x44, 0x6f, 0x63, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
-	0x12, 0x1b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43,
-	0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e,
-	0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x6c,
-	0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x10, 0x44,
-	0x6f, 0x63, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12,
-	0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65,
-	0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x75, 0x73,
-	0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
-	0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x09, 0x44, 0x6f, 0x63, 0x44,
-	0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e,
+	0x70, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x43, 0x61,
+	0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x75, 0x73,
+	0x65, 0x72, 0x44, 0x6f, 0x63, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a,
+	0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67,
+	0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x7d, 0x0a,
+	0x10, 0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+	0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
+	0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
+	0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
+	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20,
+	0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x75, 0x73,
+	0x65, 0x72, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x49, 0x0a, 0x13,
 	0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75,
-	0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73,
-	0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
-	0x12, 0x48, 0x0a, 0x0a, 0x44, 0x6f, 0x63, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x1c,
-	0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x63,
-	0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x75,
-	0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x74, 0x6f,
-	0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x44, 0x6f,
-	0x63, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1b, 0x2e, 0x75, 0x73, 0x65, 0x72,
+	0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x49, 0x64,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x49,
+	0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0xa6, 0x04, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72,
+	0x44, 0x6f, 0x63, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x02, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74,
+	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74,
+	0x12, 0x1a, 0x0a, 0x08, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x74, 0x18, 0x03, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x08, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x74, 0x12, 0x1c, 0x0a, 0x09,
+	0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x70,
+	0x70, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64,
+	0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x44, 0x6f, 0x63, 0x49,
+	0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x44, 0x6f, 0x63, 0x49, 0x64, 0x12, 0x20,
+	0x0a, 0x0b, 0x44, 0x6f, 0x63, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x08, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x0b, 0x44, 0x6f, 0x63, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79,
+	0x12, 0x1a, 0x0a, 0x08, 0x49, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x08, 0x49, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07,
+	0x44, 0x6f, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x44,
+	0x6f, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x44, 0x6f, 0x63, 0x46, 0x69, 0x6c,
+	0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x44, 0x6f, 0x63,
+	0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x44, 0x6f, 0x63, 0x46,
+	0x69, 0x6c, 0x65, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x0d, 0x44, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x20,
+	0x0a, 0x0b, 0x44, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x0d, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x0b, 0x44, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65,
+	0x12, 0x20, 0x0a, 0x0b, 0x44, 0x6f, 0x63, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18,
+	0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x44, 0x6f, 0x63, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69,
+	0x7a, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x44, 0x6f, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79,
+	0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x44, 0x6f, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61,
+	0x72, 0x79, 0x12, 0x28, 0x0a, 0x0f, 0x44, 0x6f, 0x63, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55,
+	0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x44, 0x6f, 0x63,
+	0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a,
+	0x49, 0x73, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x0a, 0x49, 0x73, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x22, 0x0a, 0x0c,
+	0x49, 0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x0c, 0x49, 0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+	0x2a, 0x3c, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x43, 0x61, 0x74, 0x65, 0x67,
+	0x6f, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x65, 0x6c, 0x66, 0x55, 0x70, 0x6c, 0x6f, 0x61,
+	0x64, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x10,
+	0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x10, 0x02, 0x2a, 0x4c,
+	0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70,
+	0x65, 0x12, 0x08, 0x0a, 0x04, 0x57, 0x6f, 0x72, 0x64, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50,
+	0x44, 0x46, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x58, 0x43, 0x45, 0x4c, 0x10, 0x02, 0x12,
+	0x07, 0x0a, 0x03, 0x50, 0x50, 0x54, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x58, 0x54, 0x10,
+	0x04, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x10, 0x05, 0x2a, 0x43, 0x0a, 0x0d,
+	0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a,
+	0x06, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x6f, 0x67,
+	0x69, 0x63, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x50, 0x65,
+	0x72, 0x6d, 0x61, 0x6e, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x10,
+	0x02, 0x32, 0x8e, 0x04, 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x62, 0x12, 0x3f, 0x0a,
+	0x08, 0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x18, 0x2e, 0x75, 0x73, 0x65, 0x72,
+	0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75,
+	0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73,
+	0x65, 0x72, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47,
+	0x0a, 0x0a, 0x44, 0x6f, 0x63, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x1b, 0x2e, 0x75,
+	0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65,
+	0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72,
 	0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52,
-	0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62,
-	0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70,
-	0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x12, 0x44, 0x6f, 0x63, 0x50, 0x65, 0x72, 0x6d, 0x61,
-	0x6e, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x75, 0x73, 0x65,
+	0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x10, 0x44, 0x6f, 0x63, 0x43, 0x61,
+	0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x1a, 0x2e, 0x75, 0x73,
+	0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
+	0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69,
+	0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70,
+	0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x09, 0x44, 0x6f, 0x63, 0x44, 0x65, 0x6c, 0x65, 0x74,
+	0x65, 0x12, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72,
+	0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
+	0x1b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65,
+	0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0a,
+	0x44, 0x6f, 0x63, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x1c, 0x2e, 0x75, 0x73, 0x65,
 	0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72,
 	0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c,
-	0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65,
-	0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x69, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65,
+	0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x44, 0x6f, 0x63, 0x44, 0x6f, 0x77,
+	0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e,
+	0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
+	0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55, 0x73, 0x65,
+	0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+	0x12, 0x50, 0x0a, 0x12, 0x44, 0x6f, 0x63, 0x50, 0x65, 0x72, 0x6d, 0x61, 0x6e, 0x65, 0x6e, 0x74,
+	0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62,
+	0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71,
+	0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6c, 0x69, 0x62, 0x2e, 0x55,
+	0x73, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+	0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -812,7 +1067,7 @@ func file_userlib_proto_rawDescGZIP() []byte {
 }
 
 var file_userlib_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
-var file_userlib_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
+var file_userlib_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
 var file_userlib_proto_goTypes = []interface{}{
 	(UserDocCategory)(0),        // 0: userlib.UserDocCategory
 	(UserDocFileType)(0),        // 1: userlib.UserDocFileType
@@ -826,9 +1081,10 @@ var file_userlib_proto_goTypes = []interface{}{
 	(*UserDocsRequest)(nil),     // 9: userlib.UserDocsRequest
 	(*UserDocsResponse)(nil),    // 10: userlib.UserDocsResponse
 	(*UserRecoveryRequest)(nil), // 11: userlib.UserRecoveryRequest
+	(*UserDocs)(nil),            // 12: userlib.userDocs
 }
 var file_userlib_proto_depIdxs = []int32{
-	0,  // 0: userlib.UserDocsRequest.userDocCategory:type_name -> userlib.UserDocCategory
+	12, // 0: userlib.UserDocsResponse.data:type_name -> userlib.userDocs
 	9,  // 1: userlib.UserLib.UserDocs:input_type -> userlib.UserDocsRequest
 	3,  // 2: userlib.UserLib.DocCollect:input_type -> userlib.UserCollectRequest
 	5,  // 3: userlib.UserLib.DocCancelCollect:input_type -> userlib.UserDeleteRequest
@@ -964,6 +1220,18 @@ func file_userlib_proto_init() {
 				return nil
 			}
 		}
+		file_userlib_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*UserDocs); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
 	}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
@@ -971,7 +1239,7 @@ func file_userlib_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_userlib_proto_rawDesc,
 			NumEnums:      3,
-			NumMessages:   9,
+			NumMessages:   10,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 6 - 5
rpc/userlib/userlibclient/userlib.go

@@ -14,15 +14,16 @@ import (
 )
 
 type (
+	UserDeleteResponse  = userlib.UserDeleteResponse
+	UserRecoveryRequest = userlib.UserRecoveryRequest
+	UserCollectRequest  = userlib.UserCollectRequest
 	UserCollectResponse = userlib.UserCollectResponse
 	UserDeleteRequest   = userlib.UserDeleteRequest
-	UserRestoreResponse = userlib.UserRestoreResponse
-	UserDocsRequest     = userlib.UserDocsRequest
 	UserDocsResponse    = userlib.UserDocsResponse
-	UserCollectRequest  = userlib.UserCollectRequest
-	UserDeleteResponse  = userlib.UserDeleteResponse
+	UserDocs            = userlib.UserDocs
 	UserRestoreRequest  = userlib.UserRestoreRequest
-	UserRecoveryRequest = userlib.UserRecoveryRequest
+	UserRestoreResponse = userlib.UserRestoreResponse
+	UserDocsRequest     = userlib.UserDocsRequest
 
 	UserLib interface {
 		UserDocs(ctx context.Context, in *UserDocsRequest) (*UserDocsResponse, error)

+ 23 - 23
services/model/stdlib.go

@@ -5,28 +5,28 @@ import (
 )
 
 type Doc struct {
-	Id               string `json:"id" gorm:"id"`
-	UserId           string `json:"userId" gorm:"column:userId"`
-	DocName          string `json:"docName" gorm:"column:docName"`
-	DocFileType      int    `json:"docFileType" gorm:"column:docFileType"`
-	DocFileSuffix    string `json:"docFileSuffix" gorm:"column:docFileSuffix"`
-	DocFileSize      int    `json:"docFileSize" gorm:"column:docFileSize"`
-	DocPageSize      int    `json:"docPageSize" gorm:"column:docPageSize"`
-	DocTags          string `json:"docTags" gorm:"column:docTags"`
-	DocClassLevelOne string `json:"docClassLevelOne" gorm:"column:docClassLevelOne"`
-	DocClassLevelTwo string `json:"docClassLevelTwo" gorm:"column:docClassLevelTwo"`
-	UploadDate       string `json:"uploadDate" gorm:"column:uploadDate"`
-	IsDelete         int    `json:"isDelete" gorm:"column:isDelete"`
-	OssDocId         string `json:"ossDocId" gorm:"column:ossDocId"`
-	OssDocUrl        string `json:"ossDocUrl" gorm:"column:ossDocUrl"`
-	Md5              string `json:"md5" gorm:"column:md5"`
-	OssPdfId         string `json:"ossPdfId" gorm:"column:ossPdfId"`
-	OssPdfUrl        string `json:"ossPdfUrl" gorm:"column:ossPdfUrl"`
-	OssTxtId         string `json:"ossTxtId" gorm:"column:ossTxtId"`
-	OssTxtUrl        string `json:"ossTxtUrl" gorm:"column:ossTxtUrl"`
-	Price            int    `json:"price" gorm:"column:price"`
-	DownOrUp         int    `json:"downOrUp" gorm:"column:downOrUp"`
-	DocSummary       string `json:"docSummary" gorm:"column:docSummary"`
+	Id            string    `json:"id" gorm:"id"`
+	UserId        string    `json:"userId" gorm:"column:userId"`
+	AppId         string    `json:"appId" gorm:"column:appId"`
+	DocName       string    `json:"docName" gorm:"column:docName"`
+	DocFileType   int       `json:"docFileType" gorm:"column:docFileType"`
+	DocFileSuffix string    `json:"docFileSuffix" gorm:"column:docFileSuffix"`
+	DocFileSize   int       `json:"docFileSize" gorm:"column:docFileSize"`
+	DocPageSize   int       `json:"docPageSize" gorm:"column:docPageSize"`
+	DocTags       string    `json:"docTags" gorm:"column:docTags"`
+	DocClass      string    `json:"docClass" gorm:"column:docClass"`
+	UploadDate    time.Time `json:"uploadDate" gorm:"column:uploadDate"`
+	IsDelete      int       `json:"isDelete" gorm:"column:isDelete"`
+	OssDocId      string    `json:"ossDocId" gorm:"column:ossDocId"`
+	OssDocUrl     string    `json:"ossDocUrl" gorm:"column:ossDocUrl"`
+	Md5           string    `json:"md5" gorm:"column:md5"`
+	OssPdfId      string    `json:"ossPdfId" gorm:"column:ossPdfId"`
+	OssPdfUrl     string    `json:"ossPdfUrl" gorm:"column:ossPdfUrl"`
+	OssTxtId      string    `json:"ossTxtId" gorm:"column:ossTxtId"`
+	OssTxtUrl     string    `json:"ossTxtUrl" gorm:"column:ossTxtUrl"`
+	Price         int       `json:"price" gorm:"column:price"`
+	DownOrUp      int       `json:"downOrUp" gorm:"column:downOrUp"`
+	DocSummary    string    `json:"docSummary" gorm:"column:docSummary"`
 }
 
 func (ud *Doc) TableName() string {
@@ -38,7 +38,7 @@ type UserDoc struct {
 	CreateAt        time.Time `json:"create_at" gorm:"create_at"` //标签autoCreateTime设置如果字段名字不为CreatAt时候自动插入当前时间
 	UpdateAt        time.Time `json:"update_at" gorm:"update_at"`
 	DeletedAt       time.Time `json:"delete_at" gorm:"column:delete_at"`
-	AppId           int64    `json:"app_id"  gorm:"column:appId"`
+	AppId           int64     `json:"app_id"  gorm:"column:appId"`
 	UserId          string    `json:"user_id"  gorm:"column:userId"`
 	DocId           string    `json:"doc_id" gorm:"column:docId"`
 	DocCategory     int       `json:"doc_category" gorm:"column:docCategory"`

+ 34 - 32
services/stdlib/docChangeService.go

@@ -1,6 +1,7 @@
 package stdlib
 
 import (
+	"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"
@@ -13,25 +14,25 @@ const DocOn = 1
 const DocOff = 0
 
 // 上架文档
-func ChangeDocumentOn(id string, reason int32) bool {
+func ChangeDocumentOn(doc *model.Doc, reason int32) bool {
 	// 查文档
 	docData := map[string]interface{}{}
-	rs := jyDocsRpcUtil.GetJyDocsDB().Table("doc").Where("id=? and isDelete=0 and downOrUp=0", id).Find(&docData)
+	rs := jyDocsRpcUtil.GetJyDocsDB().Table("doc").Where("id=? and isDelete=0 and downOrUp=0 and appId=?", doc.Id, doc.AppId).Find(&docData)
 	if rs.Error != nil {
-		log.Println("上架文档 error:"+id, rs.Error)
+		log.Printf("上架文档 appId:%s,Id:%s, error: %s\n", doc.AppId, doc.Id, rs.Error)
 		return false
 	} else {
 		if docData["id"] == nil {
-			log.Println("上架文档 error:"+id, "文档不存在或已经被上架")
+			log.Printf("上架文档 appId:%s,Id:%s, error: %s\n", doc.AppId, doc.Id, "文档不存在或已经被上架")
 			return false
 		}
 	}
 	statisticsData := map[string]interface{}{}
 	var downTimes int64
 	var viewTimes int64
-	result := jyDocsRpcUtil.GetJyDocsDB().Table("doc_statistics").Where("docId=?", id).Find(&statisticsData)
+	result := jyDocsRpcUtil.GetJyDocsDB().Table("doc_statistics").Where("docId=? and appId=?", doc.Id, doc.AppId).Find(&statisticsData)
 	if result.Error != nil {
-		log.Println("上架文档 查询浏览次数下载量出错 error:"+id, result.Error)
+		log.Printf("上架文档 查询浏览次数下载量出错 appId:%s,Id:%s, error:%s\n", doc.AppId, doc.Id, result.Error)
 		return false
 	} else {
 		if statisticsData["id"] != nil {
@@ -46,76 +47,77 @@ func ChangeDocumentOn(id string, reason int32) bool {
 	// 上架
 	err := jyDocsRpcUtil.GetJyDocsDB().Transaction(func(tx *gorm.DB) error {
 		// 更新大库状态为上架 1-上架
-		if err := tx.Exec("update doc set downOrUp=? where id=? ", DocOn, id).Error; err != nil {
+		if err := tx.Exec("update doc set downOrUp=? where id=? and appId=?", DocOn, doc.Id, doc.AppId).Error; err != nil {
 			return err
 		}
 		// 存上架记录
 		date := time.Now().Local().Format("2006-01-02 15:04:05")
-		if err := tx.Exec("insert into doc_change_record (docId,date,downOrUp,reason) values (?,?,?,?)", id, date, DocOn, reason).Error; err != nil {
+		if err := tx.Exec("insert into doc_change_record (docId,date,downOrUp,reason,appId) values (?,?,?,?,?)", doc.Id, date, DocOn, reason, doc.AppId).Error; err != nil {
 			return err
 		}
-		docData["_id"] = docData["id"]
 		saveData := map[string]interface{}{
-			"_id":              docData["id"],
-			"docName":          docData["docName"],
-			"docTags":          docData["docTags"],
-			"docClassLevelOne": docData["docClassLevelOne"],
-			"docClassLevelTwo": docData["docClassLevelTwo"],
-			"price":            docData["price"],
-			"downTimes":        downTimes,
-			"viewTimes":        viewTimes,
-			"docSummary":       docData["docSummary"],
-			"create_at":        docData["uploadDate"].(time.Time).Format("2006-01-02 15:04:05"),
+			"_id":         docData["id"],
+			"docName":     docData["docName"],
+			"docTags":     docData["docTags"],
+			"docClass":    docData["docClass"],
+			"price":       docData["price"],
+			"downTimes":   downTimes,
+			"viewTimes":   viewTimes,
+			"docSummary":  docData["docSummary"],
+			"uploadDate":  docData["uploadDate"].(time.Time).Format("2006-01-02 15:04:05"),
+			"docFileSize": docData["docFileSize"],
+			"docPageSize": docData["docPageSize"],
+			"docFileType": docData["docFileType"],
 		}
-		if rs := elastic.Save("jydoc", "_doc", saveData); rs != true {
+		if rs := elastic.Save(jyDocsRpcUtil.Es_JyDoc, "_doc", saveData); rs != true {
 			return errors.New("发布到检索库失败")
 		}
 		return nil
 	})
 	if err != nil {
-		log.Println("上架文档 error:"+id, err)
+		log.Printf("上架文档 appId:%s,Id:%s, error:%s\n", doc.AppId, doc.Id, err)
 		return false
 	}
-	log.Println("上架文档成功:" + id)
+	log.Println("上架文档成功:" + doc.Id)
 	return true
 }
 
 // 下架文档
-func ChangeDocumentOff(id string, reason int32) bool {
+func ChangeDocumentOff(doc *model.Doc, reason int32) bool {
 	// 查文档
 	docData := map[string]interface{}{}
-	rs := jyDocsRpcUtil.GetJyDocsDB().Table("doc").Where("id=? and isDelete=0 and downOrUp=1", id).Find(&docData)
+	rs := jyDocsRpcUtil.GetJyDocsDB().Table("doc").Where("id=? and isDelete=0 and downOrUp=1 and appId=?", doc.Id, doc.AppId).Find(&docData)
 	if rs.Error != nil {
-		log.Println("下架文档 error:"+id, rs.Error)
+		log.Printf("下架文档 appId:%s,Id:%s, error:%s\n", doc.AppId, doc.Id, rs.Error)
 		return false
 	} else {
 		if docData["id"] == nil {
-			log.Println("下架文档 error:"+id, "文档不存在或已经被下架")
+			log.Printf("下架文档 appId:%s,Id:%s, error:%s\n", doc.AppId, doc.Id, "文档不存在或已经被下架")
 			return false
 		}
 	}
 	// 下架
 	err := jyDocsRpcUtil.GetJyDocsDB().Transaction(func(tx *gorm.DB) error {
 		// 更新大库状态为下架 0-下架
-		if err := tx.Exec("update doc set downOrUp=? where id=? ", DocOff, id).Error; err != nil {
+		if err := tx.Exec("update doc set downOrUp=? where id=? and appId=?", DocOff, doc.Id, doc.AppId).Error; err != nil {
 			return err
 		}
 		// 存下架记录
 		date := time.Now().Local().Format("2006-01-02 15:04:05")
-		if err := tx.Exec("insert into doc_change_record (docId,date,downOrUp,reason) values (?,?,?,?)", id, date, DocOff, reason).Error; err != nil {
+		if err := tx.Exec("insert into doc_change_record (docId,date,downOrUp,reason,appId) values (?,?,?,?,?)", doc.Id, date, DocOff, reason, doc.AppId).Error; err != nil {
 			return err
 		}
-		//todo 从es删除数据 索引待替换 及测试
-		if rs := elastic.DelById("jydoc", "doc", id); rs != true {
+
+		if rs := elastic.DelById(jyDocsRpcUtil.Es_JyDoc, "doc", doc.Id); rs != true {
 			return errors.New("从检索库删除失败")
 		}
 		return nil
 	})
 
 	if err != nil {
-		log.Println("下架文档 error:"+id, err)
+		log.Printf("下架文档 appId:%s,Id:%s, error:%s:\n", doc.AppId, doc.Id, err)
 		return false
 	}
-	log.Println("下架文档成功:" + id)
+	log.Println("下架文档成功:" + doc.Id)
 	return true
 }

+ 2 - 3
services/stdlib/docService.go

@@ -73,11 +73,10 @@ func FindDocumentsByKeyWords(keyWord string, docClass, docTag []string, publishT
 	}
 	query := ""
 	if keyWord != "" {
-		query = Es_Query_Boosting
+		fmt.Sprintf(Es_Query_Boosting, strings.Join(musts, ","), strings.Join(negative_musts, ","), fmt.Sprintf(Es_Query_Append, strings.Join(sorts, ","), (pageNum-1)*pageSize, pageSize))
 	} else {
-		query = Es_Query_Bool
+		fmt.Sprintf(Es_Query_Bool, strings.Join(musts, ","), fmt.Sprintf(Es_Query_Append, strings.Join(sorts, ","), (pageNum-1)*pageSize, pageSize))
 	}
-	query = fmt.Sprintf(query, strings.Join(musts, ","), fmt.Sprintf(Es_Query_Append, strings.Join(sorts, ","), (pageNum-1)*pageSize, pageSize))
 	log.Println("query:", query)
 	return elastic.DfsGet(jyDocsRpcUtil.Es_JyDoc, "", query)
 }

+ 60 - 11
services/userlib/userDocService.go

@@ -126,7 +126,7 @@ func UserDocDownload(userDoc *model.UserDoc, cost int, hosts []string, key strin
 		//获取文档有关信息
 		//查询之前有无兑换记录  0和1只要有一条不能兑换,如果有未删除可以兑换
 		userDocDownloadList := []model.UserDoc{}
-		err := docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and docId=? and isDownload=1 and (isDelete=? or isDelete=?)  and  appId=?", userDoc.UserId, userDoc.DocId, model.UserDocStatus_Normal, model.UserDocStatus_LogicDelete,userDoc.AppId).Find(&userDocDownloadList)
+		err := docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and docId=? and isDownload=1 and (isDelete=? or isDelete=?)  and  appId=?", userDoc.UserId, userDoc.DocId, model.UserDocStatus_Normal, model.UserDocStatus_LogicDelete, userDoc.AppId).Find(&userDocDownloadList)
 		if err.Error != nil {
 			log.Println("查询兑换记录失败:", err)
 			msg = "查询兑换记录失败"
@@ -187,7 +187,7 @@ func UserDocDownload(userDoc *model.UserDoc, cost int, hosts []string, key strin
 				return err.Error
 			}
 			//用户收藏、兑换记录表添加记录
-			err := docRpcUtil.GetJyDocsDB().Exec("insert into download_collection_record (docId,userId,sourceUserId,category,cost,date,appId) values (?,?,?,?,?,?,?)", userDoc.DocId, userDoc.UserId, userDoc.DocSourceUserId, model.UserDocCategory_Download, cost, time.Now(),userDoc.AppId)
+			err := docRpcUtil.GetJyDocsDB().Exec("insert into download_collection_record (docId,userId,sourceUserId,category,cost,date,appId) values (?,?,?,?,?,?,?)", userDoc.DocId, userDoc.UserId, userDoc.DocSourceUserId, model.UserDocCategory_Download, cost, time.Now(), userDoc.AppId)
 			if err.Error != nil {
 				log.Println("兑换操作流水添加失败:", err)
 				msg = "兑换操作流水添加失败"
@@ -199,8 +199,8 @@ func UserDocDownload(userDoc *model.UserDoc, cost int, hosts []string, key strin
 			userDoc.CreateAt = time.Now()
 			userDoc.UpdateAt = time.Now()
 			userDoc.DeletedAt = time.Now()
-			userDoc.IsCollection=0
-			userDoc.IsDownload=1
+			userDoc.IsCollection = 0
+			userDoc.IsDownload = 1
 			//获取文件基本信息
 
 			//查询文档基础信息
@@ -229,7 +229,7 @@ func UserDocDownload(userDoc *model.UserDoc, cost int, hosts []string, key strin
 				return err.Error
 			}
 			//用户收藏、兑换记录表添加记录
-			err := docRpcUtil.GetJyDocsDB().Exec("insert into download_collection_record (docId,userId,sourceUserId,category,cost,date,appId) values (?,?,?,?,?,?,?)", userDoc.DocId, userDoc.UserId, userDoc.DocSourceUserId, model.UserDocCategory_Download, cost, time.Now(),userDoc.AppId)
+			err := docRpcUtil.GetJyDocsDB().Exec("insert into download_collection_record (docId,userId,sourceUserId,category,cost,date,appId) values (?,?,?,?,?,?,?)", userDoc.DocId, userDoc.UserId, userDoc.DocSourceUserId, model.UserDocCategory_Download, cost, time.Now(), userDoc.AppId)
 			if err.Error != nil {
 				log.Println("兑换操作流水添加失败:", err)
 				msg = "兑换操作流水添加失败"
@@ -246,7 +246,7 @@ func UserDocDownload(userDoc *model.UserDoc, cost int, hosts []string, key strin
 }
 
 //文档删除
-func UserDocDelete(userDocId int32,appId int64 ) (bool, string) {
+func UserDocDelete(userDocId int32, appId int64) (bool, string) {
 	msg := "文档删除成功"
 	err := docRpcUtil.GetJyDocsDB().Transaction(func(tx *gorm.DB) error {
 		//逻辑删除
@@ -264,7 +264,7 @@ func UserDocDelete(userDocId int32,appId int64 ) (bool, string) {
 		log.Println(docData.UserId)
 		log.Println(docData.DocId)
 		//删除记录新增
-		err = docRpcUtil.GetJyDocsDB().Exec("insert into del_record (docId, userId, date, operate, appId) values (?,?,?,?,?)",  docData.DocId,docData.UserId, time.Now(),  1, appId).Error
+		err = docRpcUtil.GetJyDocsDB().Exec("insert into del_record (docId, userId, date, operate, appId) values (?,?,?,?,?)", docData.DocId, docData.UserId, time.Now(), 1, appId).Error
 		if err != nil {
 			tx.Rollback()
 			msg = "删除记录新增失败"
@@ -281,7 +281,7 @@ func UserDocDelete(userDocId int32,appId int64 ) (bool, string) {
 }
 
 //文档回收
-func UserDocRestore(userDocId int32,appId int64) (bool, string) {
+func UserDocRestore(userDocId int32, appId int64) (bool, string) {
 	msg := "文档找回成功"
 	err := docRpcUtil.GetJyDocsDB().Transaction(func(tx *gorm.DB) error {
 		//逻辑删除
@@ -298,7 +298,7 @@ func UserDocRestore(userDocId int32,appId int64) (bool, string) {
 		log.Println(docData.UserId)
 		log.Println(docData.DocId)
 		//删除记录新增
-		err = docRpcUtil.GetJyDocsDB().Exec("insert into del_record (docId, userId, date, operate, appId) values (?,?,?,?,?)",  docData.DocId,docData.UserId, time.Now(),  2, appId).Error
+		err = docRpcUtil.GetJyDocsDB().Exec("insert into del_record (docId, userId, date, operate, appId) values (?,?,?,?,?)", docData.DocId, docData.UserId, time.Now(), 2, appId).Error
 		if err != nil {
 			tx.Rollback()
 			msg = "删除记录新增失败"
@@ -313,7 +313,7 @@ func UserDocRestore(userDocId int32,appId int64) (bool, string) {
 	return true, msg
 
 } //永久删除
-func UserDocPermanentDelete(userDocId int32,appId int64) (bool, string) {
+func UserDocPermanentDelete(userDocId int32, appId int64) (bool, string) {
 	msg := "永久删除成功"
 	err := docRpcUtil.GetJyDocsDB().Transaction(func(tx *gorm.DB) error {
 		//逻辑删除
@@ -330,7 +330,7 @@ func UserDocPermanentDelete(userDocId int32,appId int64) (bool, string) {
 		log.Println(docData.UserId)
 		log.Println(docData.DocId)
 		//删除记录新增
-		err = docRpcUtil.GetJyDocsDB().Exec("insert into del_record (docId, userId, date, operate, appId) values (?,?,?,?,?)",  docData.DocId,docData.UserId, time.Now(),4, appId).Error
+		err = docRpcUtil.GetJyDocsDB().Exec("insert into del_record (docId, userId, date, operate, appId) values (?,?,?,?,?)", docData.DocId, docData.UserId, time.Now(), 4, appId).Error
 		if err != nil {
 			tx.Rollback()
 			msg = "删除记录新增失败"
@@ -345,3 +345,52 @@ func UserDocPermanentDelete(userDocId int32,appId int64) (bool, string) {
 	return true, msg
 
 }
+
+//我的文库列表(包括回收站列表)0兑换的 1收藏的 2回收站的
+func UserDocsList(in *userlib.UserDocsRequest) ([]*model.UserDoc, int64, bool, string) {
+	msg := "查询成功"
+	data := []*model.UserDoc{}
+	count := int64(0)
+	startIndex := (in.Page - 1) * in.PageSize
+	err := docRpcUtil.GetJyDocsDB().Transaction(func(tx *gorm.DB) error {
+		switch in.UserDocCategory {
+		case int64(0):
+			//兑换的
+			err := docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and isDownload=1 and isDelete=?  and  appId=? ", in.UserId, model.UserDocStatus_Normal, in.AppId).Find(&data)
+			count = int64(len(data))
+			err = docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and isDownload=1 and isDelete=?  and  appId=?  limit ?,?", in.UserId, model.UserDocStatus_Normal, in.AppId, startIndex, in.PageSize).Find(&data)
+			if err.Error != nil {
+				log.Println("查询兑换记录失败:", err)
+				msg = "查询兑换记录失败"
+				return err.Error
+			}
+		case int64(1):
+			//收藏的
+			err := docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and isCollection=1   and  appId=? ", in.UserId, model.UserDocStatus_Normal, in.AppId).Find(&data)
+			count = int64(len(data))
+			err = docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and isCollection=1   and  appId=?  limit ?,?", in.UserId, model.UserDocStatus_Normal, in.AppId, startIndex, in.PageSize).Find(&data)
+			if err.Error != nil {
+				log.Println("查询收藏记录失败:", err)
+				msg = "查询收藏记录失败"
+				return err.Error
+			}
+		case int64(2):
+			//回收站
+			err := docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and   isDelete=?  and  appId=? ", in.UserId, model.UserDocStatus_LogicDelete, in.AppId).Find(&data)
+			count = int64(len(data))
+			err = docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=?  and  isDelete=?  and  appId=?  limit ?,?", in.UserId, model.UserDocStatus_LogicDelete, in.AppId, startIndex, in.PageSize).Find(&data)
+			if err.Error != nil {
+				log.Println("查询回收站记录失败:", err)
+				msg = "查询回收站记录失败"
+				return err.Error
+			}
+		}
+
+		return nil
+	})
+	if err != nil {
+		return data, count, false, msg
+	}
+	return data, count, true, msg
+
+}

+ 6 - 4
services/util/baseInit.go

@@ -20,8 +20,10 @@ type MysqlDBConfig struct {
 }
 
 type EsConfig struct {
-	Addr string
-	Pool int
+	Addr     string
+	Pool     int
+	UserName string
+	Password string
 }
 
 var (
@@ -39,9 +41,9 @@ func InitDB(url, driverName string, maxOpenConn, maxIdle int) {
 
 }
 
-func InitEs(addr string, poolSize int) {
+func InitEs(addr string, poolSize int, userName, password string) {
 	log.Printf("----------->【jy_docs】 elastic :[%s] init<--------------", addr)
-	elastic.InitElasticSize(addr, poolSize)
+	elastic.InitElasticSizeByAuth(addr, poolSize, userName, password)
 }
 
 func InitOss(etcd discov.EtcdConf) {

+ 11 - 0
services/util/util.go

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