wangchuanjin %!s(int64=4) %!d(string=hai) anos
pai
achega
253ccc8414

+ 0 - 4
go.sum

@@ -1,7 +1,3 @@
-app.yhyue.com/moapp/jybase v0.0.0-20210318032317-ab11de8dcc0a h1:wf7zDnDMHTmQCjnrOY4hS0EHZ8Ya5GQq7OOCS9NfCOA=
-app.yhyue.com/moapp/jybase v0.0.0-20210318032317-ab11de8dcc0a/go.mod h1:29ShuI8y7qEyg2KviHSx1iamiCioBKdTMm2ndVzWAhk=
-app.yhyue.com/moapp/jybase v0.0.0-20210318054150-8c129a033242 h1:5n4QJzwewnzSkU6USSTLiw+9doGn0rojstiIIjzzPU4=
-app.yhyue.com/moapp/jybase v0.0.0-20210318054150-8c129a033242/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=

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

@@ -13,6 +13,7 @@ EsConfig:
   Password: elastic
 Etcd:
   Hosts:
-    - 127.0.0.1:2379
+    - 192.168.3.240:2379
   Key: jydocs.stdlib.rpc
-BucketName: "jydoc-std"
+DocBucketName: "jydoc-stdlib"
+PreviewBucketName: "jydoc-preview"

+ 4 - 3
rpc/stdlib/internal/config/config.go

@@ -5,7 +5,8 @@ import jyDocRpcUtil "app.yhyue.com/moapp/jy_docs/services/util"
 
 type Config struct {
 	zrpc.RpcServerConf
-	JyDocsMysqlDB jyDocRpcUtil.MysqlDBConfig
-	EsConfig      jyDocRpcUtil.EsConfig
-	BucketName    string
+	JyDocsMysqlDB     jyDocRpcUtil.MysqlDBConfig
+	EsConfig          jyDocRpcUtil.EsConfig
+	DocBucketName     string
+	PreviewBucketName string
 }

+ 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)
+	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)

+ 3 - 1
rpc/stdlib/internal/logic/docgetchecklogic.go

@@ -2,6 +2,7 @@ package logic
 
 import (
 	"context"
+	"log"
 
 	stdlibService "app.yhyue.com/moapp/jy_docs/services/stdlib"
 
@@ -27,6 +28,7 @@ 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)
+	res := stdlibService.DocGetCheck(in.DocId, in.UserId, in.AppId)
+	log.Println("res ", res)
 	return &res, nil
 }

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

@@ -26,6 +26,6 @@ func NewDocGetContentLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Doc
 
 func (l *DocGetContentLogic) DocGetContent(in *stdlib.DocGetCheckReq) (*stdlib.DocGetContentResp, error) {
 	// todo: add your logic here and delete this line
-	res := stdlibService.DocGetContent(in.DocId, in.UserId, l.svcCtx.Config.BucketName)
+	res := stdlibService.DocGetContent(in.DocId, in.UserId, l.svcCtx.Config.DocBucketName, in.AppId)
 	return &res, nil
 }

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

@@ -25,6 +25,6 @@ func NewDocStatisticsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Doc
 
 func (l *DocStatisticsLogic) DocStatistics(in *stdlib.DocStatisticsReq) (*stdlib.DocChangeResp, error) {
 	// todo: add your logic here and delete this line
-	state := stdlibService.DocStatistics(in.DocId, int(in.DocStatisticsType))
+	state := stdlibService.DocStatistics(in.DocId, in.AppId, int(in.DocStatisticsType))
 	return &stdlib.DocChangeResp{State: state}, nil
 }

+ 22 - 8
rpc/stdlib/stdlib.proto

@@ -47,23 +47,35 @@ message DocChangeResp {
 message DocStatisticsReq {
   string docId = 1; //文档id
   int32 DocStatisticsType = 2; //文档统计类型 1增加下载次数 2增加浏览次数 3评分
+  string appId = 3; //appId
 }
 
 message DocGetCheckReq {
   string docId = 1; //文档id
   string userId = 2; //用户id
+  string appId = 3; //appId
 }
 
 message DocGetCheckResp {
-  int32 code = 1;    //响应代码
+  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 {
@@ -75,6 +87,8 @@ message DocGetContentResp {
 message DocActivityReq {
   int32 pageNum = 1; //页码 
   int32 pageSize = 2; //每页数量
+  string appId = 3; //appId
+  int32 activityId = 4; //活动id
 }
 
 message DocActivity {

+ 305 - 143
rpc/stdlib/stdlib/stdlib.pb.go

@@ -447,6 +447,7 @@ type DocStatisticsReq struct {
 
 	DocId             string `protobuf:"bytes,1,opt,name=docId,proto3" json:"docId,omitempty"`                          //文档id
 	DocStatisticsType int32  `protobuf:"varint,2,opt,name=DocStatisticsType,proto3" json:"DocStatisticsType,omitempty"` //文档统计类型 1增加下载次数 2增加浏览次数 3评分
+	AppId             string `protobuf:"bytes,3,opt,name=appId,proto3" json:"appId,omitempty"`                          //appId
 }
 
 func (x *DocStatisticsReq) Reset() {
@@ -495,6 +496,13 @@ func (x *DocStatisticsReq) GetDocStatisticsType() int32 {
 	return 0
 }
 
+func (x *DocStatisticsReq) GetAppId() string {
+	if x != nil {
+		return x.AppId
+	}
+	return ""
+}
+
 type DocGetCheckReq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -502,6 +510,7 @@ type DocGetCheckReq struct {
 
 	DocId  string `protobuf:"bytes,1,opt,name=docId,proto3" json:"docId,omitempty"`   //文档id
 	UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` //用户id
+	AppId  string `protobuf:"bytes,3,opt,name=appId,proto3" json:"appId,omitempty"`   //appId
 }
 
 func (x *DocGetCheckReq) Reset() {
@@ -550,20 +559,22 @@ func (x *DocGetCheckReq) GetUserId() string {
 	return ""
 }
 
+func (x *DocGetCheckReq) GetAppId() string {
+	if x != nil {
+		return x.AppId
+	}
+	return ""
+}
+
 type DocGetCheckResp struct {
 	state         protoimpl.MessageState
 	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() {
@@ -598,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
 	}
@@ -612,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
@@ -674,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)
 	}
@@ -687,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 {
@@ -700,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 {
@@ -729,14 +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"` //每页数量
+	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)
 	}
@@ -749,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 {
@@ -762,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 {
@@ -779,6 +892,20 @@ func (x *DocActivityReq) GetPageSize() int32 {
 	return 0
 }
 
+func (x *DocActivityReq) GetAppId() string {
+	if x != nil {
+		return x.AppId
+	}
+	return ""
+}
+
+func (x *DocActivityReq) GetActivityId() int32 {
+	if x != nil {
+		return x.ActivityId
+	}
+	return 0
+}
+
 type DocActivity struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -796,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)
 	}
@@ -809,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 {
@@ -822,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 {
@@ -888,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)
 	}
@@ -901,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 {
@@ -914,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 {
@@ -998,91 +1125,112 @@ var file_stdlib_proto_rawDesc = []byte{
 	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,
+	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, 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, 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, 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,
+	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, 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 (
@@ -1097,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
@@ -1107,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() }
@@ -1239,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:
@@ -1251,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:
@@ -1263,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:
@@ -1275,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
@@ -1293,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,
 		},

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

@@ -14,17 +14,18 @@ import (
 )
 
 type (
-	DocActivity       = stdlib.DocActivity
-	DocQueryRequest   = stdlib.DocQueryRequest
+	DocGetContentResp = stdlib.DocGetContentResp
+	DocActivityReq    = stdlib.DocActivityReq
 	DocQueryResponse  = stdlib.DocQueryResponse
-	DocChangeReq      = stdlib.DocChangeReq
+	Doc               = stdlib.Doc
 	DocChangeResp     = stdlib.DocChangeResp
 	DocStatisticsReq  = stdlib.DocStatisticsReq
 	DocGetCheckReq    = stdlib.DocGetCheckReq
 	DocGetCheckResp   = stdlib.DocGetCheckResp
-	Doc               = stdlib.Doc
-	DocGetContentResp = stdlib.DocGetContentResp
-	DocActivityReq    = stdlib.DocActivityReq
+	DocActivity       = stdlib.DocActivity
+	DocQueryRequest   = stdlib.DocQueryRequest
+	DocChangeReq      = stdlib.DocChangeReq
+	DocInfo           = stdlib.DocInfo
 	DocActivityResp   = stdlib.DocActivityResp
 
 	Stdlib interface {

+ 6 - 6
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,AppId: "app_id_123"}
+	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 {
@@ -27,7 +27,7 @@ func Test_DocOn(t *testing.T) {
 func Test_DocOff(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: 10,AppId: "app_id_123"}
+	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 {
@@ -42,7 +42,7 @@ func Test_DocOff(t *testing.T) {
 func Test_DocActivity(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.DocActivityReq{PageNum: 1, PageSize: 10}
+	req := &stdlib.DocActivityReq{PageNum: 1, PageSize: 10, AppId: "app_id_123"}
 	res, err := std.DocActivity(ctx, req)
 	log.Println("err ", err)
 	log.Println("req ", res)
@@ -51,7 +51,7 @@ func Test_DocActivity(t *testing.T) {
 func Test_DocStatistics(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.DocStatisticsReq{DocId: "123", DocStatisticsType: 1}
+	req := &stdlib.DocStatisticsReq{DocId: "123", DocStatisticsType: 1, AppId: "app_id_123"}
 	res, err := std.DocStatistics(ctx, req)
 	log.Println("err ", err)
 	log.Println("req ", res)
@@ -60,7 +60,7 @@ func Test_DocStatistics(t *testing.T) {
 func Test_DocGetCheck(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.DocGetCheckReq{DocId: "111", UserId: "123"}
+	req := &stdlib.DocGetCheckReq{DocId: "111", UserId: "123", AppId: "app_id_123"}
 	res, err := std.DocGetCheck(ctx, req)
 	log.Println("err ", err)
 	log.Println("req ", res)
@@ -69,7 +69,7 @@ func Test_DocGetCheck(t *testing.T) {
 func Test_DocGetContent(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.DocGetCheckReq{DocId: "111", UserId: "123"}
+	req := &stdlib.DocGetCheckReq{DocId: "111", UserId: "123", AppId: "app_id_123"}
 	res, err := std.DocGetContent(ctx, req)
 	log.Println("err ", err)
 	log.Println("req ", res)

+ 4 - 4
rpc/userlib/internal/logic/doccancelcollectlogic.go

@@ -25,14 +25,14 @@ func NewDocCancelCollectLogic(ctx context.Context, svcCtx *svc.ServiceContext) *
 	}
 }
 
-func (l *DocCancelCollectLogic) DocCancelCollect(in *userlib.UserDeleteRequest) (*userlib.UserDeleteResponse, error) {
+func (l *DocCancelCollectLogic) DocCancelCollect(in *userlib.UserCancelRequest) (*userlib.UserDeleteResponse, error) {
 	// todo: add your logic here and delete this line
 	result := &userlib.UserDeleteResponse{}
-	b := userLibService.UserDocCancelCollect(in.DocId)
-	result.Code = 400
+	b := userLibService.UserDocCancelCollect(in.DocId,in.UserId,in.AppId)
+	result.Code = 0
 	result.Message = "取消收藏失败"
 	if b {
-		result.Code = 200
+		result.Code = 1
 		result.Message = "取消收藏成功"
 	}
 	log.Printf("用户文档取消收藏,userId:[%s],docId:[%s] 是否成功:[%v]", in.DocId, b, result)

+ 9 - 5
rpc/userlib/internal/logic/doccollectlogic.go

@@ -28,15 +28,19 @@ func NewDocCollectLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocCol
 
 func (l *DocCollectLogic) DocCollect(in *userlib.UserCollectRequest) (*userlib.UserCollectResponse, error) {
 	// todo: add your logic here and delete this line
+	result := &userlib.UserCollectResponse{}
 	b := userLibService.UserDocCollect(
 		&model.UserDoc{
 			UserId: in.UserId,
 			DocId:  in.DocId,
 			AppId:  in.AppId,
-		}, int(in.Cost))
+		})
+	result.Code = 0
+	result.Message = "收藏失败"
+	if b {
+		result.Code = 1
+		result.Message = "收藏成功"
+	}
 	log.Printf("用户文档收藏,userId:[%s],docId:[%s] 是否成功:[%v]", in.UserId, in.DocId, b)
-	return &userlib.UserCollectResponse{
-		Code:    200,
-		Message: "success",
-	}, nil
+	return result, nil
 }

+ 1 - 1
rpc/userlib/internal/logic/docdeletelogic.go

@@ -27,7 +27,7 @@ func NewDocDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocDele
 func (l *DocDeleteLogic) DocDelete(in *userlib.UserRecoveryRequest) (*userlib.UserDeleteResponse, error) {
 	// todo: add your logic here and delete this line
 	result := &userlib.UserDeleteResponse{}
-	code,msg:= userLibService.UserDocDelete(in.UserDocId,in.AppId)
+	code,msg:= userLibService.UserDocDelete(in.UserDocId,in.AppId,in.UserId)
 	if code {
 		result.Code = 1
 		result.Message = msg

+ 1 - 2
rpc/userlib/internal/logic/docdownloadlogic.go

@@ -1,7 +1,6 @@
 package logic
 
 import (
-	"app.yhyue.com/moapp/jy_docs/rpc/userlib/internal/config"
 	"app.yhyue.com/moapp/jy_docs/rpc/userlib/internal/svc"
 	"app.yhyue.com/moapp/jy_docs/rpc/userlib/userlib"
 	"app.yhyue.com/moapp/jy_docs/services/model"
@@ -33,7 +32,7 @@ func (l *DocDownloadLogic) DocDownload(in *userlib.UserCollectRequest) (*userlib
 			UserId: in.UserId,
 			DocId:  in.DocId,
 			AppId:  in.AppId,
-		}, int(in.Cost), config.Configs.FileSystemConf.Etcd.Hosts, config.Configs.FileSystemConf.Etcd.Key)
+		}, int(in.Cost))
 	log.Printf("用户文档收藏,userId:[%s],docId:[%s] 是否成功:[%v]", in.UserId, in.DocId, b)
 	if b {
 		return &userlib.UserCollectResponse{

+ 1 - 1
rpc/userlib/internal/logic/docpermanentdeletelogic.go

@@ -26,7 +26,7 @@ func NewDocPermanentDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext)
 func (l *DocPermanentDeleteLogic) DocPermanentDelete(in *userlib.UserRecoveryRequest) (*userlib.UserCollectResponse, error) {
 	// todo: add your logic here and delete this line
 	result := &userlib.UserCollectResponse{}
-	code,msg:= userLibService.UserDocPermanentDelete(in.UserDocId,in.AppId)
+	code,msg:= userLibService.UserDocPermanentDelete(in.UserDocId,in.AppId,in.UserId)
 	if code {
 		result.Code = 1
 		result.Message = msg

+ 1 - 1
rpc/userlib/internal/logic/docrestorelogic.go

@@ -26,7 +26,7 @@ func NewDocRestoreLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DocRes
 func (l *DocRestoreLogic) DocRestore(in *userlib.UserRecoveryRequest) (*userlib.UserRestoreResponse, error) {
 	// todo: add your logic here and delete this line
 	result := &userlib.UserRestoreResponse{}
-	code,msg:= userLibService.UserDocRestore(in.UserDocId,in.AppId)
+	code,msg:= userLibService.UserDocRestore(in.UserDocId,in.AppId,in.UserId)
 	if code {
 		result.Code = 1
 		result.Message =msg

+ 18 - 18
rpc/userlib/internal/logic/userdocslogic.go

@@ -30,25 +30,25 @@ func (l *UserDocsLogic) UserDocs(in *userlib.UserDocsRequest) (*userlib.UserDocs
 	data, count, code, msg := userLibService.UserDocsList(in)
 	docList := []*userlib.UserDocs{}
 	for _, value := range data {
+		if value.IsDownload == 1 {
+			value.Cost = "已购买"
+		}
+
 		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),
+			CreateAt:      value.CreateAt.Unix(),
+			UpdateAt:      value.UpdateAt.Unix(),
+			DeletedAt:     value.DeletedAt.Unix(),
+			DocId:         value.DocId,
+			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,
+			IsDownload:    int64(value.IsDownload),
+			IsCollection:  int64(value.IsCollection),
+			Cost:          value.Cost,
 		})
 	}
 	if code {

+ 1 - 1
rpc/userlib/internal/server/userlibserver.go

@@ -31,7 +31,7 @@ func (s *UserLibServer) DocCollect(ctx context.Context, in *userlib.UserCollectR
 	return l.DocCollect(in)
 }
 
-func (s *UserLibServer) DocCancelCollect(ctx context.Context, in *userlib.UserDeleteRequest) (*userlib.UserDeleteResponse, error) {
+func (s *UserLibServer) DocCancelCollect(ctx context.Context, in *userlib.UserCancelRequest) (*userlib.UserDeleteResponse, error) {
 	l := logic.NewDocCancelCollectLogic(ctx, s.svcCtx)
 	return l.DocCancelCollect(in)
 }

+ 23 - 17
rpc/userlib/test/userLib_test.go

@@ -19,10 +19,9 @@ func Test_UserDocCollect(t *testing.T) {
 	})
 	userLib := userlibclient.NewUserLib(client)
 	resp, err := userLib.DocCollect(context.Background(), &userlibclient.UserCollectRequest{
-		DocId:  "1",
-		UserId: "2",
-		AppId:  10000,
-		Cost:   0,
+		DocId:  "SUgJfBt1M6nop8kvwcu5",
+		UserId: "5d6378301c298a5aac7b5402",
+		AppId:  "10000",
 	})
 	if err != nil {
 		log.Println("UserDoc Collect call error:", err)
@@ -39,8 +38,10 @@ func Test_UserCancelDocCollect(t *testing.T) {
 		},
 	})
 	userLib := userlibclient.NewUserLib(client)
-	resp, err := userLib.DocCancelCollect(context.Background(), &userlibclient.UserDeleteRequest{
-		DocId: "3",
+	resp, err := userLib.DocCancelCollect(context.Background(), &userlibclient.UserCancelRequest{
+		DocId:  "SUgJfBt1M6nop8kvwcu5",
+		UserId: "5d6378301c298a5aac7b5402",
+		AppId:  "10000",
 	})
 	if err != nil {
 		log.Println("UserDoc Collect call error:", err)
@@ -58,8 +59,9 @@ func Test_UserDocDelete(t *testing.T) {
 	})
 	userLib := userlibclient.NewUserLib(client)
 	resp, err := userLib.DocDelete(context.Background(), &userlibclient.UserRecoveryRequest{
-		UserDocId: int32(10),
-		AppId:     int64(10000),
+		UserDocId: int32(13),
+		AppId:     "10000",
+		UserId:    "wh11",
 	})
 	if err != nil {
 		log.Println("UserDoc Collect call error:", err)
@@ -78,7 +80,8 @@ func Test_UserDocRestore(t *testing.T) {
 	userLib := userlibclient.NewUserLib(client)
 	resp, err := userLib.DocRestore(context.Background(), &userlibclient.UserRecoveryRequest{
 		UserDocId: int32(10),
-		AppId:     int64(10000),
+		AppId:     "10000",
+		UserId:    "wh11",
 	})
 	if err != nil {
 		log.Println("UserDoc Collect call error:", err)
@@ -97,15 +100,17 @@ func Test_UserDocPermanentDelete(t *testing.T) {
 	userLib := userlibclient.NewUserLib(client)
 	resp, err := userLib.DocPermanentDelete(context.Background(), &userlibclient.UserRecoveryRequest{
 		UserDocId: int32(10),
-		AppId:     int64(10000),
+		AppId:     "10000",
+		UserId:    "wh11",
 	})
 	if err != nil {
 		log.Println("UserDoc Collect call error:", err)
 	}
 	log.Print("UserDoc Collect call response:", resp)
 }
+
 //我的文库0兑换的 1收藏的 2回收站的
-func Test_UserDocList(t *testing.T)  {
+func Test_UserDocList(t *testing.T) {
 	client := zrpc.MustNewClient(zrpc.RpcClientConf{
 		Etcd: discov.EtcdConf{
 			Hosts: []string{"127.0.0.1:2380"},
@@ -114,17 +119,18 @@ func Test_UserDocList(t *testing.T)  {
 	})
 	userLib := userlibclient.NewUserLib(client)
 	resp, err := userLib.UserDocs(context.Background(), &userlibclient.UserDocsRequest{
-		UserId: "wh11",
-		AppId:int64(10000),
-		PageSize:2,
-		Page:1,
-		UserDocCategory:2,
+		UserId:          "5d6378301c298a5aac7b5402",
+		AppId:           "10000",
+		PageSize:        10,
+		Page:            1,
+		UserDocCategory: 1,
 	})
 	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{
@@ -138,7 +144,7 @@ func Test_UserDocDwnload(t *testing.T) {
 		DocId:  "123",
 		UserId: "wh5",
 		Cost:   1000,
-		AppId:  int64(10000),
+		AppId:  "10000",
 	})
 	if err != nil {
 		log.Println("UserDoc Collect call error:", err)

+ 25 - 27
rpc/userlib/userlib.proto

@@ -22,7 +22,7 @@ message UserCollectRequest {
     string userId=1; //用户id
     string docId=2; //文档id
     int32 cost=3;//收藏|转存费用
-    int64 appId=4;//剑鱼标识
+    string appId=4;//剑鱼标识
 }
 
 message UserCollectResponse {
@@ -30,10 +30,11 @@ message UserCollectResponse {
     string message=2; //响应消息
 }
 
-//用户删除
-message UserDeleteRequest {
-    string docId=1;//文档id
-    int64 appId=2;//剑鱼标识
+//用户取消收藏
+message UserCancelRequest {
+    string docId=1;//文库ID
+    string userId =2;//用户标识
+    string appId=3;//剑鱼标识
 }
 message UserDeleteResponse {
     int32 code =1;    //响应代码
@@ -52,7 +53,7 @@ message UserRestoreResponse {
 //用户文档列表
 message UserDocsRequest {
     string userId=1;//用户id
-    int64 appId=2;//剑鱼标识
+    string appId=2;//剑鱼标识
     int64 userDocCategory=3;//用户文档分类 0兑换的 1收藏的 2回收站的
     int64 page = 4;
     int64 pageSize = 5;
@@ -65,8 +66,9 @@ message UserDocsResponse {
     repeated userDocs data=4; //列表
 }
 message UserRecoveryRequest {
-    int32 userDocId =1;   //记录标识
-    int64 appId=2;//剑鱼标识
+    int32 userDocId =1;   //文档标识
+    string appId=2;//剑鱼标识
+    string userId=3;//用户标识
 }
 enum UserDocStatus {
     Normal =0;//文件正常
@@ -74,29 +76,25 @@ enum UserDocStatus {
     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收藏
+    int64   CreateAt=1;//创建时间
+    int64	UpdateAt=2;//修改时间
+    int64	DeletedAt=3;//删除时间
+    string	DocId=4;//文档标识
+    int64	IsDelete=5;//是否删除,0 未删除  1 已逻辑删除 2永久删除
+    string	DocName=6;//文档名
+    int64 	DocFileType=7;//文件类型,0-doc ,1-pdf ,2-xls 3 ppt 4- txt 5- 其他
+    string	DocFileSuffix=8;//文件后辍
+    int64	DocFileSize=9;//文件大小
+    int64	DocPageSize=10;//页数
+    string	DocSummary=11;//文档摘要
+    int64 	IsDownload=12;//是否转存0未转存1转存
+    int64	IsCollection=13;//是否收藏0未收藏1收藏
+    string	Cost=14;//收藏|转存费用
 }
 service  UserLib {
     rpc UserDocs(UserDocsRequest) returns (UserDocsResponse);//用户文档列表
   	rpc DocCollect(UserCollectRequest) returns(UserCollectResponse); //文档收藏
-  	rpc DocCancelCollect(UserDeleteRequest) returns(UserDeleteResponse); //文档取消收藏
+  	rpc DocCancelCollect(UserCancelRequest) returns(UserDeleteResponse); //文档取消收藏
 	rpc DocDelete(UserRecoveryRequest) returns(UserDeleteResponse); //文档删除
 	rpc DocRestore(UserRecoveryRequest) returns(UserRestoreResponse); //文档恢复
 	rpc DocDownload(UserCollectRequest) returns(UserCollectResponse); //文档转存

+ 184 - 204
rpc/userlib/userlib/userlib.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.1
+// 	protoc        v3.15.3
 // source: userlib.proto
 
 package userlib
@@ -196,7 +196,7 @@ type UserCollectRequest struct {
 	UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` //用户id
 	DocId  string `protobuf:"bytes,2,opt,name=docId,proto3" json:"docId,omitempty"`   //文档id
 	Cost   int32  `protobuf:"varint,3,opt,name=cost,proto3" json:"cost,omitempty"`    //收藏|转存费用
-	AppId  int64  `protobuf:"varint,4,opt,name=appId,proto3" json:"appId,omitempty"`  //剑鱼标识
+	AppId  string `protobuf:"bytes,4,opt,name=appId,proto3" json:"appId,omitempty"`   //剑鱼标识
 }
 
 func (x *UserCollectRequest) Reset() {
@@ -252,11 +252,11 @@ func (x *UserCollectRequest) GetCost() int32 {
 	return 0
 }
 
-func (x *UserCollectRequest) GetAppId() int64 {
+func (x *UserCollectRequest) GetAppId() string {
 	if x != nil {
 		return x.AppId
 	}
-	return 0
+	return ""
 }
 
 type UserCollectResponse struct {
@@ -314,18 +314,19 @@ func (x *UserCollectResponse) GetMessage() string {
 	return ""
 }
 
-//用户删除
-type UserDeleteRequest struct {
+//用户取消收藏
+type UserCancelRequest struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	DocId string `protobuf:"bytes,1,opt,name=docId,proto3" json:"docId,omitempty"`  //文档id
-	AppId int64  `protobuf:"varint,2,opt,name=appId,proto3" json:"appId,omitempty"` //剑鱼标识
+	DocId  string `protobuf:"bytes,1,opt,name=docId,proto3" json:"docId,omitempty"`   //文库ID
+	UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` //用户标识
+	AppId  string `protobuf:"bytes,3,opt,name=appId,proto3" json:"appId,omitempty"`   //剑鱼标识
 }
 
-func (x *UserDeleteRequest) Reset() {
-	*x = UserDeleteRequest{}
+func (x *UserCancelRequest) Reset() {
+	*x = UserCancelRequest{}
 	if protoimpl.UnsafeEnabled {
 		mi := &file_userlib_proto_msgTypes[2]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -333,13 +334,13 @@ func (x *UserDeleteRequest) Reset() {
 	}
 }
 
-func (x *UserDeleteRequest) String() string {
+func (x *UserCancelRequest) String() string {
 	return protoimpl.X.MessageStringOf(x)
 }
 
-func (*UserDeleteRequest) ProtoMessage() {}
+func (*UserCancelRequest) ProtoMessage() {}
 
-func (x *UserDeleteRequest) ProtoReflect() protoreflect.Message {
+func (x *UserCancelRequest) ProtoReflect() protoreflect.Message {
 	mi := &file_userlib_proto_msgTypes[2]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -351,23 +352,30 @@ func (x *UserDeleteRequest) ProtoReflect() protoreflect.Message {
 	return mi.MessageOf(x)
 }
 
-// Deprecated: Use UserDeleteRequest.ProtoReflect.Descriptor instead.
-func (*UserDeleteRequest) Descriptor() ([]byte, []int) {
+// Deprecated: Use UserCancelRequest.ProtoReflect.Descriptor instead.
+func (*UserCancelRequest) Descriptor() ([]byte, []int) {
 	return file_userlib_proto_rawDescGZIP(), []int{2}
 }
 
-func (x *UserDeleteRequest) GetDocId() string {
+func (x *UserCancelRequest) GetDocId() string {
 	if x != nil {
 		return x.DocId
 	}
 	return ""
 }
 
-func (x *UserDeleteRequest) GetAppId() int64 {
+func (x *UserCancelRequest) GetUserId() string {
+	if x != nil {
+		return x.UserId
+	}
+	return ""
+}
+
+func (x *UserCancelRequest) GetAppId() string {
 	if x != nil {
 		return x.AppId
 	}
-	return 0
+	return ""
 }
 
 type UserDeleteResponse struct {
@@ -535,7 +543,7 @@ type UserDocsRequest struct {
 	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"`                     //剑鱼标识
+	AppId           string `protobuf:"bytes,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"`
@@ -580,11 +588,11 @@ func (x *UserDocsRequest) GetUserId() string {
 	return ""
 }
 
-func (x *UserDocsRequest) GetAppId() int64 {
+func (x *UserDocsRequest) GetAppId() string {
 	if x != nil {
 		return x.AppId
 	}
-	return 0
+	return ""
 }
 
 func (x *UserDocsRequest) GetUserDocCategory() int64 {
@@ -684,8 +692,9 @@ type UserRecoveryRequest struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	UserDocId int32 `protobuf:"varint,1,opt,name=userDocId,proto3" json:"userDocId,omitempty"` //记录标识
-	AppId     int64 `protobuf:"varint,2,opt,name=appId,proto3" json:"appId,omitempty"`         //剑鱼标识
+	UserDocId int32  `protobuf:"varint,1,opt,name=userDocId,proto3" json:"userDocId,omitempty"` //文档标识
+	AppId     string `protobuf:"bytes,2,opt,name=appId,proto3" json:"appId,omitempty"`          //剑鱼标识
+	UserId    string `protobuf:"bytes,3,opt,name=userId,proto3" json:"userId,omitempty"`        //用户标识
 }
 
 func (x *UserRecoveryRequest) Reset() {
@@ -727,11 +736,18 @@ func (x *UserRecoveryRequest) GetUserDocId() int32 {
 	return 0
 }
 
-func (x *UserRecoveryRequest) GetAppId() int64 {
+func (x *UserRecoveryRequest) GetAppId() string {
 	if x != nil {
 		return x.AppId
 	}
-	return 0
+	return ""
+}
+
+func (x *UserRecoveryRequest) GetUserId() string {
+	if x != nil {
+		return x.UserId
+	}
+	return ""
 }
 
 type UserDocs struct {
@@ -739,24 +755,20 @@ type UserDocs struct {
 	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收藏
+	CreateAt      int64  `protobuf:"varint,1,opt,name=CreateAt,proto3" json:"CreateAt,omitempty"`          //创建时间
+	UpdateAt      int64  `protobuf:"varint,2,opt,name=UpdateAt,proto3" json:"UpdateAt,omitempty"`          //修改时间
+	DeletedAt     int64  `protobuf:"varint,3,opt,name=DeletedAt,proto3" json:"DeletedAt,omitempty"`        //删除时间
+	DocId         string `protobuf:"bytes,4,opt,name=DocId,proto3" json:"DocId,omitempty"`                 //文档标识
+	IsDelete      int64  `protobuf:"varint,5,opt,name=IsDelete,proto3" json:"IsDelete,omitempty"`          //是否删除,0 未删除  1 已逻辑删除 2永久删除
+	DocName       string `protobuf:"bytes,6,opt,name=DocName,proto3" json:"DocName,omitempty"`             //文档名
+	DocFileType   int64  `protobuf:"varint,7,opt,name=DocFileType,proto3" json:"DocFileType,omitempty"`    //文件类型,0-doc ,1-pdf ,2-xls 3 ppt 4- txt 5- 其他
+	DocFileSuffix string `protobuf:"bytes,8,opt,name=DocFileSuffix,proto3" json:"DocFileSuffix,omitempty"` //文件后辍
+	DocFileSize   int64  `protobuf:"varint,9,opt,name=DocFileSize,proto3" json:"DocFileSize,omitempty"`    //文件大小
+	DocPageSize   int64  `protobuf:"varint,10,opt,name=DocPageSize,proto3" json:"DocPageSize,omitempty"`   //页数
+	DocSummary    string `protobuf:"bytes,11,opt,name=DocSummary,proto3" json:"DocSummary,omitempty"`      //文档摘要
+	IsDownload    int64  `protobuf:"varint,12,opt,name=IsDownload,proto3" json:"IsDownload,omitempty"`     //是否转存0未转存1转存
+	IsCollection  int64  `protobuf:"varint,13,opt,name=IsCollection,proto3" json:"IsCollection,omitempty"` //是否收藏0未收藏1收藏
+	Cost          string `protobuf:"bytes,14,opt,name=Cost,proto3" json:"Cost,omitempty"`                  //收藏|转存费用
 }
 
 func (x *UserDocs) Reset() {
@@ -791,48 +803,27 @@ 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 {
+func (x *UserDocs) GetCreateAt() int64 {
 	if x != nil {
 		return x.CreateAt
 	}
-	return ""
+	return 0
 }
 
-func (x *UserDocs) GetUpdateAt() string {
+func (x *UserDocs) GetUpdateAt() int64 {
 	if x != nil {
 		return x.UpdateAt
 	}
-	return ""
+	return 0
 }
 
-func (x *UserDocs) GetDeletedAt() string {
+func (x *UserDocs) GetDeletedAt() int64 {
 	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
@@ -840,13 +831,6 @@ func (x *UserDocs) GetDocId() string {
 	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
@@ -896,13 +880,6 @@ func (x *UserDocs) GetDocSummary() string {
 	return ""
 }
 
-func (x *UserDocs) GetDocSourceUserId() string {
-	if x != nil {
-		return x.DocSourceUserId
-	}
-	return ""
-}
-
 func (x *UserDocs) GetIsDownload() int64 {
 	if x != nil {
 		return x.IsDownload
@@ -917,6 +894,13 @@ func (x *UserDocs) GetIsCollection() int64 {
 	return 0
 }
 
+func (x *UserDocs) GetCost() string {
+	if x != nil {
+		return x.Cost
+	}
+	return ""
+}
+
 var File_userlib_proto protoreflect.FileDescriptor
 
 var file_userlib_proto_rawDesc = []byte{
@@ -927,131 +911,127 @@ var file_userlib_proto_rawDesc = []byte{
 	0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x18,
 	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04,
 	0x63, 0x6f, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x73, 0x74,
-	0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
 	0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x13, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f,
 	0x6c, 0x6c, 0x65, 0x63, 0x74, 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, 0x3f, 0x0a, 0x11, 0x55,
-	0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+	0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x57, 0x0a, 0x11, 0x55,
+	0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
 	0x12, 0x14, 0x0a, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x05, 0x64, 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, 0x42, 0x0a, 0x12,
-	0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 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, 0x2a, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x52,
-	0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x13,
-	0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 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, 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, 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, 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,
+	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, 0x42, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65,
+	0x74, 0x65, 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, 0x2a, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72,
+	0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14,
+	0x0a, 0x05, 0x64, 0x6f, 0x63, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64,
+	0x6f, 0x63, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x13, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x74,
+	0x6f, 0x72, 0x65, 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, 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, 0x09, 0x52, 0x05, 0x61, 0x70, 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, 0x61, 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, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12,
+	0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xb0, 0x03, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72,
+	0x44, 0x6f, 0x63, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74,
+	0x12, 0x1a, 0x0a, 0x08, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x74, 0x18, 0x02, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x08, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x74, 0x12, 0x1c, 0x0a, 0x09,
+	0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x44, 0x6f,
+	0x63, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x44, 0x6f, 0x63, 0x49, 0x64,
+	0x12, 0x1a, 0x0a, 0x08, 0x49, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x05, 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,
+	0x44, 0x6f, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 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,
+	0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 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,
+	0x69, 0x6c, 0x65, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x08, 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,
+	0x0a, 0x0b, 0x44, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x09, 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,
+	0x0a, 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, 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, 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,
+	0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x44, 0x6f, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61,
+	0x72, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x73, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64,
+	0x18, 0x0c, 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, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x49, 0x73, 0x43, 0x6f, 0x6c, 0x6c,
+	0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x73, 0x74, 0x18, 0x0e,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x6f, 0x73, 0x74, 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, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 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,
-	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,
+	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 (
@@ -1074,7 +1054,7 @@ var file_userlib_proto_goTypes = []interface{}{
 	(UserDocStatus)(0),          // 2: userlib.UserDocStatus
 	(*UserCollectRequest)(nil),  // 3: userlib.UserCollectRequest
 	(*UserCollectResponse)(nil), // 4: userlib.UserCollectResponse
-	(*UserDeleteRequest)(nil),   // 5: userlib.UserDeleteRequest
+	(*UserCancelRequest)(nil),   // 5: userlib.UserCancelRequest
 	(*UserDeleteResponse)(nil),  // 6: userlib.UserDeleteResponse
 	(*UserRestoreRequest)(nil),  // 7: userlib.UserRestoreRequest
 	(*UserRestoreResponse)(nil), // 8: userlib.UserRestoreResponse
@@ -1087,7 +1067,7 @@ var file_userlib_proto_depIdxs = []int32{
 	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
+	5,  // 3: userlib.UserLib.DocCancelCollect:input_type -> userlib.UserCancelRequest
 	11, // 4: userlib.UserLib.DocDelete:input_type -> userlib.UserRecoveryRequest
 	11, // 5: userlib.UserLib.DocRestore:input_type -> userlib.UserRecoveryRequest
 	3,  // 6: userlib.UserLib.DocDownload:input_type -> userlib.UserCollectRequest
@@ -1137,7 +1117,7 @@ func file_userlib_proto_init() {
 			}
 		}
 		file_userlib_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*UserDeleteRequest); i {
+			switch v := v.(*UserCancelRequest); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1268,7 +1248,7 @@ const _ = grpc.SupportPackageIsVersion6
 type UserLibClient interface {
 	UserDocs(ctx context.Context, in *UserDocsRequest, opts ...grpc.CallOption) (*UserDocsResponse, error)
 	DocCollect(ctx context.Context, in *UserCollectRequest, opts ...grpc.CallOption) (*UserCollectResponse, error)
-	DocCancelCollect(ctx context.Context, in *UserDeleteRequest, opts ...grpc.CallOption) (*UserDeleteResponse, error)
+	DocCancelCollect(ctx context.Context, in *UserCancelRequest, opts ...grpc.CallOption) (*UserDeleteResponse, error)
 	DocDelete(ctx context.Context, in *UserRecoveryRequest, opts ...grpc.CallOption) (*UserDeleteResponse, error)
 	DocRestore(ctx context.Context, in *UserRecoveryRequest, opts ...grpc.CallOption) (*UserRestoreResponse, error)
 	DocDownload(ctx context.Context, in *UserCollectRequest, opts ...grpc.CallOption) (*UserCollectResponse, error)
@@ -1301,7 +1281,7 @@ func (c *userLibClient) DocCollect(ctx context.Context, in *UserCollectRequest,
 	return out, nil
 }
 
-func (c *userLibClient) DocCancelCollect(ctx context.Context, in *UserDeleteRequest, opts ...grpc.CallOption) (*UserDeleteResponse, error) {
+func (c *userLibClient) DocCancelCollect(ctx context.Context, in *UserCancelRequest, opts ...grpc.CallOption) (*UserDeleteResponse, error) {
 	out := new(UserDeleteResponse)
 	err := c.cc.Invoke(ctx, "/userlib.UserLib/DocCancelCollect", in, out, opts...)
 	if err != nil {
@@ -1350,7 +1330,7 @@ func (c *userLibClient) DocPermanentDelete(ctx context.Context, in *UserRecovery
 type UserLibServer interface {
 	UserDocs(context.Context, *UserDocsRequest) (*UserDocsResponse, error)
 	DocCollect(context.Context, *UserCollectRequest) (*UserCollectResponse, error)
-	DocCancelCollect(context.Context, *UserDeleteRequest) (*UserDeleteResponse, error)
+	DocCancelCollect(context.Context, *UserCancelRequest) (*UserDeleteResponse, error)
 	DocDelete(context.Context, *UserRecoveryRequest) (*UserDeleteResponse, error)
 	DocRestore(context.Context, *UserRecoveryRequest) (*UserRestoreResponse, error)
 	DocDownload(context.Context, *UserCollectRequest) (*UserCollectResponse, error)
@@ -1367,7 +1347,7 @@ func (*UnimplementedUserLibServer) UserDocs(context.Context, *UserDocsRequest) (
 func (*UnimplementedUserLibServer) DocCollect(context.Context, *UserCollectRequest) (*UserCollectResponse, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method DocCollect not implemented")
 }
-func (*UnimplementedUserLibServer) DocCancelCollect(context.Context, *UserDeleteRequest) (*UserDeleteResponse, error) {
+func (*UnimplementedUserLibServer) DocCancelCollect(context.Context, *UserCancelRequest) (*UserDeleteResponse, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method DocCancelCollect not implemented")
 }
 func (*UnimplementedUserLibServer) DocDelete(context.Context, *UserRecoveryRequest) (*UserDeleteResponse, error) {
@@ -1424,7 +1404,7 @@ func _UserLib_DocCollect_Handler(srv interface{}, ctx context.Context, dec func(
 }
 
 func _UserLib_DocCancelCollect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(UserDeleteRequest)
+	in := new(UserCancelRequest)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
@@ -1436,7 +1416,7 @@ func _UserLib_DocCancelCollect_Handler(srv interface{}, ctx context.Context, dec
 		FullMethod: "/userlib.UserLib/DocCancelCollect",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(UserLibServer).DocCancelCollect(ctx, req.(*UserDeleteRequest))
+		return srv.(UserLibServer).DocCancelCollect(ctx, req.(*UserCancelRequest))
 	}
 	return interceptor(ctx, in, info, handler)
 }

+ 8 - 8
rpc/userlib/userlibclient/userlib.go

@@ -14,21 +14,21 @@ import (
 )
 
 type (
-	UserDeleteResponse  = userlib.UserDeleteResponse
-	UserRecoveryRequest = userlib.UserRecoveryRequest
-	UserCollectRequest  = userlib.UserCollectRequest
-	UserCollectResponse = userlib.UserCollectResponse
-	UserDeleteRequest   = userlib.UserDeleteRequest
-	UserDocsResponse    = userlib.UserDocsResponse
 	UserDocs            = userlib.UserDocs
+	UserCollectResponse = userlib.UserCollectResponse
+	UserCancelRequest   = userlib.UserCancelRequest
 	UserRestoreRequest  = userlib.UserRestoreRequest
 	UserRestoreResponse = userlib.UserRestoreResponse
+	UserRecoveryRequest = userlib.UserRecoveryRequest
+	UserCollectRequest  = userlib.UserCollectRequest
+	UserDeleteResponse  = userlib.UserDeleteResponse
 	UserDocsRequest     = userlib.UserDocsRequest
+	UserDocsResponse    = userlib.UserDocsResponse
 
 	UserLib interface {
 		UserDocs(ctx context.Context, in *UserDocsRequest) (*UserDocsResponse, error)
 		DocCollect(ctx context.Context, in *UserCollectRequest) (*UserCollectResponse, error)
-		DocCancelCollect(ctx context.Context, in *UserDeleteRequest) (*UserDeleteResponse, error)
+		DocCancelCollect(ctx context.Context, in *UserCancelRequest) (*UserDeleteResponse, error)
 		DocDelete(ctx context.Context, in *UserRecoveryRequest) (*UserDeleteResponse, error)
 		DocRestore(ctx context.Context, in *UserRecoveryRequest) (*UserRestoreResponse, error)
 		DocDownload(ctx context.Context, in *UserCollectRequest) (*UserCollectResponse, error)
@@ -56,7 +56,7 @@ func (m *defaultUserLib) DocCollect(ctx context.Context, in *UserCollectRequest)
 	return client.DocCollect(ctx, in)
 }
 
-func (m *defaultUserLib) DocCancelCollect(ctx context.Context, in *UserDeleteRequest) (*UserDeleteResponse, error) {
+func (m *defaultUserLib) DocCancelCollect(ctx context.Context, in *UserCancelRequest) (*UserDeleteResponse, error) {
 	client := userlib.NewUserLibClient(m.cli.Conn())
 	return client.DocCancelCollect(ctx, in)
 }

+ 10 - 5
services/model/stdlib.go

@@ -27,6 +27,8 @@ type Doc struct {
 	Price         int       `json:"price" gorm:"column:price"`
 	DownOrUp      int       `json:"downOrUp" gorm:"column:downOrUp"`
 	DocSummary    string    `json:"docSummary" gorm:"column:docSummary"`
+	PreviewImgId  string    `json:"preview_img_id" gorm:"column:previewImgId"`
+	PreviewImgUrl string    `json:"preview_img_url" gorm:"column:previewImgUrl"`
 }
 
 func (ud *Doc) TableName() string {
@@ -38,7 +40,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           string    `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"`
@@ -52,6 +54,9 @@ type UserDoc struct {
 	DocSourceUserId string    `json:"doc_source_user_id" gorm:"column:docSourceUserId"`
 	IsDownload      int       `json:"is_download" gorm:"column:isDownload"`
 	IsCollection    int       `json:"is_collection" gorm:"column:isCollection"`
+	PreviewImgId    string    `json:"preview_img_id" gorm:"column:previewImgId"`
+	PreviewImgUrl   string    `json:"preview_img_url" gorm:"column:previewImgUrl"`
+	Cost            string    `json:"cost" gorm:"column:cost"`
 }
 
 func (ud *UserDoc) TableName() string {
@@ -75,11 +80,11 @@ func (ud *DocActivity) TableName() string {
 }
 
 type UserDocData struct {
-	Id          string `json:"id"`
-	UserId      string `json:"user_id"  gorm:"column:userId"`
-	DocId       string `json:"doc_id" gorm:"column:docId"`
+	Id           string `json:"id"`
+	UserId       string `json:"user_id"  gorm:"column:userId"`
+	DocId        string `json:"doc_id" gorm:"column:docId"`
 	IsCollection int    `json:"is_collection" gorm:"column:isCollection"`
-	IsDelete    int    `json:"is_delete" gorm:"column:isDelete"`
+	IsDelete     int    `json:"is_delete" gorm:"column:isDelete"`
 }
 
 func (ud *UserDocData) TableName() string {

+ 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) ([]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)
+		jyDocsRpcUtil.GetJyDocsDB().Offset((pageNum-1)*pageSize).Limit(pageSize).Find(&docActivity, &model.DocActivity{AppId: appId, ActivityId: activityId})
 	} else {
 		count = 0
 	}

+ 12 - 12
services/stdlib/docChangeService.go

@@ -17,13 +17,13 @@ const DocOff = 0
 // 上架文档
 func ChangeDocumentOn(doc *model.Doc, reason int32) bool {
 	// 查文档
-	docData := map[string]interface{}{}
+	docData := model.Doc{}
 	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.Printf("上架文档 appId:%s,Id:%s, error: %s\n", doc.AppId, doc.Id, rs.Error)
 		return false
 	} else {
-		if docData["id"] == nil {
+		if docData.Id == "" {
 			log.Printf("上架文档 appId:%s,Id:%s, error: %s\n", doc.AppId, doc.Id, "文档不存在或已经被上架")
 			return false
 		}
@@ -57,18 +57,18 @@ func ChangeDocumentOn(doc *model.Doc, reason int32) bool {
 			return err
 		}
 		saveData := map[string]interface{}{
-			"_id":         docData["id"],
-			"docName":     docData["docName"],
-			"docTags":     docData["docTags"],
-			"docClass":    docData["docClass"],
-			"price":       docData["price"],
+			"_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"],
+			"docSummary":  docData.DocSummary,
+			"uploadDate":  docData.UploadDate.Format("2006-01-02 15:04:05"),
+			"docFileSize": docData.DocFileSize,
+			"docPageSize": docData.DocPageSize,
+			"docFileType": docData.DocFileType,
 		}
 		if rs := elastic.Save(model.Es_JyDoc, "_doc", saveData); rs != true {
 			return errors.New("发布到检索库失败")

+ 31 - 19
services/stdlib/docGet.go

@@ -9,37 +9,49 @@ import (
 	"app.yhyue.com/moapp/jyfs/rpc/filesystem"
 )
 
-func DocGetCheck(docId, userId string) stdlib.DocGetCheckResp {
+func DocGetCheck(docId, userId, appId string) stdlib.DocGetCheckResp {
 	// docPrice := 0
 	var buyCount int64
-	jyDocsRpcUtil.GetJyDocsDB().Table("doc").Where("docId = ? and userId = ?", docId, userId).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 = ?", docId).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: "查询失败"}
 }
 
-func DocGetContent(docId, userId, bucketName string) stdlib.DocGetContentResp {
+func DocGetContent(docId, userId, bucketName, appId string) stdlib.DocGetContentResp {
 	doc := &model.Doc{}
 	docContent := stdlib.DocGetContentResp{Code: -1, Msg: "查询失败"}
-	jyDocsRpcUtil.GetJyDocsDB().Where("id = ?", docId).Find(doc)
+	jyDocsRpcUtil.GetJyDocsDB().Where("id = ? and appId = ?", docId, appId).Find(doc)
 	if doc.DocName != "" {
 		file := filesystem.LoadFileReq{
 			Domain: bucketName,

+ 4 - 4
services/stdlib/docStatistics.go

@@ -7,18 +7,18 @@ import (
 	jyDocsRpcUtil "app.yhyue.com/moapp/jy_docs/services/util"
 )
 
-func DocStatistics(docId string, dtype int) bool {
+func DocStatistics(docId, appId string, dtype int) bool {
 	sqlStr := ""
 	state := false
 	if dtype == 1 { //下载次数增加1
-		sqlStr = "update doc_statistics set downTimes = downTimes + 1,updateDate = ? where docId = ?"
+		sqlStr = "update doc_statistics set downTimes = downTimes + 1,updateDate = ? where docId = ? and appId = ?"
 	} else if dtype == 2 { //浏览次数增加1
-		sqlStr = "update doc_statistics set viewTimes = viewTimes + 1,updateDate = ? where docId = ?"
+		sqlStr = "update doc_statistics set viewTimes = viewTimes + 1,updateDate = ? where docId = ? and appId = ?"
 	}
 	//mysql
 	log.Println("sql ", sqlStr)
 	updateDate := time.Now().Format("2006-01-02 15:04:05")
-	err := jyDocsRpcUtil.GetJyDocsDB().Exec(sqlStr, updateDate, docId).Error
+	err := jyDocsRpcUtil.GetJyDocsDB().Exec(sqlStr, updateDate, docId, appId).Error
 	if err == nil {
 		state = true
 	}

+ 27 - 42
services/userlib/userDocService.go

@@ -5,13 +5,14 @@ import (
 	"app.yhyue.com/moapp/jy_docs/services/model"
 	docRpcUtil "app.yhyue.com/moapp/jy_docs/services/util"
 	"errors"
+	"fmt"
 	"gorm.io/gorm"
 	"log"
 	"time"
 )
 
 //文档收藏
-func UserDocCollect(userDoc *model.UserDoc, cost int) bool {
+func UserDocCollect(userDoc *model.UserDoc) bool {
 	log.Println("UserDocCollect exec ......")
 	orm := docRpcUtil.GetJyDocsDB()
 	docData := model.UserDocData{}
@@ -21,20 +22,20 @@ func UserDocCollect(userDoc *model.UserDoc, cost int) bool {
 			Find(&docData).Error
 		if err0 != nil {
 			log.Println("查询已存在收藏记录失败")
-			return err0
+			return errors.New("查询已存在收藏记录失败")
 		}
 		//已收藏数据处理
 		if docData.IsCollection == 1 {
 			log.Println("此文档,该用户已收藏,不可重复收藏")
-			return err0
+			return errors.New("此文档,该用户已收藏,不可重复收藏")
 		}
 		//查询文档基础信息
 		doc := model.Doc{}
 		err0 = orm.Where("id = ?", userDoc.DocId).
 			Find(&doc).Error
 		if err0 != nil || doc.Id == "" {
-			log.Println("文档不存在", err0)
-			return err0
+			log.Println("文档不存在")
+			return errors.New("文档不存在")
 		}
 		userDoc.DocSourceUserId = doc.UserId
 		userDoc.DocCategory = 2
@@ -46,6 +47,7 @@ func UserDocCollect(userDoc *model.UserDoc, cost int) bool {
 		userDoc.DocPageSize = doc.DocPageSize
 		userDoc.DocSummary = doc.DocSummary
 		userDoc.IsCollection = 1
+		userDoc.Cost = fmt.Sprint(doc.Price)
 		//已取消收藏,再次进行收藏
 		if docData.IsCollection == 0 && docData.UserId != "" {
 			err := orm.Exec("UPDATE user_doc SET isCollection = 1 WHERE id = ?", docData.Id).Error
@@ -69,7 +71,7 @@ func UserDocCollect(userDoc *model.UserDoc, cost int) bool {
 			}
 		}
 		//用户收藏、兑换记录表添加记录
-		err := orm.Exec("insert into download_collection_record (docId,userId,appId,sourceUserId,category,cost) values (?,?,?,?,?,?)", userDoc.DocId, userDoc.UserId, userDoc.AppId, userDoc.DocSourceUserId, 2, cost).Error
+		err := orm.Exec("insert into download_collection_record (docId,userId,appId,sourceUserId,category,cost) values (?,?,?,?,?,?)", userDoc.DocId, userDoc.UserId, userDoc.AppId, userDoc.DocSourceUserId, 2, doc.Price).Error
 		if err != nil {
 			log.Println("userDocCollect record insert error:", err)
 			tx.Rollback()
@@ -84,26 +86,26 @@ func UserDocCollect(userDoc *model.UserDoc, cost int) bool {
 }
 
 //文档取消收藏
-func UserDocCancelCollect(userDocId string) bool {
+func UserDocCancelCollect(docId, userId,appId string) bool {
 	orm := docRpcUtil.GetJyDocsDB()
 	err := orm.Transaction(func(tx *gorm.DB) error {
 		//收藏记录详情
 		userDoc := model.UserDoc{}
-		err := orm.Where("id = ?", userDocId).
+		err := orm.Where("docId = ? AND userId = ? AND appId = ? AND isCollection = 1", docId,userId,appId).
 			Find(&userDoc).Error
 		if err != nil || userDoc.ID == 0{
 			log.Println("无此收藏记录,取消收藏失败", err)
-			return err
+			return errors.New("无此收藏记录,取消收藏失败")
 		}
 		//文档取消收藏状态修改
-		err = orm.Exec("UPDATE user_doc SET isCollection = 0 WHERE id = ? AND isCollection = 1", userDocId).Error
+		err = orm.Exec("UPDATE user_doc SET isCollection = 0 WHERE id = ? AND isCollection = 1", userDoc.ID).Error
 		if err != nil {
 			log.Println("文档取消收藏失败")
 			tx.Rollback()
 			return err
 		}
 		//记录文档取消收藏添加记录
-		err = orm.Exec("insert into download_collection_record (docId,userId,appId,sourceUserId,category,cost) values (?,?,?,?,?,?)", userDoc.DocId, userDoc.UserId, userDoc.AppId, userDoc.DocSourceUserId, 3, 0).Error
+		err = orm.Exec("insert into download_collection_record (docId,userId,appId,sourceUserId,category,cost) values (?,?,?,?,?,?)", userDoc.DocId, userDoc.UserId, userDoc.AppId, userDoc.DocSourceUserId, 3, userDoc.Cost).Error
 		if err != nil {
 			log.Println("userDocCollect record insert error:", err)
 			tx.Rollback()
@@ -118,7 +120,7 @@ func UserDocCancelCollect(userDocId string) bool {
 }
 
 //兑换操作
-func UserDocDownload(userDoc *model.UserDoc, cost int, hosts []string, key string) (bool, string) {
+func UserDocDownload(userDoc *model.UserDoc, cost int) (bool, string) {
 	log.Println("UserDocCollect exec ......")
 	msg := "兑换成功"
 	err := docRpcUtil.GetJyDocsDB().Transaction(func(tx *gorm.DB) error {
@@ -246,25 +248,19 @@ func UserDocDownload(userDoc *model.UserDoc, cost int, hosts []string, key strin
 }
 
 //文档删除
-func UserDocDelete(userDocId int32, appId int64) (bool, string) {
+func UserDocDelete(userDocId int32,appId, userId string) (bool, string) {
 	msg := "文档删除成功"
 	err := docRpcUtil.GetJyDocsDB().Transaction(func(tx *gorm.DB) error {
 		//逻辑删除
-		err := docRpcUtil.GetJyDocsDB().Exec("UPDATE user_doc SET isDelete = ? WHERE id = ?", model.UserDocStatus_LogicDelete, userDocId).Error
+		err := docRpcUtil.GetJyDocsDB().Exec("UPDATE user_doc SET isDelete = ? WHERE docId = ? and  userId=? and appId=?", model.UserDocStatus_LogicDelete, userDocId,userId,appId).Error
 		if err != nil {
 			msg = "文档删除失败"
 			log.Println("文档删除失败:", err)
 			tx.Rollback()
 			return err
 		}
-
-		docData := model.UserDoc{}
-		//查询用户文档详情
-		docRpcUtil.GetJyDocsDB().Select("userId,docId").First(&docData, userDocId)
-		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 (?,?,?,?,?)",userDocId, userId, time.Now(), 1, appId).Error
 		if err != nil {
 			tx.Rollback()
 			msg = "删除记录新增失败"
@@ -281,24 +277,19 @@ func UserDocDelete(userDocId int32, appId int64) (bool, string) {
 }
 
 //文档回收
-func UserDocRestore(userDocId int32, appId int64) (bool, string) {
+func UserDocRestore(userDocId int32,appId ,userId string) (bool, string) {
 	msg := "文档找回成功"
 	err := docRpcUtil.GetJyDocsDB().Transaction(func(tx *gorm.DB) error {
 		//逻辑删除
-		err := docRpcUtil.GetJyDocsDB().Exec("UPDATE user_doc SET isDelete = ? WHERE id = ?", model.UserDocStatus_Normal, userDocId).Error
+		err := docRpcUtil.GetJyDocsDB().Exec("UPDATE user_doc SET isDelete = ? WHERE docId = ? and  userId=? and  appId=?", model.UserDocStatus_Normal, userDocId,userId,appId).Error
 		if err != nil {
 			msg = "文档找回失败"
 			log.Println("文档找回失败:", err)
 			tx.Rollback()
 			return err
 		}
-		docData := model.UserDoc{}
-		//查询用户文档详情
-		docRpcUtil.GetJyDocsDB().Select("userId,docId").First(&docData, userDocId)
-		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 (?,?,?,?,?)", userDocId, userId, time.Now(), 2, appId).Error
 		if err != nil {
 			tx.Rollback()
 			msg = "删除记录新增失败"
@@ -313,24 +304,19 @@ func UserDocRestore(userDocId int32, appId int64) (bool, string) {
 	return true, msg
 
 } //永久删除
-func UserDocPermanentDelete(userDocId int32, appId int64) (bool, string) {
+func UserDocPermanentDelete(userDocId int32,appId ,userId string) (bool, string) {
 	msg := "永久删除成功"
 	err := docRpcUtil.GetJyDocsDB().Transaction(func(tx *gorm.DB) error {
 		//逻辑删除
-		err := docRpcUtil.GetJyDocsDB().Exec("UPDATE user_doc SET isDelete = ? ,isDownload=0 WHERE id = ?", model.UserDocStatus_PermanentlyDelete, userDocId).Error
+		err := docRpcUtil.GetJyDocsDB().Exec("UPDATE user_doc SET isDelete = ? ,isDownload=0 WHERE docId = ? and  userId=? and  appId=?", model.UserDocStatus_PermanentlyDelete, userDocId,userId,appId).Error
 		if err != nil {
 			msg = "永久删除失败"
 			log.Println("永久删除失败:", err)
 			tx.Rollback()
 			return err
 		}
-		docData := model.UserDoc{}
-		//查询用户文档详情
-		docRpcUtil.GetJyDocsDB().Select("userId,docId").First(&docData, userDocId)
-		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 (?,?,?,?,?)", userDocId, userId, time.Now(), 4, appId).Error
 		if err != nil {
 			tx.Rollback()
 			msg = "删除记录新增失败"
@@ -358,7 +344,7 @@ func UserDocsList(in *userlib.UserDocsRequest) ([]*model.UserDoc, int64, bool, s
 			//兑换的
 			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)
+			err = docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and isDownload=1 and isDelete=?  and  appId=? order by create_at desc  limit ?,?", in.UserId, model.UserDocStatus_Normal, in.AppId, startIndex, in.PageSize).Find(&data)
 			if err.Error != nil {
 				log.Println("查询兑换记录失败:", err)
 				msg = "查询兑换记录失败"
@@ -366,9 +352,9 @@ func UserDocsList(in *userlib.UserDocsRequest) ([]*model.UserDoc, int64, bool, s
 			}
 		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)
+			err := docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and isCollection=1 and appId=? ", in.UserId, 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)
+			err = docRpcUtil.GetJyDocsDB().Table("user_doc").Where("userId=? and isCollection=1 and appId=? order by create_at desc  limit ?,?", in.UserId, in.AppId, startIndex, in.PageSize).Find(&data)
 			if err.Error != nil {
 				log.Println("查询收藏记录失败:", err)
 				msg = "查询收藏记录失败"
@@ -378,14 +364,13 @@ func UserDocsList(in *userlib.UserDocsRequest) ([]*model.UserDoc, int64, bool, s
 			//回收站
 			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)
+			err = docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=?  and  isDelete=?  and  appId=?  order by create_at desc 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 {

+ 1 - 2
services/util/baseInit.go

@@ -1,14 +1,13 @@
 package util
 
 import (
-	"log"
-
 	elastic "app.yhyue.com/moapp/jybase/esv7"
 	"app.yhyue.com/moapp/jybase/mysql"
 	"app.yhyue.com/moapp/jyfs/rpc/filesystemclient"
 	"github.com/tal-tech/go-zero/core/discov"
 	"github.com/tal-tech/go-zero/zrpc"
 	"gorm.io/gorm"
+	"log"
 )
 
 type MysqlDBConfig struct {