2 Star 0 Fork 0

huangjsshinedone / midjourney-apiserve

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
file_name.go 454 Bytes
一键复制 编辑 原始数据 按行查看 历史
huangjs 提交于 2024-01-06 09:43 . first
package util
import (
"fmt"
"path/filepath"
"strings"
)
func UrlToFileName(url string) string {
// 提取URL路径部分
path := filepath.Base(url)
// 去除查询参数部分
path = strings.Split(path, "?")[0]
fmt.Println(path)
// 提取文件名部分
return strings.TrimSuffix(path, filepath.Ext(path))
}
func PathToFileName(filename string) string {
extension := filepath.Ext(filename)
return filename[:len(filename)-len(extension)]
}
1
https://gitee.com/huangjsshinedone/midjourney-apiserve.git
git@gitee.com:huangjsshinedone/midjourney-apiserve.git
huangjsshinedone
midjourney-apiserve
midjourney-apiserve
v0.0.8

搜索帮助

53164aa7 5694891 3bd8fe86 5694891