package com.market.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * K线数据实体
 * 注意：表名是动态的，格式为 kline_{symbol}，如 kline_btcusdt
 */
@TableName("kline_template")
public class Kline implements Serializable {
    
    @Serial
    private static final long serialVersionUID = 1L;
    
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    
    /**
     * 周期（如：1MIN, 5MIN, 1HOUR, 1DAY等）
     */
    private String period;
    
    /**
     * 开盘价
     */
    private BigDecimal open;
    
    /**
     * 收盘价
     */
    private BigDecimal close;
    
    /**
     * 最高价
     */
    private BigDecimal high;
    
    /**
     * 最低价
     */
    private BigDecimal low;
    
    /**
     * 成交量
     */
    private BigDecimal volume;
    
    /**
     * 成交额
     */
    private BigDecimal turnover;
    
    /**
     * 开始时间（毫秒时间戳）
     */
    private Long beginTime;
    
    /**
     * 结束时间（毫秒时间戳）
     */
    private Long endTime;

    public Long getId() {
        return id;
    }

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

    public String getPeriod() {
        return period;
    }

    public void setPeriod(String period) {
        this.period = period;
    }

    public BigDecimal getOpen() {
        return open;
    }

    public void setOpen(BigDecimal open) {
        this.open = open;
    }

    public BigDecimal getClose() {
        return close;
    }

    public void setClose(BigDecimal close) {
        this.close = close;
    }

    public BigDecimal getHigh() {
        return high;
    }

    public void setHigh(BigDecimal high) {
        this.high = high;
    }

    public BigDecimal getLow() {
        return low;
    }

    public void setLow(BigDecimal low) {
        this.low = low;
    }

    public BigDecimal getVolume() {
        return volume;
    }

    public void setVolume(BigDecimal volume) {
        this.volume = volume;
    }

    public BigDecimal getTurnover() {
        return turnover;
    }

    public void setTurnover(BigDecimal turnover) {
        this.turnover = turnover;
    }

    public Long getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Long beginTime) {
        this.beginTime = beginTime;
    }

    public Long getEndTime() {
        return endTime;
    }

    public void setEndTime(Long endTime) {
        this.endTime = endTime;
    }
}

