package com.ylcm.sys.form;

import java.math.BigDecimal;

import javax.validation.constraints.NotNull;

import org.springframework.beans.BeanUtils;

import com.ylcm.sys.common.DateUtil;
import com.ylcm.sys.domain.AdSpecial;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class AdSpecialForm {
	
	private Integer id;

	@NotNull
	@ApiModelProperty(value = "0广告 1栏目")
    private Integer type;

	@NotNull
    @ApiModelProperty(value = "产品名称")
    private String productName;

    @ApiModelProperty(value = "品牌/内容")
    private String brandName;

    @ApiModelProperty(value = "广告主")
    private String advMaster;

    @NotNull
    @ApiModelProperty(value = "播出媒体")
    private String mediaName;

    @NotNull
    @ApiModelProperty(value = "播出环境 0电视剧 1综艺 2广告")
    private Integer showEnv;

    @NotNull
    @ApiModelProperty(value = "播出节目")
    private String tvName;

    @NotNull
    @ApiModelProperty(value = "播出时间")
    private String showTime;
    
    @NotNull
    @ApiModelProperty(value = "播出日期")
    private String showDate;
    
    @ApiModelProperty(value = "播出时长(单位分)")
    private Float showDuration;
    
    @ApiModelProperty(value = "价格")
    private BigDecimal price;
    
    @ApiModelProperty(value = "联系方式")
    private String phone;
    
    private Integer pageSize;
    
    private Integer pageNo;
    
    public AdSpecial toSpecial() {
    	AdSpecial adSpecial = new AdSpecial();
    	BeanUtils.copyProperties(this, adSpecial);
    	
    	adSpecial.setShowDate(DateUtil.getLocaDateByString(showDate));
    	adSpecial.setShowTime(DateUtil.getLocaTimeByString(showTime));
    	return adSpecial;
    }
}
