forked from ebhomengo/niki
42 lines
898 B
Go
42 lines
898 B
Go
package entity
|
|
|
|
type KindBoxReqStatus uint
|
|
|
|
const (
|
|
KindBoxReqPendingStatus KindBoxReqStatus = iota + 1
|
|
KindBoxReqAcceptedStatus
|
|
KindBoxReqRejectedStatus
|
|
)
|
|
|
|
const (
|
|
kindBoxReqPendingStatusStr = "pending"
|
|
kindBoxReqAcceptedStatusStr = "accepted"
|
|
kindBoxReqRejectedStatusStr = "rejected"
|
|
)
|
|
|
|
func (s KindBoxReqStatus) String() string {
|
|
switch s {
|
|
case KindBoxReqPendingStatus:
|
|
return kindBoxReqPendingStatusStr
|
|
case KindBoxReqAcceptedStatus:
|
|
return kindBoxReqAcceptedStatusStr
|
|
case KindBoxReqRejectedStatus:
|
|
return kindBoxReqRejectedStatusStr
|
|
}
|
|
|
|
return ""
|
|
}
|
|
|
|
func MapToKindBoxReqStatus(statusStr string) KindBoxReqStatus {
|
|
switch statusStr {
|
|
case kindBoxReqPendingStatusStr:
|
|
return KindBoxReqPendingStatus
|
|
case kindBoxReqAcceptedStatusStr:
|
|
return KindBoxReqAcceptedStatus
|
|
case kindBoxReqRejectedStatusStr:
|
|
return KindBoxReqRejectedStatus
|
|
}
|
|
|
|
return KindBoxReqStatus(0)
|
|
}
|