|
|
|
@ -57,10 +57,17 @@ func SendZip(w http.ResponseWriter, r *http.Request) { |
|
|
|
} |
|
|
|
// 调用远程方法
|
|
|
|
var reply string |
|
|
|
// var args = Args{"/www/wwwroot/fsc.com", "dir"}
|
|
|
|
err = client.Call("FileRpcService.GetFilePath", zipblock, &reply) |
|
|
|
err = client.Call("FileService.Compress", zipblock, &reply) |
|
|
|
// 执行完成后退出
|
|
|
|
defer client.Close() |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
fmt.Fprintf(w, "jsonrpc call faild %v", err) |
|
|
|
return |
|
|
|
} |
|
|
|
// 输出内容
|
|
|
|
w.Header().Set("Content-Type", "application/json") |
|
|
|
w.Write([]byte(reply)) |
|
|
|
} |
|
|
|
|
|
|
|
// 将文件打包成压缩包
|
|
|
|
|