1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
func WhichApi(email, api, imgMime, imgName, mainUrl string, fileContent []byte, h *multipart.FileHeader) { var url string switch api { case "Local": showUrl, _, _, _ := server.UpLoadToLocal(imgName, fileContent) url = showUrl case "SouGou": url = server.UpLoadToSouGou(fileContent) case "Sina": if setting.BedSetting.Sina.OpenSinaPicStore == false { url = "" } else { url = server.UpLoadToSina(fileContent, imgMime) } case "Smms": url = server.UploadToSmms(fileContent, imgName) case "CC": durl, _ := server.UploadToCC(fileContent, imgName, imgMime) url = durl case "Flickr": if setting.BedSetting.Flickr.OpenFlickrStore == false { url = "" } else { file, err := h.Open() if err != nil { } url = server.UploadToFlickr(file, h.Filename) } case "Baidu": url = server.UploadToBaidu(fileContent, imgName) case "Qihoo": url = server.UploadToQihoo(fileContent, imgName, imgMime) case "NetEasy": url = server.UploadToNetEasy(fileContent, imgName, imgMime) case "Jd": url = server.UploadToJd(fileContent, imgName, imgMime) case "JueJin": url = server.UploadToJueJin(fileContent, imgName, imgMime) case "Ali": url = server.UploadToAli(fileContent, imgName, imgMime) case "Open": url = server.UpLoadToPublicSina(fileContent, imgName, imgMime) } if url != "" { _ = dao.Insert(api, email, mainUrl, url, imgName, imgMime) }
|