diff --git a/dctw/v1/api/card/status.go b/dctw/v1/api/card/status.go index a1deb2c..7441873 100644 --- a/dctw/v1/api/card/status.go +++ b/dctw/v1/api/card/status.go @@ -19,6 +19,13 @@ var orderStatusMap = map[OrderStatus]proto.Status{ OrderFail: proto.Status_FAIL, } +var orderStatusTextMap = map[OrderStatus]string{ + OrderSuccess: "充值成功", + OrderPending: "充值处理中", + OrderFail: "充值失败", + OrderAbnormal: "充值异常,处理中", +} + func (o OrderStatus) IsSuccess() bool { return o == OrderSuccess } @@ -41,3 +48,10 @@ func (o OrderStatus) GetOrderStatus() proto.Status { } return proto.Status_ING } + +func (o OrderStatus) GetOrderStatusText() string { + if text, ok := orderStatusTextMap[o]; ok { + return text + } + return "" +} diff --git a/dctw/v1/api/direct/status.go b/dctw/v1/api/direct/status.go index 9a1e0ce..0e10285 100644 --- a/dctw/v1/api/direct/status.go +++ b/dctw/v1/api/direct/status.go @@ -19,6 +19,13 @@ var orderStatusMap = map[OrderStatus]proto.Status{ OrderFail: proto.Status_FAIL, } +var orderStatusTextMap = map[OrderStatus]string{ + OrderSuccess: "充值成功", + OrderPending: "充值处理中", + OrderFail: "充值失败", + OrderAbnormal: "充值异常,处理中", +} + func (o OrderStatus) IsSuccess() bool { return o == OrderSuccess } @@ -41,3 +48,10 @@ func (o OrderStatus) GetOrderStatus() proto.Status { } return proto.Status_ING } + +func (o OrderStatus) GetOrderStatusText() string { + if text, ok := orderStatusTextMap[o]; ok { + return text + } + return "" +}