forked from rongchao/epmet-cloud-rizhao
				
			
				 2 changed files with 42 additions and 1 deletions
			
			
		@ -0,0 +1,41 @@ | 
				
			|||||
 | 
					package com.epmet.utils; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					/** | 
				
			||||
 | 
					 * 系统支持的规则周期枚举类 | 
				
			||||
 | 
					 * | 
				
			||||
 | 
					 * @author wangc | 
				
			||||
 | 
					 * @date 2020-07-03 11:14 | 
				
			||||
 | 
					 **/ | 
				
			||||
 | 
					public enum RuleCycleEnum { | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    UNLIMITED("unlimit","不限制"), | 
				
			||||
 | 
					    FIRST("first","首次"), | 
				
			||||
 | 
					    DAILY("day","每日"), | 
				
			||||
 | 
					    WEEKLY("week","每周"), | 
				
			||||
 | 
					    MONTHLY("month","每月"), | 
				
			||||
 | 
					    YEARLY("year","每年") | 
				
			||||
 | 
					    ; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    private String key; | 
				
			||||
 | 
					    private String desc; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    RuleCycleEnum(String key,String desc){ | 
				
			||||
 | 
					        this.key = key; | 
				
			||||
 | 
					        this.desc = desc; | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    public static RuleCycleEnum getEnum(String key){ | 
				
			||||
 | 
					        RuleCycleEnum[] values = RuleCycleEnum.values(); | 
				
			||||
 | 
					        for (RuleCycleEnum value : values) { | 
				
			||||
 | 
					            if (null != key && value.getKey().equals(key)) { | 
				
			||||
 | 
					                return value; | 
				
			||||
 | 
					            } | 
				
			||||
 | 
					        } | 
				
			||||
 | 
					        return null; | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    public String getKey(){ return key;} | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    public String getValue(){ return desc;} | 
				
			||||
 | 
					} | 
				
			||||
					Loading…
					
					
				
		Reference in new issue