Browse Source

调整注册名称

master
xyiege 4 months ago
parent
commit
16dca68187
  1. 11
      aufs/core/sendzip.go
  2. 2
      scagent/main.go

11
aufs/core/sendzip.go

@ -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))
}
// 将文件打包成压缩包

2
scagent/main.go

@ -66,7 +66,7 @@ func main() {
}
// 文件功能,上传下载压缩
err = rpc.RegisterName("FileUploadService", new(core.FileService))
err = rpc.RegisterName("FileService", new(core.FileService))
if err != nil {
logger.Error("Register failed", zap.Error(err))
return

Loading…
Cancel
Save