package com.nova.sankuai.domain.enums.yixin; import com.nova.sankuai.domain.vo.EnumParamsVo; import io.swagger.annotations.ApiModel; import java.util.ArrayList; import java.util.List; /** * @author weikangdi * @create 2022/5/16 * APP字段枚举-居住地类型 */ @ApiModel(value = "APP字段枚举-居住地枚举") public enum YiXinLivestEnum { LIVEST_1("1", "自置"), LIVEST_2("2", "按揭"), LIVEST_3("3", "亲属楼宇"), LIVEST_4("4", "集体宿舍"), LIVEST_5("5", "租房"), LIVEST_6("6", "共有住宅"), LIVEST_7("7", "其他"), UNKNOWN("9", "未知"), ; private String code; private String value; YiXinLivestEnum(String code, String value) { this.code = code; this.value = value; } public static String value(String code) { if (code != null) { for (YiXinLivestEnum m : YiXinLivestEnum.values()) { if (m.getCode().equals(code)) { return m.getValue(); } } } return null; } public static List parseParams() { List paramsVos = new ArrayList<>(); for (YiXinLivestEnum m : YiXinLivestEnum.values()) { EnumParamsVo enumParamsVo = new EnumParamsVo(); enumParamsVo.setValue(m.getCode()); enumParamsVo.setText(m.getValue()); paramsVos.add(enumParamsVo); } return paramsVos; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } }