fusenapi/utils/s3url_to_s3id/s3url_to_s3id.go
laodaming 45682bbf99 fix
2023-10-20 10:23:11 +08:00

17 lines
273 B
Go

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