package com.qmth.paper.library.common.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: 系统编码枚举类
 * @Author: CaoZixuan
 * @Date: 2021-08-09
 */
public enum SystemCodeEnum {
    CAMPUS_CODE("校区编码","campusCode","campusCode",4),
    COURSE_CODE("课程编码","courseCode","courseCode",4);
    private final String desc;
    private final String code;
    private final String model;
    private final int digit;

    SystemCodeEnum(String desc, String code, String model, int digit) {
        this.desc = desc;
        this.code = code;
        this.model = model;
        this.digit = digit;
    }

    public String getDesc() {
        return desc;
    }

    public String getCode() {
        return code;
    }

    public String getModel() {
        return model;
    }

    public int getDigit() {
        return digit;
    }

    public static List<EnumResult> listTypes() {
        List<EnumResult> list = new ArrayList<>();
        for (SystemCodeEnum value : SystemCodeEnum.values()) {
            EnumResult result = new EnumResult();
            result.setName(value.name());
            result.setOrdinal(value.ordinal());
            result.setCode(value.code);
            result.setDesc(value.getDesc());
            list.add(result);
        }
        return list;
    }
}
