package com.liquidnet.service.sweet.vo;

import com.liquidnet.service.sweet.dto.SweetCityVoteStatDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
public class SweetCItyVoteStatVo implements Serializable, Cloneable {
    private static final long serialVersionUID = 1L;

    /*@TableId(value = "mid", type = IdType.AUTO)
    private Long mid;

    @ApiModelProperty("vote_id")
    private String statId;*/

    @ApiModelProperty("城市代码")
    private String cityCode;

    @ApiModelProperty("城市名称")
    private String cityName;

    /*@ApiModelProperty("真实投票数量")
    private Integer voteNum;

    @ApiModelProperty("手动增加投票数量")
    private Integer manualVoteNum;*/

    @ApiModelProperty("总投票数")
    private Integer totalNum;

    @ApiModelProperty("当前用户是否投了当前城市 1没投 2投了")
    private Integer isVote;

    @ApiModelProperty("type")
    private Integer type;

    @ApiModelProperty("名次")
    private Integer ranking;

    @ApiModelProperty("名次变动状态 1未变化 2上升 3下降")
    private Integer rankingUpOrDown;

    /*@ApiModelProperty("创建时间")
    private LocalDateTime createdAt;

    @ApiModelProperty("更新时间")
    private LocalDateTime updatedAt;*/

    private static final SweetCItyVoteStatVo obj = new SweetCItyVoteStatVo();
    public static SweetCItyVoteStatVo getNew() {
        try {
            return (SweetCItyVoteStatVo) obj.clone();
        } catch (CloneNotSupportedException e) {
            return new SweetCItyVoteStatVo();
        }
    }

    public SweetCItyVoteStatVo copy(SweetCityVoteStatDto source) {
        if (null == this) return this;
        this.setCityCode(source.getCityCode());
        this.setCityName(source.getCityName());
//        this.setVoteNum(source.getVoteNum());
//        this.setManualVoteNum(source.getManualVoteNum());
        this.setTotalNum(source.getTotalNum());
        this.setType(source.getType());
        return this;
    }

}
