|
|
@ -1,6 +1,7 @@ |
|
|
package core |
|
|
package core |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
|
|
|
"encoding/json" |
|
|
"os" |
|
|
"os" |
|
|
"path/filepath" |
|
|
"path/filepath" |
|
|
"scagnet/util" |
|
|
"scagnet/util" |
|
|
@ -71,5 +72,13 @@ func (f *FileRpc) GetFilePath(args *Args, replay *Reply) error { |
|
|
flplist.Flist = append(flplist.Flist, FloopJson{Path: file, Size: d.Size(), Hash: hash}) |
|
|
flplist.Flist = append(flplist.Flist, FloopJson{Path: file, Size: d.Size(), Hash: hash}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 将文件列表转换为json字符串
|
|
|
|
|
|
jsonStr, err := json.Marshal(flplist) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
logger.Error("转换为json字符串出错", zap.Error(err)) |
|
|
|
|
|
return err |
|
|
|
|
|
} |
|
|
|
|
|
replay.FilePath = string(jsonStr) |
|
|
|
|
|
|
|
|
return nil |
|
|
return nil |
|
|
} |
|
|
} |
|
|
|