Files
assets/consts/procurement/process_method.go

48 lines
1.0 KiB
Go
Raw Normal View History

2026-03-18 10:18:03 +08:00
package consts
// ProcessMethod 处理方式枚举
type ProcessMethod int
const (
ProcessMethodRefund ProcessMethod = 1 // 退款
ProcessMethodReplace ProcessMethod = 2 // 更换
ProcessMethodRepair ProcessMethod = 3 // 维修
)
// GetAllProcessMethods 获取所有处理方式
func GetAllProcessMethods() []ProcessMethod {
return []ProcessMethod{
ProcessMethodRefund,
ProcessMethodReplace,
ProcessMethodRepair,
}
}
// String 获取处理方式字符串表示
func (p ProcessMethod) String() string {
switch p {
case ProcessMethodRefund:
return "退款"
case ProcessMethodReplace:
return "更换"
case ProcessMethodRepair:
return "维修"
default:
return "未知"
}
}
type ProcessMethodKeyValue struct {
Key int `json:"key"`
Value string `json:"value"`
}
// GetAllProcessMethodKeyValue 获取所有处理方式的键值对
func GetAllProcessMethodKeyValue() []ProcessMethodKeyValue {
return []ProcessMethodKeyValue{
{Key: 1, Value: "退款"},
{Key: 2, Value: "更换"},
{Key: 3, Value: "维修"},
}
}