package com.sheep.gamegroup.model.entity;

import com.sheep.gamegroup.absBase.IHomePageSearch;
import com.sheep.gamegroup.absBase.ISearchRecord;

/**
 * Created by realicing on 2018/11/8.
 * realicing@sina.com
 * 热门搜索历史
 * <p>
 * link_id:	integer ($int64)
 * 关联其他表的主键id（具体是哪张表由type决定）
 * update_time:	integer ($int64)
 * 修改时间（最后一次搜索时间）
 * applications:	Applications{...}
 * search_num:	integer ($int64)
 * （首页热门）搜索次数
 * create_time:	integer ($int64)
 * 创建时间
 * platform:	integer ($int64)
 * 平台 0全 1android 2ios（该平台值从关联表（link_type决定）中获取）
 * id:	integer ($int64)
 * ID
 * release_task:	ReleaseTask{...}
 * link_type:	integer ($int64)
 * 关联类型 1任务（release_task）2游戏（applications)
 */
public class TopSearchStatistics implements ISearchRecord, IHomePageSearch {
    private Applications applications;

    private int create_time;

    private int id;

    private int link_id;

    private int link_type;

    private int platform;

    private Release_task release_task;

    private int search_num;

    private int update_time;

    public void setApplications(Applications applications) {
        this.applications = applications;
    }

    public Applications getApplications() {
        return this.applications;
    }

    public void setCreate_time(int create_time) {
        this.create_time = create_time;
    }

    public int getCreate_time() {
        return this.create_time;
    }

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

    public int getId() {
        return this.id;
    }

    public void setLink_id(int link_id) {
        this.link_id = link_id;
    }

    public int getLink_id() {
        return this.link_id;
    }

    public void setLink_type(int link_type) {
        this.link_type = link_type;
    }

    public int getLink_type() {
        return this.link_type;
    }

    public void setPlatform(int platform) {
        this.platform = platform;
    }

    public int getPlatform() {
        return this.platform;
    }

    public void setRelease_task(Release_task release_task) {
        this.release_task = release_task;
    }

    public Release_task getRelease_task() {
        return this.release_task;
    }

    public void setSearch_num(int search_num) {
        this.search_num = search_num;
    }

    public int getSearch_num() {
        return this.search_num;
    }

    public void setUpdate_time(int update_time) {
        this.update_time = update_time;
    }

    public int getUpdate_time() {
        return this.update_time;
    }



    @Override
    public String getInput() {
        if (release_task != null) {
            return release_task.getName();
        }
        if (applications != null) {
            return applications.getName();
        }
        return "";
    }
}
