package com.izouma.dingdong.domain.rider;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Builder
@EntityListeners(AuditingEntityListener.class)
@ApiModel(value = "骑手位置", description = "骑手位置")
public class RiderLocation implements Serializable {
    /*
    id 无需传
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    /*
    创建时间，无需传
     */
    @CreatedDate
    @ApiModelProperty(value = "创建时间", name = "createdAt")
    private LocalDateTime createdAt;

    @ApiModelProperty(value = "骑手Id", name = "riderId")
    private Long riderId;

    @ApiModelProperty(value = "经度", name = "longitude")
    private Double longitude;

    @ApiModelProperty(value = "纬度", name = "latitude")
    private Double latitude;

}
