Browse Source

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

xuzhiheng 4 years ago
parent
commit
dae659953b

+ 2 - 0
go.mod

@@ -3,6 +3,8 @@ module app.yhyue.com/moapp/jy_docs
 go 1.14
 
 require (
+	app.yhyue.com/moapp/jyPoints v0.0.0-20210316030700-afaec87a982b
+	app.yhyue.com/moapp/git   v0.0.0-20210317020927-18b0165f5ff9
 	app.yhyue.com/moapp/jybase v0.0.0-20210317020927-18b0165f5ff9
 	app.yhyue.com/moapp/jyfs v0.0.0-20210309070327-ecad67beabb8
 	github.com/golang/protobuf v1.4.3

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

@@ -25,10 +25,10 @@ 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)
+	b := userLibService.UserDocCancelCollect(in.DocId,in.UserId,in.AppId)
 	result.Code = 400
 	result.Message = "取消收藏失败"
 	if b {

+ 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

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

+ 11 - 6
rpc/userlib/test/userLib_test.go

@@ -39,8 +39,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: "1",
+		UserId: "2",
+		AppId: 10000,
 	})
 	if err != nil {
 		log.Println("UserDoc Collect call error:", err)
@@ -58,8 +60,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:int64(10000),
+		UserId:       "wh11",
 	})
 	if err != nil {
 		log.Println("UserDoc Collect call error:", err)
@@ -78,7 +81,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:int64(10000),
+		UserId:       "wh11",
 	})
 	if err != nil {
 		log.Println("UserDoc Collect call error:", err)
@@ -97,7 +101,8 @@ 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:int64(10000),
+		UserId:       "wh11",
 	})
 	if err != nil {
 		log.Println("UserDoc Collect call error:", err)

+ 8 - 6
rpc/userlib/userlib.proto

@@ -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;//用户标识
+    int64 appId=3;//剑鱼标识
 }
 message UserDeleteResponse {
     int32 code =1;    //响应代码
@@ -65,8 +66,9 @@ message UserDocsResponse {
     repeated userDocs data=4; //列表
 }
 message UserRecoveryRequest {
-    int32 userDocId =1;   //记录标识
+    int32 userDocId =1;   //文档标识
     int64 appId=2;//剑鱼标识
+    string userId=3;//用户标识
 }
 enum UserDocStatus {
     Normal =0;//文件正常
@@ -96,7 +98,7 @@ message userDocs {
 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); //文档转存

+ 82 - 63
rpc/userlib/userlib/userlib.pb.go

@@ -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  int64  `protobuf:"varint,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,19 +352,26 @@ 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() int64 {
 	if x != nil {
 		return x.AppId
 	}
@@ -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     int64  `protobuf:"varint,2,opt,name=appId,proto3" json:"appId,omitempty"`         //剑鱼标识
+	UserId    string `protobuf:"bytes,3,opt,name=userId,proto3" json:"userId,omitempty"`        //用户标识
 }
 
 func (x *UserRecoveryRequest) Reset() {
@@ -734,6 +743,13 @@ func (x *UserRecoveryRequest) GetAppId() int64 {
 	return 0
 }
 
+func (x *UserRecoveryRequest) GetUserId() string {
+	if x != nil {
+		return x.UserId
+	}
+	return ""
+}
+
 type UserDocs struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -932,45 +948,48 @@ var file_userlib_proto_rawDesc = []byte{
 	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,
+	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, 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, 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, 0x03, 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, 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,
@@ -1029,7 +1048,7 @@ var file_userlib_proto_rawDesc = []byte{
 	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,
+	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,
@@ -1074,7 +1093,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 +1106,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 +1156,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 +1287,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 +1320,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 +1369,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 +1386,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 +1443,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 +1455,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 (
+	UserCancelRequest   = userlib.UserCancelRequest
 	UserDeleteResponse  = userlib.UserDeleteResponse
-	UserRecoveryRequest = userlib.UserRecoveryRequest
-	UserCollectRequest  = userlib.UserCollectRequest
-	UserCollectResponse = userlib.UserCollectResponse
-	UserDeleteRequest   = userlib.UserDeleteRequest
-	UserDocsResponse    = userlib.UserDocsResponse
-	UserDocs            = userlib.UserDocs
 	UserRestoreRequest  = userlib.UserRestoreRequest
 	UserRestoreResponse = userlib.UserRestoreResponse
 	UserDocsRequest     = userlib.UserDocsRequest
+	UserDocsResponse    = userlib.UserDocsResponse
+	UserCollectRequest  = userlib.UserCollectRequest
+	UserCollectResponse = userlib.UserCollectResponse
+	UserDocs            = userlib.UserDocs
+	UserRecoveryRequest = userlib.UserRecoveryRequest
 
 	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)
 }

+ 13 - 29
services/userlib/userDocService.go

@@ -84,19 +84,19 @@ func UserDocCollect(userDoc *model.UserDoc, cost int) bool {
 }
 
 //文档取消收藏
-func UserDocCancelCollect(userDocId string) bool {
+func UserDocCancelCollect(docId, userId string,appId int64) 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
 		}
 		//文档取消收藏状态修改
-		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()
@@ -118,7 +118,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 +246,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 int64,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 +275,19 @@ func UserDocDelete(userDocId int32, appId int64) (bool, string) {
 }
 
 //文档回收
-func UserDocRestore(userDocId int32, appId int64) (bool, string) {
+func UserDocRestore(userDocId int32, appId int64,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 +302,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 int64,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 = "删除记录新增失败"

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