package com.yeejoin.amos.boot.module.common.api.enums;

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;

public enum FailureStatuEnum {

        WAITING_AUDIT(0,"待审核"),
        WAITING_SUBMIT(1,"待提交"),
        WAITING_MAINTAIN(2,"待维修"),
        WAITING_ACCEPTANCE(3,"待验收"),
        REFUSE(4,"已拒绝"),
        FINISH(5,"已完结"),
        IN_MAINTENANCE(6,"维修中");

        private FailureStatuEnum(Integer code, String name){
            this.code=code;
            this.name=name;
        }

        private Integer code;

        private String name;

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

    public static List<HashMap<String,String>> getEnumList() {
        List<HashMap<String, String>> list = new ArrayList<>();
        for (FailureStatuEnum testEnum : EnumSet.allOf(FailureStatuEnum.class)) {
            HashMap<String, String> map = new HashMap<>();
            map.put(testEnum.name,testEnum.code.toString());
            list.add(map);
        }
        return list;
    }
}

