39 lines
874 B
Go
39 lines
874 B
Go
package vo
|
|
|
|
type WechatVoucherStatus string
|
|
|
|
const (
|
|
WechatVoucherStatusSended WechatVoucherStatus = "SENDED"
|
|
WechatVoucherStatusUsed WechatVoucherStatus = "USED"
|
|
WechatVoucherStatusExpired WechatVoucherStatus = "EXPIRED"
|
|
)
|
|
|
|
var VoucherStatusMap = map[WechatVoucherStatus]string{
|
|
WechatVoucherStatusSended: "可用",
|
|
WechatVoucherStatusUsed: "已实扣",
|
|
WechatVoucherStatusExpired: "已过期",
|
|
}
|
|
|
|
func (s WechatVoucherStatus) GetText() string {
|
|
if t, ok := VoucherStatusMap[s]; ok {
|
|
return t
|
|
}
|
|
return "未知类型"
|
|
}
|
|
|
|
func (s WechatVoucherStatus) GetValue() string {
|
|
return string(s)
|
|
}
|
|
|
|
func (s WechatVoucherStatus) IsSended() bool {
|
|
return s == WechatVoucherStatusSended
|
|
}
|
|
|
|
func (s WechatVoucherStatus) IsUsed() bool {
|
|
return s == WechatVoucherStatusUsed
|
|
}
|
|
|
|
func (s WechatVoucherStatus) IsExpired() bool {
|
|
return s == WechatVoucherStatusExpired
|
|
}
|