From 1fd2de5a645ed8740805f70e25ba5a72a058704a Mon Sep 17 00:00:00 2001 From: begoniezhao Date: Wed, 5 Nov 2025 12:20:21 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0proto=E5=8F=8A?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E5=AF=BC=E5=85=A5=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4Docker=E6=9E=84=E5=BB=BA=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 3 +++ docreader/client/client.go | 8 +++----- docreader/client/client_test.go | 2 +- internal/application/service/knowledge.go | 4 ++-- internal/container/container.go | 2 +- internal/handler/initialization.go | 4 ++-- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index fba612f3..8999a924 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,9 @@ services: app: image: wechatopenai/weknora-app:latest + build: + context: . + dockerfile: docker/Dockerfile.app container_name: WeKnora-app ports: - "${APP_PORT:-8080}:8080" diff --git a/docreader/client/client.go b/docreader/client/client.go index ee742466..bba854a9 100644 --- a/docreader/client/client.go +++ b/docreader/client/client.go @@ -6,7 +6,7 @@ import ( "os" "time" - "github.com/Tencent/WeKnora/services/docreader/src/proto" + "github.com/Tencent/WeKnora/docreader/proto" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/resolver" @@ -16,10 +16,8 @@ const ( maxMessageSize = 50 * 1024 * 1024 // 50MB ) -var ( - // Logger is the default logger used by the client - Logger = log.New(os.Stdout, "[DocReader] ", log.LstdFlags|log.Lmicroseconds) -) +// Logger is the default logger used by the client +var Logger = log.New(os.Stdout, "[DocReader] ", log.LstdFlags|log.Lmicroseconds) // ImageInfo 表示一个图片的信息 type ImageInfo struct { diff --git a/docreader/client/client_test.go b/docreader/client/client_test.go index 5551048e..0a1e618a 100644 --- a/docreader/client/client_test.go +++ b/docreader/client/client_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/Tencent/WeKnora/services/docreader/src/proto" + "github.com/Tencent/WeKnora/docreader/proto" ) func init() { diff --git a/internal/application/service/knowledge.go b/internal/application/service/knowledge.go index 414ecc57..911ce961 100644 --- a/internal/application/service/knowledge.go +++ b/internal/application/service/knowledge.go @@ -16,6 +16,8 @@ import ( "strings" "time" + "github.com/Tencent/WeKnora/docreader/client" + "github.com/Tencent/WeKnora/docreader/proto" "github.com/Tencent/WeKnora/internal/application/service/retriever" "github.com/Tencent/WeKnora/internal/config" werrors "github.com/Tencent/WeKnora/internal/errors" @@ -26,8 +28,6 @@ import ( "github.com/Tencent/WeKnora/internal/types" "github.com/Tencent/WeKnora/internal/types/interfaces" secutils "github.com/Tencent/WeKnora/internal/utils" - "github.com/Tencent/WeKnora/services/docreader/src/client" - "github.com/Tencent/WeKnora/services/docreader/src/proto" "github.com/google/uuid" "github.com/hibiken/asynq" "go.opentelemetry.io/otel/attribute" diff --git a/internal/container/container.go b/internal/container/container.go index 4a686e66..21590536 100644 --- a/internal/container/container.go +++ b/internal/container/container.go @@ -20,6 +20,7 @@ import ( "gorm.io/driver/postgres" "gorm.io/gorm" + "github.com/Tencent/WeKnora/docreader/client" "github.com/Tencent/WeKnora/internal/application/repository" elasticsearchRepoV7 "github.com/Tencent/WeKnora/internal/application/repository/retriever/elasticsearch/v7" elasticsearchRepoV8 "github.com/Tencent/WeKnora/internal/application/repository/retriever/elasticsearch/v8" @@ -39,7 +40,6 @@ import ( "github.com/Tencent/WeKnora/internal/tracing" "github.com/Tencent/WeKnora/internal/types" "github.com/Tencent/WeKnora/internal/types/interfaces" - "github.com/Tencent/WeKnora/services/docreader/src/client" ) // BuildContainer constructs the dependency injection container diff --git a/internal/handler/initialization.go b/internal/handler/initialization.go index e82a0d92..083676b9 100644 --- a/internal/handler/initialization.go +++ b/internal/handler/initialization.go @@ -13,6 +13,8 @@ import ( "sync" "time" + "github.com/Tencent/WeKnora/docreader/client" + "github.com/Tencent/WeKnora/docreader/proto" chatpipline "github.com/Tencent/WeKnora/internal/application/service/chat_pipline" "github.com/Tencent/WeKnora/internal/config" "github.com/Tencent/WeKnora/internal/errors" @@ -23,8 +25,6 @@ import ( "github.com/Tencent/WeKnora/internal/models/utils/ollama" "github.com/Tencent/WeKnora/internal/types" "github.com/Tencent/WeKnora/internal/types/interfaces" - "github.com/Tencent/WeKnora/services/docreader/src/client" - "github.com/Tencent/WeKnora/services/docreader/src/proto" "github.com/gin-gonic/gin" "github.com/google/uuid" "github.com/ollama/ollama/api"