From 98059e6994771939db6e23c4e2a8550ba32856c0 Mon Sep 17 00:00:00 2001 From: panlei <2799247126@qq.com> Date: 星期二, 05 十一月 2019 15:36:56 +0800 Subject: [PATCH] ... --- WeedFSClient.go | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/WeedFSClient.go b/WeedFSClient.go index e410575..7c662b5 100644 --- a/WeedFSClient.go +++ b/WeedFSClient.go @@ -8,6 +8,7 @@ "io" "mime/multipart" "net/http" + "github.com/kirinlabs/HttpRequest" "time" ) @@ -64,4 +65,19 @@ filePath := m["fileUrl"].(string) return filePath,nil } +} + +// 鑾峰緱涓�涓猣id + +func GetFid(url string)(weedPath string ,err error) { + res,err := HttpRequest.NewRequest().Post(url) + if err != nil { + fmt.Println("缃戠粶浼犺緭閿欒锛�") + } + var m map[string]interface{} + err = res.Json(&m) + if err != nil { + return "",err + } + return "http://"+m["url"].(string)+"/"+m["fid"].(string),err } \ No newline at end of file -- Gitblit v1.8.0