|
|
|
@ -157,10 +157,19 @@ func transferFile(c *UpFileClient, curPath string, uploadPath string) error { |
|
|
|
progress := float64(offset) / float64(fileInfo.Size()) * 100 |
|
|
|
fmt.Printf("\r发送进度: %.2f%%", progress) |
|
|
|
} |
|
|
|
|
|
|
|
// 远程调用解压缩
|
|
|
|
|
|
|
|
fmt.Println("\n文件发送完成!") |
|
|
|
// 文件解压缩
|
|
|
|
distFullName := filepath.Join(dirPath, fileName) |
|
|
|
// 此时调用远程的完整路径,防止解压缩不成功
|
|
|
|
c.rpcClient.Call("UpFileService.UnzipArchive", FileInfo{ |
|
|
|
FileName: distFullName, |
|
|
|
FileSize: fileInfo.Size(), |
|
|
|
}, &reply) |
|
|
|
// 输出执行的结果
|
|
|
|
if reply != "true" { |
|
|
|
logger.Error("UnzipArchive failed", zap.String("reply", reply)) |
|
|
|
} |
|
|
|
fmt.Printf("UnzipArchive success, reply: %s\n", reply) |
|
|
|
|
|
|
|
// }()
|
|
|
|
|
|
|
|
|