mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-05 01:25:58 +08:00
cache
This commit is contained in:
@@ -2,6 +2,7 @@ package utils
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"os"
|
||||
@@ -37,3 +38,33 @@ func GetNewFileNameAndContentType(fileName string, fileType int) (string, string
|
||||
}
|
||||
return newName, contentType
|
||||
}
|
||||
|
||||
func GetUploadAppNewName(appType int, version string) (string, string, error) {
|
||||
var newFileName, newYamlName = version + "_app_", version + "_yaml_"
|
||||
switch appType {
|
||||
case constant.IOSPlatformID:
|
||||
newFileName += constant.IOSPlatformStr
|
||||
newYamlName += constant.IOSPlatformStr
|
||||
case constant.AndroidPlatformID:
|
||||
newFileName += constant.AndroidPlatformStr
|
||||
newYamlName += constant.AndroidPlatformStr
|
||||
case constant.WindowsPlatformID:
|
||||
newFileName += constant.WindowsPlatformStr
|
||||
newYamlName += constant.WindowsPlatformStr
|
||||
case constant.OSXPlatformID:
|
||||
newFileName += constant.OSXPlatformStr
|
||||
newYamlName += constant.OSXPlatformStr
|
||||
case constant.WebPlatformID:
|
||||
newFileName += constant.WebPlatformStr
|
||||
newYamlName += constant.WebPlatformStr
|
||||
case constant.MiniWebPlatformID:
|
||||
newFileName += constant.MiniWebPlatformStr
|
||||
newYamlName += constant.MiniWebPlatformStr
|
||||
case constant.LinuxPlatformID:
|
||||
newFileName += constant.LinuxPlatformStr
|
||||
newYamlName += constant.LinuxPlatformStr
|
||||
default:
|
||||
return "", "", errors.New("invalid app type")
|
||||
}
|
||||
return newFileName, newYamlName, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user