mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-01 18:35:37 +08:00
refactor: EnumDict增加序列化实现
This commit is contained in:
@@ -28,6 +28,7 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
@@ -49,7 +50,7 @@ import java.util.stream.Stream;
|
||||
*/
|
||||
@JSONType(deserializer = EnumDict.EnumDictJSONDeserializer.class)
|
||||
@JsonDeserialize(contentUsing = EnumDict.EnumDictJSONDeserializer.class)
|
||||
public interface EnumDict<V> extends JSONSerializable {
|
||||
public interface EnumDict<V> extends JSONSerializable, Serializable {
|
||||
|
||||
/**
|
||||
* 枚举选项的值,通常由字母或者数字组成,并且在同一个枚举中值唯一;对应数据库中的值通常也为此值
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.hswebframework.web.dict;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhouhao
|
||||
|
||||
@@ -6,6 +6,7 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hswebframework.web.dict.ItemDefine;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -17,8 +18,11 @@ import java.util.List;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DefaultItemDefine implements ItemDefine {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String text;
|
||||
private String value;
|
||||
private String comments;
|
||||
private int ordinal;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user