package cn.estsh.i3plus.pojo.model.form;

import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.form.bean.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiParam;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @Description : 元素Model
 * @Reference : 元素整体封装
 * @Author : Adair Peng
 * @CreateDate : 2019-03-21 13:14
 * @Modify:
 **/
@Data
public class ElementModel implements Serializable {

    private static final long serialVersionUID = -8009888251366822835L;
    //外键关联数据对象主键
    @ApiParam(value = "对象元素ID", example = "-1")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long elementId;

    @ApiParam(value = "元素基础信息")
    private BfElement element;

    @ApiParam(value = "元素Tree信息")
    private BfElementTree elementTree;

    @ApiParam(value = "元素Grid信息")
    private BfElementGrid elementGrid;

    @ApiParam(value = "元素基础属性信息")
    private List<BfElementProperty> propertyList;

    @ApiParam(value = "元素查询排序")
    private BfElementProperty propertySort;

    @ApiParam(value = "元素基础虚拟属性信息")
    private List<BfElementPropertyVirtual> virtualList;

    @ApiParam(value = "级联信息集合")
    private List<BfCascade> cascadeList;

    @ApiParam(value = "动态对象Class")
    private transient Class dynClass;

    @ApiParam(value = "数据对象信息")
    private BfDataObject dataObject;

    @ApiParam(value = "元素类型")
    private Integer elementType;

    @ApiParam(value = "分页信息")
    private Pager pager;

    @ApiParam(value = "排序属性")
    public String orderByParam;

    //CommonEnumUtil.ASC_OR_DESC  1 asc,2 desc
    @ApiParam(value = "排序类型，1 正序，2 倒序", example = "1")
    public Integer ascOrDesc = 1;

}
