|
|
|
@ -76,8 +76,6 @@ func (f *FileService) Compress(args *ZipBlock, reply *string) error { |
|
|
|
taskId <- "upok" |
|
|
|
}() |
|
|
|
|
|
|
|
// 等待上传完成
|
|
|
|
rest := <-taskId |
|
|
|
if strings.EqualFold(strings.ToLower(rest), "upok") { |
|
|
|
logger.Info("上传文件", zap.String("filename", zpFileName), zap.String("path", remotePath)) |
|
|
|
// 解压缩文件,文件存在的文化
|
|
|
|
@ -96,6 +94,9 @@ func (f *FileService) Compress(args *ZipBlock, reply *string) error { |
|
|
|
|
|
|
|
// 客户端调用RPC传送文件的函数
|
|
|
|
// 传入zip的实际路径,远程的服务器带端口,远程文件存放路径
|
|
|
|
// remote 远程主机地址,带端口
|
|
|
|
// filePath 本地文件路径
|
|
|
|
// uploadPath 远程主机的存储路径
|
|
|
|
func clientUploadFile(remote string, filePath string, uploadPath string) { |
|
|
|
fmt.Printf("remote: %s, filePath: %s, uploadPath: %s\n", remote, filePath, uploadPath) |
|
|
|
// 启用日志
|
|
|
|
|