package com.lightinit.hsdataportal.model;

import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author: sunxiang
 * @Date: 2018/6/9 16:02
 * @Description:
 **/
public class DataDetailModel {
    private Long id;
    private Long resourceId;
    private Long publishSettingId;
    private String  resourceName;	//服务名称
    private String  resourceImg;	//资源图片
    private String resourceIdentity;	//服务标识
    private String shareType;	//共享类型
    private String openType;	//开放类型
    private String resourceSummary;	//服务简介---数据描述
    private String toObject="个人，企业";	//面向对象
    //private String 需求不明确;	//分类
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date auditedAt;	//发布日期  pulishInfo表的审核日期
    private String dataItem;	//数据项
    private Long followTotalCount; //关注的总数
    private Long viewTimes;//浏览总数
    private Long belongTo;	//所属单位
    private String sectorName;	//所属单位 、发布机构
    private Long catelogBasic;//基础分类
    private String catelogBasicName;
    private Long catelogSector;//部门分类
    private String catelogSectorName;
    private Long catelogTheme;	//主题分类
    private String catelogThemeName;
    private Long catelogCustom;//自定义分类
    private String catelogCustomName;


    private String dataTag;	//数据标签
    //private String 需求不明确;	//文件格式      在dictionary表中
    private String demoFile;	//示例数据
    private String demoFileName;	//示例数据名称
    private String dataFile;	//数据文件
    private String dataFileName;	//数据文件名称
    private BigDecimal packagePrice;//套餐价格
    private Long packageMonths;//套餐月数
    private Long resourceFollowId;

    public String getDemoFileName() {
        return demoFileName;
    }

    public void setDemoFileName(String demoFileName) {
        this.demoFileName = demoFileName;
    }

    public String getDataFileName() {
        return dataFileName;
    }

    public void setDataFileName(String dataFileName) {
        this.dataFileName = dataFileName;
    }

    public String getResourceImg() {
        return resourceImg;
    }

    public void setResourceImg(String resourceImg) {
        this.resourceImg = resourceImg;
    }

    public Long getViewTimes() {
        return viewTimes;
    }

    public void setViewTimes(Long viewTimes) {
        this.viewTimes = viewTimes;
    }

    public Long getFollowTotalCount() {
        return followTotalCount;
    }

    public void setFollowTotalCount(Long followTotalCount) {
        this.followTotalCount = followTotalCount;
    }

    public Long getResourceFollowId() {
        return resourceFollowId;
    }

    public void setResourceFollowId(Long resourceFollowId) {
        this.resourceFollowId = resourceFollowId;
    }

    public String getCatelogString(){
        StringBuilder stringBuilder = new StringBuilder();
        String str=null;
        if(StringUtils.isNotEmpty(catelogCustomName)){
            stringBuilder.append(catelogCustomName);
            stringBuilder.append(",");
        }
        if(StringUtils.isNotEmpty(catelogThemeName)){
            stringBuilder.append(catelogThemeName);
            stringBuilder.append(",");
        }
        if(StringUtils.isNotEmpty(catelogSectorName)){
            stringBuilder.append(catelogSectorName);
            stringBuilder.append(",");
        }
        if(StringUtils.isNotEmpty(catelogBasicName)){
            stringBuilder.append(catelogBasicName);
            stringBuilder.append(",");
        }
        if( stringBuilder.length()>0){
            str = stringBuilder.substring(0, stringBuilder.length() - 1);
        }
        System.out.println(str);
        return str;
    }

    public String getCatelogBasicName() {
        return catelogBasicName;
    }

    public void setCatelogBasicName(String catelogBasicName) {
        this.catelogBasicName = catelogBasicName;
    }

    public String getCatelogSectorName() {
        return catelogSectorName;
    }

    public void setCatelogSectorName(String catelogSectorName) {
        this.catelogSectorName = catelogSectorName;
    }

    public String getCatelogThemeName() {
        return catelogThemeName;
    }

    public void setCatelogThemeName(String catelogThemeName) {
        this.catelogThemeName = catelogThemeName;
    }

    public String getCatelogCustomName() {
        return catelogCustomName;
    }

    public void setCatelogCustomName(String catelogCustomName) {
        this.catelogCustomName = catelogCustomName;
    }

    public Long getResourceId() {
        return resourceId;
    }

    public void setResourceId(Long resourceId) {
        this.resourceId = resourceId;
    }

    public Long getCatelogBasic() {
        return catelogBasic;
    }

    public void setCatelogBasic(Long catelogBasic) {
        this.catelogBasic = catelogBasic;
    }

    public Long getCatelogSector() {
        return catelogSector;
    }

    public void setCatelogSector(Long catelogSector) {
        this.catelogSector = catelogSector;
    }

    public Long getCatelogCustom() {
        return catelogCustom;
    }

    public void setCatelogCustom(Long catelogCustom) {
        this.catelogCustom = catelogCustom;
    }

    public Long getPackageMonths() {
        return packageMonths;
    }

    public void setPackageMonths(Long packageMonths) {
        this.packageMonths = packageMonths;
    }

    public BigDecimal getPackagePrice() {
        return packagePrice;
    }

    public void setPackagePrice(BigDecimal packagePrice) {
        this.packagePrice = packagePrice;
    }

    public Long getPublishSettingId() {
        return publishSettingId;
    }

    public void setPublishSettingId(Long publishSettingId) {
        this.publishSettingId = publishSettingId;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public String getResourceIdentity() {
        return resourceIdentity;
    }

    public void setResourceIdentity(String resourceIdentity) {
        this.resourceIdentity = resourceIdentity;
    }

    public String getShareType() {
        return shareType;
    }

    public void setShareType(String shareType) {
        this.shareType = shareType;
    }

    public String getOpenType() {
        return openType;
    }

    public void setOpenType(String openType) {
        this.openType = openType;
    }

    public String getResourceSummary() {
        return resourceSummary;
    }

    public void setResourceSummary(String resourceSummary) {
        this.resourceSummary = resourceSummary;
    }

    public String getToObject() {
        return toObject;
    }

    public void setToObject(String toObject) {
        this.toObject = toObject;
    }

    public Date getAuditedAt() {
        return auditedAt;
    }

    public void setAuditedAt(Date auditedAt) {
        this.auditedAt = auditedAt;
    }

    public String getDataItem() {
        return dataItem;
    }

    public void setDataItem(String dataItem) {
        this.dataItem = dataItem;
    }

    public Long getBelongTo() {
        return belongTo;
    }

    public void setBelongTo(Long belongTo) {
        this.belongTo = belongTo;
    }

    public String getSectorName() {
        return sectorName;
    }

    public void setSectorName(String sectorName) {
        this.sectorName = sectorName;
    }

    public Long getCatelogTheme() {
        return catelogTheme;
    }

    public void setCatelogTheme(Long catelogTheme) {
        this.catelogTheme = catelogTheme;
    }

    public String getDataTag() {
        return dataTag;
    }

    public void setDataTag(String dataTag) {
        this.dataTag = dataTag;
    }

    public String getDemoFile() {
        return demoFile;
    }

    public void setDemoFile(String demoFile) {
        this.demoFile = demoFile;
    }

    public String getDataFile() {
        return dataFile;
    }

    public void setDataFile(String dataFile) {
        this.dataFile = dataFile;
    }
}
