This commit is contained in:
laodaming
2023-09-06 14:35:42 +08:00
parent 310c3af9dc
commit 13d91699f0
7 changed files with 60 additions and 61 deletions

View File

@@ -0,0 +1,16 @@
package s3url_to_s3id
import "strings"
// 通过url解析资源id
func GetS3ResourceIdFormUrl(s3Url string) string {
if !strings.Contains(s3Url, "http") {
return ""
}
s := strings.Split(s3Url, "/")
lens := len(s)
if lens <= 1 {
return ""
}
return s[lens-1]
}