diff --git a/aufs/core/sendzip.go b/aufs/core/sendzip.go index d88bfcc..49c44a7 100644 --- a/aufs/core/sendzip.go +++ b/aufs/core/sendzip.go @@ -12,9 +12,20 @@ import ( "time" ) -// 将文件打包成压缩包 +// 远程调用压缩包 func SendZip(w http.ResponseWriter, r *http.Request) { r.ParseForm() + + // 文件 + zipfarr := r.Form["sfiles"] + + // 服务器ip地址 + serip := r.Form["serverip"] +} + +// 将文件打包成压缩包 +func SendZip00(w http.ResponseWriter, r *http.Request) { + r.ParseForm() // 选择文件,并生成zip包 // 文件 zipfarr := r.Form["sfiles"] diff --git a/scagent/core/FileRpc.go b/scagent/core/FileRpc.go index ef40086..3f1fd41 100644 --- a/scagent/core/FileRpc.go +++ b/scagent/core/FileRpc.go @@ -9,6 +9,8 @@ import ( "scagent/util" "strings" "time" + + "go.uber.org/zap" ) // FileService 提供文件传输服务 @@ -54,6 +56,9 @@ func (f *FileService) Upload(chunk FileChunk, reply *bool) error { // 压缩文件 // 返回压缩包的名称 func (f *FileService) Compress(args *ZipBlock, reply *string) error { + // 启用日志 + logger := util.NewProductionLogger() + defer logger.Sync() // 实际路径 realFilePath := filepath.Join(config.G.FilePath, args.Curpath) // zip 文件名 @@ -64,7 +69,8 @@ func (f *FileService) Compress(args *ZipBlock, reply *string) error { go func() { util.CompressToZip(zpFileName, realFilePath, args.SelFile) taskId <- "arcok" - // fmt.Fprintln(w, "create archive:", err) + // 日志输出 + logger.Info("压缩文件", zap.String("filename", zpFileName), zap.String("path", realFilePath)) }() // ZIP 文件的实际路径 ziprl := path.Join("./sync_zips/", zpFileName)