Forráskód Böngészése

Merge branch 'master' of https://app.yhyue.com/moapp/jy_docs

WH01243 4 éve
szülő
commit
7ac2be34cf

+ 3 - 0
docs/es_jydoc.md

@@ -75,6 +75,9 @@ curl -XPUT http://localhost:9200/jydoc_v1 -u elastic:elastic -H 'Content-Type:ap
 			},
 			"docFileType": {
 				"type": "long"
+			},
+			"previewImgId": {
+				"type": "keyword"
 			}
 		}
 	},

+ 1 - 1
go.mod

@@ -3,7 +3,7 @@ module app.yhyue.com/moapp/jy_docs
 go 1.14
 
 require (
-	app.yhyue.com/moapp/jybase v0.0.0-20210319015107-fe59d2046cf8
+	app.yhyue.com/moapp/jybase v0.0.0-20210322021809-141cc2c37946
 	app.yhyue.com/moapp/jyfs v0.0.0-20210309070327-ecad67beabb8
 	github.com/golang/protobuf v1.4.3
 	github.com/mailru/easyjson v0.7.7 // indirect

+ 3 - 0
go.sum

@@ -2,6 +2,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20210318061912-f5594310c8fe h1:RSQIrriyi534CCr
 app.yhyue.com/moapp/jybase v0.0.0-20210318061912-f5594310c8fe/go.mod h1:29ShuI8y7qEyg2KviHSx1iamiCioBKdTMm2ndVzWAhk=
 app.yhyue.com/moapp/jybase v0.0.0-20210319015107-fe59d2046cf8 h1:0wnq1iFfpPrASDJzO24+Lr2pMO18ISNDf1n4TU3faTQ=
 app.yhyue.com/moapp/jybase v0.0.0-20210319015107-fe59d2046cf8/go.mod h1:29ShuI8y7qEyg2KviHSx1iamiCioBKdTMm2ndVzWAhk=
+app.yhyue.com/moapp/jybase v0.0.0-20210322021809-141cc2c37946 h1:w4voEoJ5RqjlUyGhNC15sk3RdwCCi2U5uX33Btw9BMc=
+app.yhyue.com/moapp/jybase v0.0.0-20210322021809-141cc2c37946/go.mod h1:29ShuI8y7qEyg2KviHSx1iamiCioBKdTMm2ndVzWAhk=
 app.yhyue.com/moapp/jyfs v0.0.0-20210309070327-ecad67beabb8 h1:Mg5E4O+5mCjRyW2b4/bNRQMz8ilzWfa7qaOjKT7SNRY=
 app.yhyue.com/moapp/jyfs v0.0.0-20210309070327-ecad67beabb8/go.mod h1:iflE6z/Ee5f7YZy2DSj7S6asyL1yCbu3BjK/xMYMiDY=
 github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
@@ -55,6 +57,7 @@ github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f/go.mod h1:QGrK8vMWW
 github.com/dchest/siphash v1.2.1/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4=
 github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
 github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
+github.com/donnie4w/go-logger v0.0.0-20170827050443-4740c51383f4 h1:T9PR91sjTtrA1HmZB4G+M7OLCelch0f6rIEY7Mm1T4U=
 github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4 h1:qk/FSDDxo05wdJH28W+p5yivv7LuLYLRXPPD8KQCtZs=
 github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
 github.com/emicklei/proto v1.9.0/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A=

+ 1 - 0
rpc/stdlib/README.md

@@ -1 +1,2 @@
 标准库-大库
+goctl rpc proto -src stdlib.proto -dir .

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

@@ -2,7 +2,6 @@ package logic
 
 import (
 	"context"
-	"log"
 
 	"app.yhyue.com/moapp/jy_docs/rpc/stdlib/internal/svc"
 	"app.yhyue.com/moapp/jy_docs/rpc/stdlib/stdlib"
@@ -31,8 +30,6 @@ func (l *DocActivityLogic) DocActivity(in *stdlib.DocActivityReq) (*stdlib.DocAc
 	if int(in.PageNum) <= 0 {
 		pageNum = 0
 	}
-	res, count := stdlibService.DocActivityList(int(in.PageSize), pageNum, int(in.ActivityId), in.AppId)
-	log.Println("res ", res)
-	log.Println("count ", count)
+	res := stdlibService.DocActivityList(int(in.PageSize), pageNum, int(in.ActivityId), in.AppId, in.UserId)
 	return res, nil
 }

+ 1 - 1
rpc/stdlib/stdlib.go

@@ -23,7 +23,7 @@ func main() {
 	if c.JyDocsMysqlDB.DataSourceName != "" && c.EsConfig.Addr != "" {
 		jyDocsRpcUtil.InitDB(c.JyDocsMysqlDB.DataSourceName, c.JyDocsMysqlDB.DriverName, c.JyDocsMysqlDB.MaxOpenConn, c.JyDocsMysqlDB.MaxIdleConn)
 		jyDocsRpcUtil.InitEs(c.EsConfig.Addr, c.EsConfig.Pool, c.EsConfig.UserName, c.EsConfig.Password)
-		jyDocsRpcUtil.InitOss(c.FileSystemConf)
+		// jyDocsRpcUtil.InitOss(c.FileSystemConf)
 		ctx := svc.NewServiceContext(c)
 		srv := server.NewStdlibServer(ctx)
 		s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {

+ 7 - 2
rpc/stdlib/stdlib.proto

@@ -60,7 +60,8 @@ message DocGetCheckResp {
   int64 code = 1;    //响应代码
   string msg = 2; //响应消息
   bool isBuy = 3; //是否购买
-  DocInfo DocDeail = 4;
+  bool isCollect = 4; //是否收藏
+  DocInfo DocDeail = 5;
 }
 
 message DocInfo {
@@ -77,6 +78,7 @@ message DocInfo {
   int64 docFileType = 11;//文档类型
   string previewImgId = 12; //缩略图oss
   string ossPdfId = 13; //pdf oss
+  string ossDocId = 14; //doc oss
 }
 
 message DocGetContentResp {
@@ -89,7 +91,8 @@ message DocActivityReq {
   int64 pageNum = 1; //页码 
   int64 pageSize = 2; //每页数量
   string appId = 3; //appId
-  int64 activityId = 4; //活动id
+  string userId = 4; //当前用户id
+  int64 activityId = 5; //活动id
 }
 
 message DocActivity {
@@ -105,6 +108,8 @@ message DocActivity {
   int64 docFileSize = 10; //文件大小
   int64 docPageSize = 11; //页码数
   int64 docFileType = 12; //文件类型,1 doc 2 pdf 3 xls 4 ppt 5 txt 6 其他
+  string uploadDate = 13; //上传时间
+  bool isBuy = 14; //是否购买
 }
 
 message DocActivityResp {

+ 159 - 110
rpc/stdlib/stdlib/stdlib.pb.go

@@ -571,10 +571,11 @@ type DocGetCheckResp struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	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"`
+	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"`         //是否购买
+	IsCollect bool     `protobuf:"varint,4,opt,name=isCollect,proto3" json:"isCollect,omitempty"` //是否收藏
+	DocDeail  *DocInfo `protobuf:"bytes,5,opt,name=DocDeail,proto3" json:"DocDeail,omitempty"`
 }
 
 func (x *DocGetCheckResp) Reset() {
@@ -630,6 +631,13 @@ func (x *DocGetCheckResp) GetIsBuy() bool {
 	return false
 }
 
+func (x *DocGetCheckResp) GetIsCollect() bool {
+	if x != nil {
+		return x.IsCollect
+	}
+	return false
+}
+
 func (x *DocGetCheckResp) GetDocDeail() *DocInfo {
 	if x != nil {
 		return x.DocDeail
@@ -655,6 +663,7 @@ type DocInfo struct {
 	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
 	OssPdfId     string `protobuf:"bytes,13,opt,name=ossPdfId,proto3" json:"ossPdfId,omitempty"`         //pdf oss
+	OssDocId     string `protobuf:"bytes,14,opt,name=ossDocId,proto3" json:"ossDocId,omitempty"`         //doc oss
 }
 
 func (x *DocInfo) Reset() {
@@ -780,6 +789,13 @@ func (x *DocInfo) GetOssPdfId() string {
 	return ""
 }
 
+func (x *DocInfo) GetOssDocId() string {
+	if x != nil {
+		return x.OssDocId
+	}
+	return ""
+}
+
 type DocGetContentResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -851,7 +867,8 @@ type DocActivityReq struct {
 	PageNum    int64  `protobuf:"varint,1,opt,name=pageNum,proto3" json:"pageNum,omitempty"`       //页码
 	PageSize   int64  `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"`     //每页数量
 	AppId      string `protobuf:"bytes,3,opt,name=appId,proto3" json:"appId,omitempty"`            //appId
-	ActivityId int64  `protobuf:"varint,4,opt,name=activityId,proto3" json:"activityId,omitempty"` //活动id
+	UserId     string `protobuf:"bytes,4,opt,name=userId,proto3" json:"userId,omitempty"`          //当前用户id
+	ActivityId int64  `protobuf:"varint,5,opt,name=activityId,proto3" json:"activityId,omitempty"` //活动id
 }
 
 func (x *DocActivityReq) Reset() {
@@ -907,6 +924,13 @@ func (x *DocActivityReq) GetAppId() string {
 	return ""
 }
 
+func (x *DocActivityReq) GetUserId() string {
+	if x != nil {
+		return x.UserId
+	}
+	return ""
+}
+
 func (x *DocActivityReq) GetActivityId() int64 {
 	if x != nil {
 		return x.ActivityId
@@ -931,6 +955,8 @@ type DocActivity struct {
 	DocFileSize  int64  `protobuf:"varint,10,opt,name=docFileSize,proto3" json:"docFileSize,omitempty"` //文件大小
 	DocPageSize  int64  `protobuf:"varint,11,opt,name=docPageSize,proto3" json:"docPageSize,omitempty"` //页码数
 	DocFileType  int64  `protobuf:"varint,12,opt,name=docFileType,proto3" json:"docFileType,omitempty"` //文件类型,1 doc 2 pdf 3 xls 4 ppt 5 txt 6 其他
+	UploadDate   string `protobuf:"bytes,13,opt,name=uploadDate,proto3" json:"uploadDate,omitempty"`    //上传时间
+	IsBuy        bool   `protobuf:"varint,14,opt,name=isBuy,proto3" json:"isBuy,omitempty"`             //是否购买
 }
 
 func (x *DocActivity) Reset() {
@@ -1049,6 +1075,20 @@ func (x *DocActivity) GetDocFileType() int64 {
 	return 0
 }
 
+func (x *DocActivity) GetUploadDate() string {
+	if x != nil {
+		return x.UploadDate
+	}
+	return ""
+}
+
+func (x *DocActivity) GetIsBuy() bool {
+	if x != nil {
+		return x.IsBuy
+	}
+	return false
+}
+
 type DocActivityResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -1185,112 +1225,121 @@ var file_stdlib_proto_rawDesc = []byte{
 	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, 0x85, 0x03, 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, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x73, 0x73, 0x50, 0x64, 0x66, 0x49, 0x64, 0x18, 0x0d,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x73, 0x73, 0x50, 0x64, 0x66, 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, 0x03, 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, 0x03, 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, 0x03, 0x52, 0x0a, 0x61, 0x63, 0x74,
-	0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x64, 0x22, 0xf3, 0x02, 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,
-	0x03, 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, 0x03,
-	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, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x73, 0x74,
-	0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x54, 0x69, 0x6d,
-	0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x54, 0x69,
-	0x6d, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x73, 0x65,
-	0x72, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63,
-	0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69,
-	0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x64, 0x6f,
+	0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x98, 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, 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, 0x1c, 0x0a, 0x09, 0x69, 0x73,
+	0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69,
+	0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x2b, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x44,
+	0x65, 0x61, 0x69, 0x6c, 0x18, 0x05, 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, 0xa1, 0x03, 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, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b,
-	0x64, 0x6f, 0x63, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64,
-	0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 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,
+	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, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x73, 0x73, 0x50, 0x64, 0x66, 0x49, 0x64, 0x18, 0x0d, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x73, 0x73, 0x50, 0x64, 0x66, 0x49, 0x64, 0x12, 0x1a, 0x0a,
+	0x08, 0x6f, 0x73, 0x73, 0x44, 0x6f, 0x63, 0x49, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x08, 0x6f, 0x73, 0x73, 0x44, 0x6f, 0x63, 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, 0x94, 0x01, 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, 0x03, 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, 0x03, 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, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x61,
+	0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x64, 0x22, 0xa9, 0x03, 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, 0x03, 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, 0x03, 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, 0x03, 0x52, 0x09,
+	0x63, 0x6f, 0x73, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x6f, 0x77,
+	0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x64, 0x6f,
+	0x77, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63,
+	0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73,
+	0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64,
+	0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x0a, 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, 0x0b, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x0b, 0x64, 0x6f, 0x63, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12,
+	0x20, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0c,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70,
+	0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x65, 0x18,
+	0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74,
+	0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x42, 0x75, 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08,
+	0x52, 0x05, 0x69, 0x73, 0x42, 0x75, 0x79, 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 (

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

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

+ 7 - 4
rpc/stdlib/test/doc_test.go

@@ -42,10 +42,13 @@ 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, AppId: "app_id_123"}
+	req := &stdlib.DocActivityReq{PageNum: 1, PageSize: 10, AppId: "10000", ActivityId: 3, UserId: "5e8eb60ae138234b4f91aacf"}
 	res, err := std.DocActivity(ctx, req)
 	log.Println("err ", err)
-	log.Println("req ", res)
+	for _, v := range res.Docs {
+		log.Println("IsBuy ", v.IsBuy)
+		log.Println("date ", v.UploadDate)
+	}
 }
 
 func Test_DocStatistics(t *testing.T) {
@@ -60,10 +63,10 @@ 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", AppId: "app_id_123"}
+	req := &stdlib.DocGetCheckReq{DocId: "001d00e2-887b-11eb-8699-0050568f51e7", UserId: "5e8eb60ae138234b4f91aacf", AppId: "10000"}
 	res, err := std.DocGetCheck(ctx, req)
 	log.Println("err ", err)
-	log.Println("req ", res)
+	log.Println("req ", res.IsBuy)
 }
 
 func Test_DocGetContent(t *testing.T) {

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

@@ -7,7 +7,7 @@ Etcd:
 FileSystemConf:
   Etcd:
     Hosts:
-      - 127.0.0.1:2380
+      - 127.0.0.1:2379
     Key: integral.rpc
 JyDocsMysqlDB:
   DriverName: "mysql"
@@ -15,3 +15,5 @@ JyDocsMysqlDB:
   MaxOpenConn: 20
   MaxIdleConn: 10
   MaxConnLifeTime: 100
+Callee: "文库"
+Node: "1"

+ 2 - 0
rpc/userlib/internal/config/config.go

@@ -9,6 +9,8 @@ type Config struct {
 	zrpc.RpcServerConf
 	JyDocsMysqlDB  jyDocRpcUtil.MysqlDBConfig
 	FileSystemConf zrpc.RpcClientConf
+	Callee			string
+	Node			string
 }
 
 var   Configs Config

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

@@ -19,7 +19,7 @@ func Test_UserDocCollect(t *testing.T) {
 	})
 	userLib := userlibclient.NewUserLib(client)
 	resp, err := userLib.DocCollect(context.Background(), &userlibclient.UserCollectRequest{
-		DocId:  "SUgJfBt1M6nop8kvwcu5",
+		DocId:  "010ef774-888c-11eb-8699-0050568f51e7",
 		UserId: "5d6378301c298a5aac7b5402",
 		AppId:  "10000",
 	})

+ 97 - 4
rpc/userlib/userlib.go

@@ -1,11 +1,16 @@
 package main
 
 import (
+	"app.yhyue.com/moapp/jy_docs/services/model"
+	userLibService "app.yhyue.com/moapp/jy_docs/services/userlib"
 	jyDocsRpcUtil "app.yhyue.com/moapp/jy_docs/services/util"
 	"context"
+	"encoding/json"
 	"flag"
 	"fmt"
 	"log"
+	"strconv"
+	"time"
 
 	"app.yhyue.com/moapp/jy_docs/rpc/userlib/internal/config"
 	"app.yhyue.com/moapp/jy_docs/rpc/userlib/internal/server"
@@ -16,7 +21,6 @@ import (
 	"github.com/tal-tech/go-zero/zrpc"
 	"google.golang.org/grpc"
 )
-
 var configFile = flag.String("f", "etc/userlib.yaml", "the config file")
 func main() {
 	flag.Parse()
@@ -36,8 +40,97 @@ func main() {
 		log.Fatal("【jy_docs】 read config error!")
 	}
 }
+
 func rateLimitInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
-	fmt.Println("拦截器")
-	log.Println("方法名:",info.FullMethod,"  参数:",req)
-	return handler(ctx, req)
+	jsonStr := Strval(req)
+	var dat map[string]interface{}
+	if err := json.Unmarshal([]byte(jsonStr), &dat); err == nil {
+		fmt.Println("==============json str 转map=======================")
+	}
+	resp, err = handler(ctx, req)
+	/*fmt.Println("接口名称:",info.FullMethod)
+	fmt.Println("被调用者身份:",config.Configs.Callee)
+	fmt.Println("调用者身份:",dat["appId"])
+	fmt.Println("入参:",req)
+	fmt.Println("返回信息:",resp)
+	fmt.Println("节点:",config.Configs.Node)
+	fmt.Println("摘要:",resp)
+	fmt.Println("时间戳:",time.Now().Unix())*/
+	res := fmt.Sprint(resp)
+	nameRune := []rune(res)
+	if len(res) > 255 {
+		res = string(nameRune[:255])
+	}
+	data := &model.InterfaceLog{}
+	data.InterName = info.FullMethod
+	data.CalleeId = config.Configs.Callee
+	data.AppId = fmt.Sprint(dat["appId"])
+	data.InParameter = fmt.Sprint(req)
+	data.ReturnInfo = res
+	data.Node = config.Configs.Node
+	data.Summary = res
+	data.Timestamp = time.Now()
+	flag := userLibService.InterfaceLog(data)
+	if flag {
+		log.Println("接口调用日志记录成功")
+	}
+	return resp,err
+}
+
+// Strval 获取变量的字符串值
+// 浮点型 3.0将会转换成字符串3, "3"
+// 非数值或字符类型的变量将会被转换成JSON格式字符串
+func Strval(value interface{}) string {
+	var key string
+	if value == nil {
+		return key
+	}
+
+	switch value.(type) {
+	case float64:
+		ft := value.(float64)
+		key = strconv.FormatFloat(ft, 'f', -1, 64)
+	case float32:
+		ft := value.(float32)
+		key = strconv.FormatFloat(float64(ft), 'f', -1, 64)
+	case int:
+		it := value.(int)
+		key = strconv.Itoa(it)
+	case uint:
+		it := value.(uint)
+		key = strconv.Itoa(int(it))
+	case int8:
+		it := value.(int8)
+		key = strconv.Itoa(int(it))
+	case uint8:
+		it := value.(uint8)
+		key = strconv.Itoa(int(it))
+	case int16:
+		it := value.(int16)
+		key = strconv.Itoa(int(it))
+	case uint16:
+		it := value.(uint16)
+		key = strconv.Itoa(int(it))
+	case int32:
+		it := value.(int32)
+		key = strconv.Itoa(int(it))
+	case uint32:
+		it := value.(uint32)
+		key = strconv.Itoa(int(it))
+	case int64:
+		it := value.(int64)
+		key = strconv.FormatInt(it, 10)
+	case uint64:
+		it := value.(uint64)
+		key = strconv.FormatUint(it, 10)
+	case string:
+		key = value.(string)
+	case []byte:
+		key = string(value.([]byte))
+	default:
+		newValue, _ := json.Marshal(value)
+		key = string(newValue)
+	}
+
+	return key
 }

+ 28 - 12
services/model/stdlib.go

@@ -64,18 +64,19 @@ func (ud *UserDoc) TableName() string {
 }
 
 type DocActivity struct {
-	Id          int    `json:"id" gorm:"primaryKey"`
-	DocId       string `json:"doc_id" gorm:"column:docId"`
-	ActivityId  int    `json:"activity_id" gorm:"column:activityId"`
-	AppId       string `json:"app_id" gorm:"column:appId"`
-	DocTitle    string `json:"doc_title" gorm:"column:docTitle"`
-	DocSummary  string `json:"doc_summary" gorm:"column:docSummary"`
-	DocImg      string `json:"doc_img" gorm:"column:docImg"`
-	Price       int    `json:"price" gorm:"column:price"`
-	CostPrice   int    `json:"cost_price" gorm:"column:costPrice"`
-	DocFileSize int    `json:"doc_file_size" gorm:"column:docFileSize"`
-	DocPageSize int    `json:"doc_page_size" gorm:"column:docPageSize"`
-	DocFileType int    `json:"docFileType" gorm:"column:docFileType"`
+	Id          int       `json:"id" gorm:"primaryKey"`
+	DocId       string    `json:"doc_id" gorm:"column:docId"`
+	ActivityId  int       `json:"activity_id" gorm:"column:activityId"`
+	AppId       string    `json:"app_id" gorm:"column:appId"`
+	DocTitle    string    `json:"doc_title" gorm:"column:docTitle"`
+	DocSummary  string    `json:"doc_summary" gorm:"column:docSummary"`
+	DocImg      string    `json:"doc_img" gorm:"column:docImg"`
+	Price       int       `json:"price" gorm:"column:price"`
+	CostPrice   int       `json:"cost_price" gorm:"column:costPrice"`
+	DocFileSize int       `json:"doc_file_size" gorm:"column:docFileSize"`
+	DocPageSize int       `json:"doc_page_size" gorm:"column:docPageSize"`
+	DocFileType int       `json:"docFileType" gorm:"column:docFileType"`
+	UploadDate  time.Time `json:"uploadDate" gorm:"column:uploadDate"`
 }
 
 func (ud *DocActivity) TableName() string {
@@ -107,3 +108,18 @@ type DocStatistics struct {
 func (ud *DocStatistics) TableName() string {
 	return "doc_statistics"
 }
+
+type InterfaceLog struct {
+	InterName   string    `json:"interName"  gorm:"column:interName"`
+	CalleeId    string    `json:"calleeId" gorm:"column:calleeId"`
+	AppId       string    `json:"appId" gorm:"column:appId"`
+	InParameter string    `json:"inParameter" gorm:"column:inParameter"`
+	ReturnInfo  string    `json:"returnInfo" gorm:"column:returnInfo"`
+	Node        string    `json:"node" gorm:"column:node"`
+	Summary     string    `json:"summary" gorm:"column:summary"`
+	Timestamp   time.Time `json:"timestamp" gorm:"column:timestamp"`
+}
+
+func (ud *InterfaceLog) TableName() string {
+	return "interface_log"
+}

+ 10 - 2
services/stdlib/docActivity.go

@@ -6,7 +6,7 @@ import (
 	jyDocsRpcUtil "app.yhyue.com/moapp/jy_docs/services/util"
 )
 
-func DocActivityList(pageSize, pageNum, activityId int, appId string) (*stdlib.DocActivityResp, int) {
+func DocActivityList(pageSize, pageNum, activityId int, appId, userId string) *stdlib.DocActivityResp {
 	var docActivity []model.DocActivity
 	// var docs []map[string]interface{}
 	var count int64
@@ -18,6 +18,12 @@ func DocActivityList(pageSize, pageNum, activityId int, appId string) (*stdlib.D
 	}
 	docActivityResp := &stdlib.DocActivityResp{Code: 1, Msg: "ok", Total: int32(count)}
 	for _, v := range docActivity {
+		var buyCount int64
+		isbuy := false
+		jyDocsRpcUtil.GetJyDocsDB().Table("user_doc").Where("docId = ? and userId = ? and appId = ? and isDownload = 1", v.DocId, userId, appId).Count(&buyCount)
+		if buyCount > 0 {
+			isbuy = true
+		}
 		docStatistics := model.DocStatistics{}
 		jyDocsRpcUtil.GetJyDocsDB().First(&docStatistics, &model.DocStatistics{AppId: appId, DocId: v.DocId})
 		docActivityResp.Docs = append(docActivityResp.Docs, &stdlib.DocActivity{
@@ -32,8 +38,10 @@ func DocActivityList(pageSize, pageNum, activityId int, appId string) (*stdlib.D
 			DocPageSize: int64(v.DocPageSize),
 			DownTimes:   int64(docStatistics.DownTimes),
 			DocFileType: int64(v.DocFileType),
+			UploadDate:  v.UploadDate.Format("2006-01-02 15:04:05"),
+			IsBuy:       isbuy,
 		})
 	}
 
-	return docActivityResp, int(count)
+	return docActivityResp
 }

+ 14 - 6
services/stdlib/docGet.go

@@ -12,11 +12,16 @@ import (
 func DocGetCheck(docId, userId, appId string) stdlib.DocGetCheckResp {
 	// docPrice := 0
 	var buyCount int64
-	isbuy := false
-	jyDocsRpcUtil.GetJyDocsDB().Table("download_collection_record").Where("docId = ? and userId = ? and appId = ? and category = 1", docId, userId, appId).Count(&buyCount)
+	var collectCount int64
+	isbuy, isCollect := false, false
+	jyDocsRpcUtil.GetJyDocsDB().Table("user_doc").Where("docId = ? and userId = ? and appId = ? and isDownload = 1", docId, userId, appId).Count(&buyCount)
 	if buyCount > 0 {
 		isbuy = true
 	}
+	jyDocsRpcUtil.GetJyDocsDB().Table("user_doc").Where("docId = ? and userId = ? and appId = ? and isCollection = 1", docId, userId, appId).Count(&collectCount)
+	if collectCount > 0 {
+		isCollect = true
+	}
 	//已购买
 	doc := &model.Doc{}
 	jyDocsRpcUtil.GetJyDocsDB().Where("id = ? and appId = ?", docId, appId).Find(doc)
@@ -24,14 +29,16 @@ func DocGetCheck(docId, userId, appId string) stdlib.DocGetCheckResp {
 		// docPrice = docData["price"].(int)
 		docStatistics := model.DocStatistics{}
 		jyDocsRpcUtil.GetJyDocsDB().First(&docStatistics, &model.DocStatistics{AppId: appId, DocId: docId})
-		ossPdfId := ""
+		ossPdfId, ossDocId := "", ""
 		if isbuy {
 			ossPdfId = doc.OssPdfId
+			ossDocId = doc.OssDocId
 		}
 		docCheck := stdlib.DocGetCheckResp{
-			Code:  1,
-			Msg:   "ok",
-			IsBuy: isbuy,
+			Code:      1,
+			Msg:       "ok",
+			IsBuy:     isbuy,
+			IsCollect: isCollect,
 			DocDeail: &stdlib.DocInfo{
 				DocId:        doc.Id,
 				DocName:      doc.DocName,
@@ -46,6 +53,7 @@ func DocGetCheck(docId, userId, appId string) stdlib.DocGetCheckResp {
 				DocFileType:  int64(doc.DocFileType),
 				PreviewImgId: doc.PreviewImgId,
 				OssPdfId:     ossPdfId,
+				OssDocId:     ossDocId,
 			},
 		}
 		return docCheck

+ 18 - 1
services/userlib/userDocService.go

@@ -378,5 +378,22 @@ func UserDocsList(in *userlib.UserDocsRequest) ([]*model.UserDoc, int64, bool, s
 		return data, count, false, msg
 	}
 	return data, count, true, msg
-
 }
+
+/*接口日志添加*/
+func InterfaceLog(in *model.InterfaceLog) bool {
+	orm := docRpcUtil.GetJyDocsDB()
+	err := orm.Transaction(func(tx *gorm.DB) error {
+		err := orm.Create(in)
+		if err.Error != nil {
+			log.Println("接口日志添加失败:", err)
+			tx.Rollback()
+			return err.Error
+		}
+		return nil
+	})
+	if err != nil {
+		return false
+	}
+	return true
+}

+ 12 - 8
timetask/main.go

@@ -8,6 +8,7 @@ import (
 	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/date"
 	"app.yhyue.com/moapp/jybase/esv7"
+	"app.yhyue.com/moapp/jybase/go-logger/logger"
 	. "app.yhyue.com/moapp/jybase/mysql"
 	"gorm.io/gorm"
 )
@@ -55,13 +56,15 @@ func init() {
 	}
 	common.ReadConfig("./timetask.json", &TimeTask)
 	elastic.InitElasticSizeByAuth(Config.Elasticsearch.Address, Config.Elasticsearch.Size, Config.Elasticsearch.UserName, Config.Elasticsearch.PassWord)
-	log.Printf("初始化 elasticsearch")
+	log.Println("初始化 elasticsearch")
 	Mysql = GormMysql(Config.Mysql.Url, Config.Mysql.DriverName, Config.Mysql.MaxOpenConns, Config.Mysql.MaxIdleConns, nil)
 	if Mysql != nil {
-		log.Printf("初始化 mysql")
+		log.Println("初始化 mysql")
 	} else {
 		log.Fatalf("mysql初始化失败")
 	}
+	logger.SetConsole(false)
+	logger.SetRollingDaily("./logs", "timetask.log")
 }
 func main() {
 	run()
@@ -70,11 +73,12 @@ func main() {
 
 //
 func run() {
+	defer common.Catch()
 	now := date.NowFormat(date.Date_Full_Layout)
 	log.Println("start update to es", TimeTask.Time, now)
 	rows, err := Mysql.Raw(`select docId,downTimes,viewTimes from doc_statistics where updateDate>=? and updateDate<?`, TimeTask.Time, now).Rows()
 	if err != nil {
-		log.Println(err)
+		logger.Error(err)
 		return
 	}
 	if rows != nil {
@@ -88,23 +92,23 @@ func run() {
 		var viewTimes int
 		err = rows.Scan(&docId, &downTimes, &viewTimes)
 		if err != nil {
-			log.Println(err)
-			break
+			logger.Error(err)
+			continue
 		}
 		log.Println("need update to es", "docId", docId, "downTimes", downTimes, "viewTimes", viewTimes)
 		index++
 		array = append(array, []string{docId, fmt.Sprintf("ctx._source.downTimes=%d;ctx._source.viewTimes=%d", downTimes, viewTimes)})
 		if len(array) == Config.BlukSize {
-			log.Println("update es index", index, elastic.NewBulkUpdate(Es_Jydoc, array...))
+			logger.Info("update es index", index, elastic.NewBulkUpdate(Es_Jydoc, array...))
 			array = [][]string{}
 		}
 	}
 	if len(array) > 0 {
-		log.Println("update es index", index, elastic.NewBulkUpdate(Es_Jydoc, array...))
+		logger.Info("update es index", index, elastic.NewBulkUpdate(Es_Jydoc, array...))
 		array = [][]string{}
 	}
 	TimeTask.Time = now
 	common.WriteSysConfig("./timetask.json", &TimeTask)
-	log.Println("update to es over", index)
+	logger.Info("update to es over", index)
 	time.AfterFunc(time.Duration(Config.DurationMinute)*time.Minute, run)
 }