package jp.co.y_net.amm.dao;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import jp.co.y_net.amm.common.AppUtils;

import org.apache.commons.lang.StringUtils;


public class Inf extends AppDto implements Serializable {
	private static final long serialVersionUID = 1L;
	
	public static final DateFormat DF_PUBDATE = new SimpleDateFormat("yyyy/MM/dd"); // 掲載日 フォーマット
	public static final Integer DEFお知らせ本文の文字数 = 5000;
	
	/** 状態 */
    public static final Integer STATUS_掲載中 = 2;
    public static final Integer STATUS_その他 = 1;
    public static final Integer STATUS_掲載終了 = 9;
	
	private Integer infid;
	private String title;
	private String body;
	private Long pubdate;
    private Integer status;

    
    public String getTitleFormat() {
        return StringUtils.abbreviate(title, 50); // 50文字に省略
    }
    public String getPubdate_Disp() {
        Date d = AppUtils.toDate(this.pubdate);
        return DF_PUBDATE.format(d);
    }
    
    
    public Integer getInfid() {
        return infid;
    }
    public void setInfid(Integer infid) {
        this.infid = infid;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public String getBody() {
        return body;
    }
    public void setBody(String body) {
        this.body = body;
    }
    public Long getPubdate() {
        return pubdate;
    }
    public void setPubdate(Long pubdate) {
        this.pubdate = pubdate;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
}

