mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-24 11:28:40 +08:00
16 lines
286 B
Go
16 lines
286 B
Go
package oss
|
|
|
|
import (
|
|
"path"
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
func BuildName(fileName, fileType string) (string, error) {
|
|
t := time.Now().Format("20060102")
|
|
newUUID, _ := uuid.NewUUID()
|
|
ext := path.Ext(fileName)
|
|
return t + "/" + fileType + "/" + newUUID.String() + ext, nil
|
|
}
|