Commit 068e141b4efcb2d42d6bc9c17d8f6923697a9367

Authored by liquanyu
1 parent 0c96001111

update code

Showing 1 changed file with 55 additions and 0 deletions

platform-common/src/main/java/com/lyms/platform/common/enums/ExpYunEnums.java View file @ 068e141
  1 +package com.lyms.platform.common.enums;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.HashMap;
  5 +import java.util.List;
  6 +import java.util.Map;
  7 +
  8 +/**
  9 + *
  10 + * 孕妇体验类型
  11 + *
  12 + * @author Administrator
  13 + *
  14 + */
  15 +public enum ExpYunEnums {
  16 +
  17 + SGY(0,"体验3个月服务"),ETFW(1,"体验孕期服务");
  18 +
  19 + private ExpYunEnums(int id, String name) {
  20 + this.id = id;
  21 + this.name = name;
  22 + }
  23 +
  24 + public static String getNameById(int id){
  25 + for(ExpYunEnums sex : values()){
  26 + if(id==sex.id){
  27 + return sex.getName();
  28 + }
  29 + }
  30 + return "";
  31 + }
  32 +
  33 + public static List<Map> getExpYunEnums() {
  34 + List<Map> list = new ArrayList<>();
  35 + for (ExpYunEnums e : ExpYunEnums.values()) {
  36 + Map rootMap = new HashMap();
  37 + rootMap.put("id", e.getId());
  38 + rootMap.put("name", e.getName());
  39 + list.add(rootMap);
  40 + }
  41 + return list;
  42 + }
  43 +
  44 + private int id;
  45 +
  46 + private String name;
  47 +
  48 + public int getId() {
  49 + return id;
  50 + }
  51 +
  52 + public String getName() {
  53 + return name;
  54 + }
  55 +}