2023-09-06 06:35:42 +00:00
|
|
|
package s3url_to_s3id
|
|
|
|
|
|
|
|
import "strings"
|
|
|
|
|
|
|
|
// 通过url解析资源id
|
|
|
|
func GetS3ResourceIdFormUrl(s3Url string) string {
|
2023-10-20 02:23:11 +00:00
|
|
|
if !strings.Contains(s3Url, "fusen") {
|
2023-09-06 06:35:42 +00:00
|
|
|
return ""
|
|
|
|
}
|
|
|
|
s := strings.Split(s3Url, "/")
|
|
|
|
lens := len(s)
|
|
|
|
if lens <= 1 {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
return s[lens-1]
|
|
|
|
}
|