[测评系统]--测评系统核心代码库
吴祝攀
2024-02-29 97a1c1235038d6f72c5f0873a92e99a038c2cd61
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
34
35
36
37
38
39
package com.ots.common.enums;
import lombok.Getter;
import java.util.Objects;
@Getter
public enum ReportTypeEnum {
    Brief("Brief", "简易版"),
    Complete("Complete", "完整版"),
    SAQ("SAQ", "SAQ报告"),
    RuiLin("RuiLin", "睿邻报告"),
    CAQ("CAQ", "CAQ报告"),
    JAQ("JAQ","JAQ报告"),
    MAQ("MAQ", "MAQ报告"),
    MAQV2("MAQV2", "MAQV2报告"),
    PAQ("PAQ", "PAQ报告"),
    MAQIAR("MAQIAR", "MAQIAR报告"),
    MAQTR("MAQTR", "MAQTR报告"),
    CIAQ("CIAQ", "CIAQ报告"),
    VAQ("VAQ", "VAQ报告"),
    LAQ("LAQ", "LAQ报告"),
    API_Fan("API_Fan","API_Fan报告");
    private final String code;
    private final String message;
    ReportTypeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }
    public static ReportTypeEnum codeOf(String code) {
        for (ReportTypeEnum xxxEnum : values()) {
            //MAQIAR特殊处理
            if (code.contains(MAQIAR.code)) {
                return MAQIAR;
            }
            if (Objects.equals(xxxEnum.getCode(), code)) {
                return xxxEnum;
            }
        }
        throw new RuntimeException("The Report is not supported!");
    }
}