UPDATE: Historian module
All checks were successful
Build and Release / release (push) Successful in 1m20s
All checks were successful
Build and Release / release (push) Successful in 1m20s
This commit is contained in:
@@ -3,6 +3,7 @@ package constants
|
||||
type StatusType int16
|
||||
|
||||
const (
|
||||
StatusUnknown StatusType = 0
|
||||
StatusPending StatusType = 1
|
||||
StatusApproved StatusType = 2
|
||||
StatusRejected StatusType = 3
|
||||
@@ -21,6 +22,10 @@ func (t StatusType) String() string {
|
||||
}
|
||||
}
|
||||
|
||||
func (t StatusType) Int16() int16 {
|
||||
return int16(t)
|
||||
}
|
||||
|
||||
func ParseStatusType(v int16) StatusType {
|
||||
switch v {
|
||||
case 1:
|
||||
@@ -30,6 +35,19 @@ func ParseStatusType(v int16) StatusType {
|
||||
case 3:
|
||||
return StatusRejected
|
||||
default:
|
||||
return 0
|
||||
return StatusUnknown
|
||||
}
|
||||
}
|
||||
|
||||
func ParseStatusTypeText(v string) StatusType {
|
||||
switch v {
|
||||
case "PENDING":
|
||||
return StatusPending
|
||||
case "APPROVED":
|
||||
return StatusApproved
|
||||
case "REJECT":
|
||||
return StatusRejected
|
||||
default:
|
||||
return StatusUnknown
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user