zepengdev
2025-06-14 6e0a83c55db4bae4d23a4c281946bda1d610f678
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.oying.modules.pc.product.domain.enums;
 
import lombok.Getter;
 
@Getter
public enum ProductStatusEnum {
 
    DRAFT(1000, "创建中"),
    PENDING(1001, "待审核"),
    UNDER_REVIEW(1002, "审核中"),
    REJECTED(1003, "拒绝"),
    APPROVED(1004, "同意"),
    AVAILABLE(2100, "在售"),
    NO_AVAILABLE(2101, "停售"),
    BANNED(3000, "禁止售卖");
 
    private final Integer value;
    private final String reasonPhrase;
 
    ProductStatusEnum(int value, String reasonPhrase) {
        this.value = value;
        this.reasonPhrase = reasonPhrase;
    }
 
    public static ProductStatusEnum get(Integer code) {
        for (ProductStatusEnum value : values()) {
            if (value.value.equals(code)) {
                return value;
            }
        }
        return null;
    }
}