From 5c77e4917f74c8086e4806360f69d4f1679e5db2 Mon Sep 17 00:00:00 2001 From: Love-YeLin <1807209079@qq.com> Date: Tue, 2 Apr 2024 10:44:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8B=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/util/message/message.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/util/message/message.go b/app/util/message/message.go index 6382120..3f96f1a 100644 --- a/app/util/message/message.go +++ b/app/util/message/message.go @@ -1,7 +1,5 @@ package message -import "github.com/CloudStriver/service-idl-gen-go/kitex_gen/cloudmind/content" - type CreateNotificationMessage struct { TargetUserId string SourceUserId string @@ -41,8 +39,8 @@ type DeleteNotificationsMessage struct { } type DeleteFileRelationsMessage struct { - FromType int64 `json:"fromType"` - FromId string `json:"fromId"` - ToType int64 `json:"toType"` - Files []*content.FileParameter `json:"files"` + FromType int64 `json:"fromType"` + FromId string `json:"fromId"` + ToType int64 `json:"toType"` + Files []string `json:"files"` } From 2918db3e6bd4789444af8a85d2249047daff415b Mon Sep 17 00:00:00 2001 From: Love-YeLin <1807209079@qq.com> Date: Tue, 2 Apr 2024 10:56:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8B=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mq/createNotification.go | 3 --- app/mq/deleteFileRelation.go | 5 ++--- go.mod | 2 +- go.sum | 2 ++ 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/mq/createNotification.go b/app/mq/createNotification.go index 5a37614..3fffdc7 100644 --- a/app/mq/createNotification.go +++ b/app/mq/createNotification.go @@ -10,9 +10,6 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -const chanCount = 10 -const bufferCount = 1024 - type CreateNotificationMq struct { ctx context.Context svcCtx *svc.ServiceContext diff --git a/app/mq/deleteFileRelation.go b/app/mq/deleteFileRelation.go index f70b82c..b2ec5b6 100644 --- a/app/mq/deleteFileRelation.go +++ b/app/mq/deleteFileRelation.go @@ -5,7 +5,6 @@ import ( "github.com/CloudStriver/cloudmind-mq/app/svc" "github.com/CloudStriver/cloudmind-mq/app/util/message" "github.com/CloudStriver/go-pkg/utils/pconvertor" - "github.com/CloudStriver/service-idl-gen-go/kitex_gen/cloudmind/content" "github.com/CloudStriver/service-idl-gen-go/kitex_gen/platform/relation" "github.com/bytedance/sonic" "github.com/samber/lo" @@ -32,14 +31,14 @@ func (l *DeleteFileRelationMq) Consume(_, value string) error { return err } - if err := mr.Finish(lo.Map(msg.Files, func(item *content.FileParameter, _ int) func() error { + if err := mr.Finish(lo.Map(msg.Files, func(item string, _ int) func() error { var i int64 for i = 1; i <= l.svcCtx.Config.RelationLength; i++ { _, _ = l.svcCtx.RelationRPC.DeleteRelation(l.ctx, &relation.DeleteRelationReq{ FromType: msg.FromType, FromId: msg.FromId, ToType: msg.ToType, - ToId: item.FileId, + ToId: item, RelationType: i, }) } diff --git a/go.mod b/go.mod index 0931e4f..92f19d2 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/CloudStriver/go-pkg v0.0.0-20240206060942-84060a3dd273 - github.com/CloudStriver/service-idl-gen-go v0.0.0-20240320133349-b226a7105473 + github.com/CloudStriver/service-idl-gen-go v0.0.0-20240402021409-326abc356747 github.com/bytedance/sonic v1.10.2 github.com/samber/lo v1.39.0 github.com/zeromicro/go-queue v1.1.8 diff --git a/go.sum b/go.sum index 964bc27..2d8ae25 100644 --- a/go.sum +++ b/go.sum @@ -393,6 +393,8 @@ github.com/CloudStriver/service-idl-gen-go v0.0.0-20240316123600-5ec7ab682e84 h1 github.com/CloudStriver/service-idl-gen-go v0.0.0-20240316123600-5ec7ab682e84/go.mod h1:chtR82RvfrjUujTGWROSCNAwF9Lh/U959k34bXIDvBI= github.com/CloudStriver/service-idl-gen-go v0.0.0-20240320133349-b226a7105473 h1:DmHH+V9hMFgGcXZSV8n/IW9OvD0ge9AiA+ZE+I73zUo= github.com/CloudStriver/service-idl-gen-go v0.0.0-20240320133349-b226a7105473/go.mod h1:chtR82RvfrjUujTGWROSCNAwF9Lh/U959k34bXIDvBI= +github.com/CloudStriver/service-idl-gen-go v0.0.0-20240402021409-326abc356747 h1:+wHcqO0Mfk7UBKBXl0eD5ctjHTN08WpB71g0F9arBYQ= +github.com/CloudStriver/service-idl-gen-go v0.0.0-20240402021409-326abc356747/go.mod h1:chtR82RvfrjUujTGWROSCNAwF9Lh/U959k34bXIDvBI= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=