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"`