39 lines
789 B
Go
39 lines
789 B
Go
package vo
|
|
|
|
type OrderNotifyStatus uint8
|
|
|
|
const (
|
|
OrderNotifyStatusWait OrderNotifyStatus = iota + 1
|
|
OrderNotifyStatusSuccess
|
|
OrderNotifyStatusFail
|
|
)
|
|
|
|
var OrderNotifyStatusMap = map[OrderNotifyStatus]string{
|
|
OrderNotifyStatusWait: "待请求",
|
|
OrderNotifyStatusSuccess: "请求成功",
|
|
OrderNotifyStatusFail: "请求失败",
|
|
}
|
|
|
|
func (s OrderNotifyStatus) GetText() string {
|
|
if t, ok := OrderNotifyStatusMap[s]; ok {
|
|
return t
|
|
}
|
|
return "未知请求状态"
|
|
}
|
|
|
|
func (s OrderNotifyStatus) GetValue() uint8 {
|
|
return uint8(s)
|
|
}
|
|
|
|
func (s OrderNotifyStatus) IsWait() bool {
|
|
return s == OrderNotifyStatusWait
|
|
}
|
|
|
|
func (s OrderNotifyStatus) IsSuccess() bool {
|
|
return s == OrderNotifyStatusSuccess
|
|
}
|
|
|
|
func (s OrderNotifyStatus) IsFail() bool {
|
|
return s == OrderNotifyStatusFail
|
|
}
|