StyleTypeEnum.java 710 字节
Newer Older
1 2 3 4 5
package com.pig4cloud.pig.codegen.support;

import lombok.AllArgsConstructor;
import lombok.Getter;

fxzcloud's avatar
fxzcloud 已提交
6 7
import java.util.Arrays;

8 9 10 11 12 13 14 15 16 17 18 19 20
/**
 * @author lengleng
 * @date 2021/7/31
 * <p>
 * 代码生成风格
 */
@Getter
@AllArgsConstructor
public enum StyleTypeEnum {

	/**
	 * 前端类型-avue 风格
	 */
fxzcloud's avatar
fxzcloud 已提交
21
	AVUE("0", "avue"),
22 23 24 25

	/**
	 * 前端类型-element 风格
	 */
fxzcloud's avatar
fxzcloud 已提交
26
	ELEMENT("1", "element");
27 28 29 30 31 32 33 34 35 36 37

	/**
	 * 类型
	 */
	private String style;

	/**
	 * 描述
	 */
	private String description;

fxzcloud's avatar
fxzcloud 已提交
38
	public static String getDecs(String style) {
39 40 41 42 43
		return Arrays.stream(StyleTypeEnum.values())
			.filter(styleTypeEnum -> styleTypeEnum.getStyle().equals(style))
			.findFirst()
			.orElse(ELEMENT)
			.getDescription();
fxzcloud's avatar
fxzcloud 已提交
44 45
	}

46
}