mirror of https://github.com/halo-dev/halo
Move theme configuration entities
parent
8054b8f714
commit
f72be35337
|
@ -0,0 +1,47 @@
|
|||
package run.halo.app.handler.theme;
|
||||
|
||||
import lombok.Data;
|
||||
import run.halo.app.model.enums.DataType;
|
||||
import run.halo.app.model.enums.InputType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Theme configuration: Item entity
|
||||
*
|
||||
* @author johnniang
|
||||
* @date 4/10/19
|
||||
*/
|
||||
@Data
|
||||
public class Item {
|
||||
|
||||
/**
|
||||
* Item name.
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* Item label.
|
||||
*/
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* Item input type, default is text.
|
||||
*/
|
||||
private InputType type;
|
||||
|
||||
/**
|
||||
* Item data type, default is string.
|
||||
*/
|
||||
private DataType dataType;
|
||||
|
||||
/**
|
||||
* Item default value.
|
||||
*/
|
||||
private Object defaultValue;
|
||||
|
||||
/**
|
||||
* Item's options, default is empty list
|
||||
*/
|
||||
private List<Option> options;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package run.halo.app.handler.theme;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Theme configuration: option entity.
|
||||
*
|
||||
* @author johnniang
|
||||
* @date 4/10/19
|
||||
*/
|
||||
@Data
|
||||
public class Option {
|
||||
|
||||
/**
|
||||
* Option label.
|
||||
*/
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* Option value.
|
||||
*/
|
||||
private Object value;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package run.halo.app.handler.theme;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Theme configuration: Tab entity.
|
||||
*
|
||||
* @author johnniang
|
||||
* @date 4/10/19
|
||||
*/
|
||||
@Data
|
||||
public class Tab {
|
||||
|
||||
/**
|
||||
* Tab name.
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* Tab label.
|
||||
*/
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* Tab's items, default is empty list.
|
||||
*/
|
||||
private List<Item> items;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package run.halo.app.handler.theme;
|
||||
|
||||
/**
|
||||
* Theme configuration resolver.
|
||||
*
|
||||
* @author johnniang
|
||||
* @date 4/10/19
|
||||
*/
|
||||
public class ThemeConfigResolver {
|
||||
|
||||
|
||||
}
|
|
@ -2,9 +2,11 @@ package run.halo.app.utils;
|
|||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
|
||||
import lombok.Data;
|
||||
import org.junit.Test;
|
||||
import org.springframework.lang.Nullable;
|
||||
import run.halo.app.handler.theme.Item;
|
||||
import run.halo.app.handler.theme.Option;
|
||||
import run.halo.app.handler.theme.Tab;
|
||||
import run.halo.app.model.enums.DataType;
|
||||
import run.halo.app.model.enums.InputType;
|
||||
|
||||
|
@ -357,27 +359,4 @@ public class YamlTest {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Data
|
||||
private class Tab {
|
||||
private String name;
|
||||
private String label;
|
||||
private List<Item> items;
|
||||
}
|
||||
|
||||
@Data
|
||||
private class Item {
|
||||
private String name;
|
||||
private String label;
|
||||
private InputType type;
|
||||
private DataType dataType;
|
||||
private Object defaultValue;
|
||||
|
||||
private List<Option> options;
|
||||
}
|
||||
|
||||
@Data
|
||||
private class Option {
|
||||
private String label;
|
||||
private Object value;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue