package com.jsowell.pile.vo.base;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import java.util.List;

/**
 * 返回给前端的站点信息vo
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class StationInfoVO {
	/**
	 * 站点id
	 */
	private String stationId;

	/**
	 * 站点名称
	 */
	private String stationName;

	/**
	 * 站点地址
	 */
	private String stationAddress;

	/**
	 * 站点图片
	 */
	private List<String> stationImgList;

	/**
	 * 距离 单位千米
	 */
	private String distance;

	/**
	 * 电费 每度单价
	 */
	private String electricityPrice;

	/**
	 * 服务费 每度单价
	 */
	private String servicePrice;

	/**
	 * 电费 + 服务费 每度单价
	 */
	private String totalPrice;

	/**
	 * 快充枪口总数
	 */
	private int fastTotal;

	/**
	 * 快充枪口空闲数
	 */
	private int fastFree;

	/**
	 * 慢充枪口总数
	 */
	private int slowTotal;

	/**
	 * 慢充枪口空闲数
	 */
	private int slowFree;

	/**
	 * 总空闲枪口数
	 */
	private int totalFree;

	/**
	 * 经度
	 */
	private String stationLng;

	/**
	 * 纬度
	 */
	private String stationLat;

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;

		if (o == null || getClass() != o.getClass()) return false;

		StationInfoVO that = (StationInfoVO) o;

		return new EqualsBuilder().append(stationId, that.stationId).append(stationName, that.stationName).isEquals();
	}

	@Override
	public int hashCode() {
		return new HashCodeBuilder(17, 37).append(stationId).append(stationName).toHashCode();
	}
}
