You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.2 KiB
79 lines
2.2 KiB
3 years ago
|
package constant
|
||
4 years ago
|
|
||
|
// fixme 1<--->IOS 2<--->Android 3<--->Windows
|
||
|
//fixme 4<--->OSX 5<--->Web 6<--->MiniWeb 7<--->Linux
|
||
|
|
||
|
const (
|
||
|
//Platform ID
|
||
2 years ago
|
IOSPlatformID = 1
|
||
|
AndroidPlatformID = 2
|
||
|
WindowsPlatformID = 3
|
||
|
OSXPlatformID = 4
|
||
|
WebPlatformID = 5
|
||
|
MiniWebPlatformID = 6
|
||
|
LinuxPlatformID = 7
|
||
|
AndroidPadPlatformID = 8
|
||
|
IPadPlatformID = 9
|
||
2 years ago
|
AdminPlatformID = 10
|
||
4 years ago
|
|
||
|
//Platform string match to Platform ID
|
||
2 years ago
|
IOSPlatformStr = "IOS"
|
||
|
AndroidPlatformStr = "Android"
|
||
|
WindowsPlatformStr = "Windows"
|
||
|
OSXPlatformStr = "OSX"
|
||
|
WebPlatformStr = "Web"
|
||
|
MiniWebPlatformStr = "MiniWeb"
|
||
|
LinuxPlatformStr = "Linux"
|
||
|
AndroidPadPlatformStr = "APad"
|
||
|
IPadPlatformStr = "IPad"
|
||
2 years ago
|
AdminPlatformStr = "Admin"
|
||
4 years ago
|
|
||
|
//terminal types
|
||
|
TerminalPC = "PC"
|
||
|
TerminalMobile = "Mobile"
|
||
|
)
|
||
|
|
||
3 years ago
|
var PlatformID2Name = map[int]string{
|
||
2 years ago
|
IOSPlatformID: IOSPlatformStr,
|
||
|
AndroidPlatformID: AndroidPlatformStr,
|
||
|
WindowsPlatformID: WindowsPlatformStr,
|
||
|
OSXPlatformID: OSXPlatformStr,
|
||
|
WebPlatformID: WebPlatformStr,
|
||
|
MiniWebPlatformID: MiniWebPlatformStr,
|
||
|
LinuxPlatformID: LinuxPlatformStr,
|
||
|
AndroidPadPlatformID: AndroidPadPlatformStr,
|
||
|
IPadPlatformID: IPadPlatformStr,
|
||
2 years ago
|
AdminPlatformID: AdminPlatformStr,
|
||
4 years ago
|
}
|
||
3 years ago
|
var PlatformName2ID = map[string]int{
|
||
2 years ago
|
IOSPlatformStr: IOSPlatformID,
|
||
|
AndroidPlatformStr: AndroidPlatformID,
|
||
|
WindowsPlatformStr: WindowsPlatformID,
|
||
|
OSXPlatformStr: OSXPlatformID,
|
||
|
WebPlatformStr: WebPlatformID,
|
||
|
MiniWebPlatformStr: MiniWebPlatformID,
|
||
|
LinuxPlatformStr: LinuxPlatformID,
|
||
|
AndroidPadPlatformStr: AndroidPadPlatformID,
|
||
|
IPadPlatformStr: IPadPlatformID,
|
||
2 years ago
|
AdminPlatformStr: AdminPlatformID,
|
||
4 years ago
|
}
|
||
|
var Platform2class = map[string]string{
|
||
|
IOSPlatformStr: TerminalMobile,
|
||
|
AndroidPlatformStr: TerminalMobile,
|
||
3 years ago
|
MiniWebPlatformStr: WebPlatformStr,
|
||
|
WebPlatformStr: WebPlatformStr,
|
||
4 years ago
|
WindowsPlatformStr: TerminalPC,
|
||
|
OSXPlatformStr: TerminalPC,
|
||
|
LinuxPlatformStr: TerminalPC,
|
||
|
}
|
||
|
|
||
3 years ago
|
func PlatformIDToName(num int) string {
|
||
4 years ago
|
return PlatformID2Name[num]
|
||
|
}
|
||
3 years ago
|
func PlatformNameToID(name string) int {
|
||
4 years ago
|
return PlatformName2ID[name]
|
||
|
}
|
||
|
func PlatformNameToClass(name string) string {
|
||
|
return Platform2class[name]
|
||
|
}
|