niki/entity/kind_box_req_status.go

42 lines
898 B
Go
Raw Normal View History

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)
}