45 lines
774 B
Go
45 lines
774 B
Go
package vo
|
|
|
|
type OrderStatus uint8
|
|
|
|
const (
|
|
OrderStatusWait OrderStatus = iota + 1
|
|
OrderStatusIng
|
|
OrderStatusSuccess
|
|
OrderStatusFail
|
|
)
|
|
|
|
var OrderStatusMap = map[OrderStatus]string{
|
|
OrderStatusWait: "待发放",
|
|
OrderStatusIng: "发放中",
|
|
OrderStatusSuccess: "发放成功",
|
|
OrderStatusFail: "发放失败",
|
|
}
|
|
|
|
func (s OrderStatus) GetText() string {
|
|
if t, ok := OrderStatusMap[s]; ok {
|
|
return t
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (s OrderStatus) GetValue() uint8 {
|
|
return uint8(s)
|
|
}
|
|
|
|
func (s OrderStatus) IsWait() bool {
|
|
return s == OrderStatusWait
|
|
}
|
|
|
|
func (s OrderStatus) IsIng() bool {
|
|
return s == OrderStatusIng
|
|
}
|
|
|
|
func (s OrderStatus) IsSuccess() bool {
|
|
return s == OrderStatusSuccess
|
|
}
|
|
|
|
func (s OrderStatus) IsFail() bool {
|
|
return s == OrderStatusFail
|
|
}
|