2023-12-22 21:25:16 +00:00
|
|
|
package entity
|
|
|
|
|
|
|
|
type KindBoxReqStatus uint
|
|
|
|
|
|
|
|
const (
|
|
|
|
KindBoxReqPendingStatus KindBoxReqStatus = iota + 1
|
|
|
|
KindBoxReqAcceptedStatus
|
|
|
|
KindBoxReqRejectedStatus
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
kindBoxReqPendingStatusStr = "pending"
|
|
|
|
kindBoxReqAcceptedStatusStr = "accepted"
|
|
|
|
kindBoxReqRejectedStatusStr = "rejected"
|
|
|
|
)
|
|
|
|
|
2024-01-02 14:04:16 +00:00
|
|
|
|
2023-12-22 21:25:16 +00:00
|
|
|
func (s KindBoxReqStatus) String() string {
|
2024-01-02 14:04:16 +00:00
|
|
|
return KindBoxReqStatusStrings[s]
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllKindBoxReqStatus returns a slice containing all string values of KindBoxReqStatus.
|
|
|
|
func AllKindBoxReqStatus() []string {
|
|
|
|
statusStrings := make([]string, len(KindBoxReqStatusStrings))
|
|
|
|
for status, str := range KindBoxReqStatusStrings {
|
|
|
|
statusStrings[int(status)-1] = str
|
2023-12-22 21:25:16 +00:00
|
|
|
}
|
|
|
|
|
2024-01-02 14:04:16 +00:00
|
|
|
return statusStrings
|
2023-12-22 21:25:16 +00:00
|
|
|
}
|
|
|
|
|
2024-01-02 14:04:16 +00:00
|
|
|
// MapToKindBoxReqStatus converts a string to the corresponding KindBoxReqStatus value.
|
2023-12-22 21:25:16 +00:00
|
|
|
func MapToKindBoxReqStatus(statusStr string) KindBoxReqStatus {
|
2024-01-02 14:04:16 +00:00
|
|
|
for status, str := range KindBoxReqStatusStrings {
|
|
|
|
if str == statusStr {
|
|
|
|
return status
|
|
|
|
}
|
2023-12-22 21:25:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return KindBoxReqStatus(0)
|
|
|
|
}
|