package com.gh.gamecenter.db.info;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

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

@DatabaseTable(tableName = "tb_search")
public class SearchHistoryInfo implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@DatabaseField(id = true, columnName = "item")
	private String item;

	@DatabaseField(useGetSet = true, columnName = "time")
	private String time;

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public String getItem() {
		return item;
	}

	public SearchHistoryInfo() {

	}

	public SearchHistoryInfo(String item) {
		this.item = item;
		Date date = new Date();
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",
				Locale.getDefault());
		this.time = format.format(date);
	}

	public SearchHistoryInfo(String item, String time) {
		this.item = item;
		this.time = time;
	}

	@Override
	public String toString() {
		return "SearchHistoryEntity [item=" + item + ", time=" + time + "]";
	}

}
