package com.zsElectric.boot.thirdParty.model;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 充电站列表响应数据
 *
 * @author wzq
 */
@Data
public class ChargeStationListResponseData implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 总记录数
     */
    private Long total;

    /**
     * 当前页码
     */
    private Integer pageNum;

    /**
     * 每页大小
     */
    private Integer pageSize;

    /**
     * 总页数
     */
    private Long pages;

    /**
     * 站点列表
     */
    private List<StationItem> list;

    /**
     * 站点信息项
     */
    @Data
    public static class StationItem implements Serializable {
        private static final long serialVersionUID = 1L;

        @Schema(description = "站点ID")
        private Long stationId;

        @Schema(description = "站点名称")
        private String stationName;

        @Schema(description = "提示语")
        private String tips;

        @Schema(description = "距离（km）")
        private BigDecimal distance;

        @Schema(description = "快充（格式：空闲/总数）")
        private String fastCharging;

        @Schema(description = "慢充（格式：空闲/总数）")
        private String slowCharging;

        @Schema(description = "当前峰值")
        private String peakValue;

        @Schema(description = "峰时段时间")
        private String peakTime;

        @Schema(description = "时段标志(1-尖,2-峰,3-平,4-谷)")
        private Integer periodFlag;

        @Schema(description = "平台价")
        private BigDecimal platformPrice;

    }

    /**
     * 构建成功响应
     */
    public static ChargeStationListResponseData of(Long total, Integer pageNum, Integer pageSize, Long pages, List<StationItem> list) {
        ChargeStationListResponseData data = new ChargeStationListResponseData();
        data.setTotal(total);
        data.setPageNum(pageNum);
        data.setPageSize(pageSize);
        data.setPages(pages);
        data.setList(list);
        return data;
    }
}
