mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-09 11:35:59 +08:00
move Place
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
package utils
|
||||
|
||||
// fixme 1<--->IOS 2<--->Android 3<--->Windows
|
||||
//fixme 4<--->OSX 5<--->Web 6<--->MiniWeb 7<--->Linux
|
||||
|
||||
const (
|
||||
//Platform ID
|
||||
IOSPlatformID = 1
|
||||
AndroidPlatformID = 2
|
||||
WindowsPlatformID = 3
|
||||
OSXPlatformID = 4
|
||||
WebPlatformID = 5
|
||||
MiniWebPlatformID = 6
|
||||
LinuxPlatformID = 7
|
||||
|
||||
//Platform string match to Platform ID
|
||||
IOSPlatformStr = "IOS"
|
||||
AndroidPlatformStr = "Android"
|
||||
WindowsPlatformStr = "Windows"
|
||||
OSXPlatformStr = "OSX"
|
||||
WebPlatformStr = "Web"
|
||||
MiniWebPlatformStr = "MiniWeb"
|
||||
LinuxPlatformStr = "Linux"
|
||||
|
||||
//terminal types
|
||||
TerminalPC = "PC"
|
||||
TerminalMobile = "Mobile"
|
||||
)
|
||||
|
||||
var PlatformID2Name = map[int32]string{
|
||||
IOSPlatformID: IOSPlatformStr,
|
||||
AndroidPlatformID: AndroidPlatformStr,
|
||||
WindowsPlatformID: WindowsPlatformStr,
|
||||
OSXPlatformID: OSXPlatformStr,
|
||||
WebPlatformID: WebPlatformStr,
|
||||
MiniWebPlatformID: MiniWebPlatformStr,
|
||||
LinuxPlatformID: LinuxPlatformStr,
|
||||
}
|
||||
var PlatformName2ID = map[string]int32{
|
||||
IOSPlatformStr: IOSPlatformID,
|
||||
AndroidPlatformStr: AndroidPlatformID,
|
||||
WindowsPlatformStr: WindowsPlatformID,
|
||||
OSXPlatformStr: OSXPlatformID,
|
||||
WebPlatformStr: WebPlatformID,
|
||||
MiniWebPlatformStr: MiniWebPlatformID,
|
||||
LinuxPlatformStr: LinuxPlatformID,
|
||||
}
|
||||
var Platform2class = map[string]string{
|
||||
IOSPlatformStr: TerminalMobile,
|
||||
AndroidPlatformStr: TerminalMobile,
|
||||
MiniWebPlatformStr: TerminalMobile,
|
||||
WindowsPlatformStr: TerminalPC,
|
||||
OSXPlatformStr: TerminalPC,
|
||||
WebPlatformStr: TerminalPC,
|
||||
LinuxPlatformStr: TerminalPC,
|
||||
}
|
||||
|
||||
func PlatformIDToName(num int32) string {
|
||||
return PlatformID2Name[num]
|
||||
}
|
||||
func PlatformNameToID(name string) int32 {
|
||||
return PlatformName2ID[name]
|
||||
}
|
||||
func PlatformNameToClass(name string) string {
|
||||
return Platform2class[name]
|
||||
}
|
||||
Reference in New Issue
Block a user