package com.yunfeiyun.agmp.common.core.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.yunfeiyun.agmp.common.web.system.domain.SysRes;
import com.yunfeiyun.agmp.common.annotation.Excel;
import com.yunfeiyun.agmp.common.utils.uuid.IdUtils;
import com.yunfeiyun.agmp.common.utils.uuid.Uuids;

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

/**
 * Entity基类
 * 
 * @author 杨晓辉
 */
public class BaseEntity implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 搜索值 */
    @JsonIgnore
    private String searchValue;

    @JsonIgnore
    private List<String> landIds;

    @JsonIgnore
    private List<String> blockIds;

    @JsonIgnore
    private boolean dataFilter;



    @Excel(name = "资源列表")
    private List<SysRes> resList;//一对多实体属性

    public List<String> getLandIds() {
        return landIds;
    }

    public void setLandIds(List<String> landIds) {
        this.landIds = landIds;
    }

    public List<String> getBlockIds() {
        return blockIds;
    }

    public void setBlockIds(List<String> blockIds) {
        this.blockIds = blockIds;
    }

    public boolean getDataFilter() {
        return dataFilter;
    }

    public void setDataFilter(boolean dataFilter) {
        this.dataFilter = dataFilter;
    }

    /** 请求参数 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Map<String, Object> params;

    public String getSearchValue()
    {
        return searchValue;
    }

    public void setSearchValue(String searchValue)
    {
        this.searchValue = searchValue;
    }


    public Map<String, Object> getParams()
    {
        if (params == null)
        {
            params = new HashMap<>();
        }
        return params;
    }

    public void setParams(Map<String, Object> params)
    {
        this.params = params;
    }

    public String getId()
    {
        try {
            return (Uuids.create().toString());
        }catch(Exception e){
            return IdUtils.fastUUID();
        }
    }

    public List<SysRes> getResList() {
        return resList;
    }

    public void setResList(List<SysRes> resList) {
        this.resList = resList;
    }
}
