From 0702bbda0d05f240998731b2588d46bc598afe73 Mon Sep 17 00:00:00 2001 From: wangjian Date: Tue, 4 Apr 2023 18:22:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=98=E5=82=A8=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.go | 1 + config/config.yaml | 1 + global/global.go | 1 + mq/instruction.go | 1 + 4 files changed, 4 insertions(+) diff --git a/config/config.go b/config/config.go index cefbe6c..43159ae 100644 --- a/config/config.go +++ b/config/config.go @@ -11,6 +11,7 @@ type FolderMonitorConfig struct { Name string `yaml:"name" json:"name" toml:"name"` MonitorPath string `json:"monitorPath" yaml:"monitorPath" toml:"monitorPath"` TempPath string `json:"tempPath" yaml:"tempPath" toml:"tempPath"` + DataType int `json:"dataType" yaml:"dataType" toml:"dataType"` //1:数据集;2:病害库 DatasetId int `yaml:"datasetId" json:"datasetId" toml:"datasetId"` Logging LogOptions `yaml:"logging" json:"logging" tom:"logging"` Node HpdsNode `yaml:"node,omitempty" json:"node,omitempty" toml:"node,omitempty"` diff --git a/config/config.yaml b/config/config.yaml index 2746b68..d5b9d57 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -2,6 +2,7 @@ name: "folder_monitoring" monitorPath: "./src/" tempPath: "./tmp/" datasetId: 1 +dataType: 1 node: host: 127.0.0.1 port: 27188 diff --git a/global/global.go b/global/global.go index 379262f..9dcc77f 100644 --- a/global/global.go +++ b/global/global.go @@ -188,6 +188,7 @@ func transferData(list *arraylist.List) { FileName: filepath.Base(fileName), FilePath: strings.Replace(FileHistoryMap[fileName].FilePath, Cfg.MonitorPath, "", -1), DatasetId: Cfg.DatasetId, + DataType: Cfg.DataType, FileSize: len(src), File: base64.StdEncoding.EncodeToString(dstContent), IsCompress: true, diff --git a/mq/instruction.go b/mq/instruction.go index be8cade..2b48b87 100644 --- a/mq/instruction.go +++ b/mq/instruction.go @@ -12,6 +12,7 @@ type InstructionReq struct { type FileTransferInfo struct { FileName string `json:"fileName"` FilePath string `json:"filePath"` + DataType int `json:"dataType"` DatasetId int `json:"datasetId"` FileSize int `json:"fileSize"` File string `json:"file"`