卡密,直充,订单结果msg处理

This commit is contained in:
李子铭 2024-11-15 15:03:52 +08:00
parent fe8e56420f
commit 50ab391039
2 changed files with 28 additions and 0 deletions

View File

@ -19,6 +19,13 @@ var orderStatusMap = map[OrderStatus]proto.Status{
OrderFail: proto.Status_FAIL, OrderFail: proto.Status_FAIL,
} }
var orderStatusTextMap = map[OrderStatus]string{
OrderSuccess: "充值成功",
OrderPending: "充值处理中",
OrderFail: "充值失败",
OrderAbnormal: "充值异常,处理中",
}
func (o OrderStatus) IsSuccess() bool { func (o OrderStatus) IsSuccess() bool {
return o == OrderSuccess return o == OrderSuccess
} }
@ -41,3 +48,10 @@ func (o OrderStatus) GetOrderStatus() proto.Status {
} }
return proto.Status_ING return proto.Status_ING
} }
func (o OrderStatus) GetOrderStatusText() string {
if text, ok := orderStatusTextMap[o]; ok {
return text
}
return ""
}

View File

@ -19,6 +19,13 @@ var orderStatusMap = map[OrderStatus]proto.Status{
OrderFail: proto.Status_FAIL, OrderFail: proto.Status_FAIL,
} }
var orderStatusTextMap = map[OrderStatus]string{
OrderSuccess: "充值成功",
OrderPending: "充值处理中",
OrderFail: "充值失败",
OrderAbnormal: "充值异常,处理中",
}
func (o OrderStatus) IsSuccess() bool { func (o OrderStatus) IsSuccess() bool {
return o == OrderSuccess return o == OrderSuccess
} }
@ -41,3 +48,10 @@ func (o OrderStatus) GetOrderStatus() proto.Status {
} }
return proto.Status_ING return proto.Status_ING
} }
func (o OrderStatus) GetOrderStatusText() string {
if text, ok := orderStatusTextMap[o]; ok {
return text
}
return ""
}