package cn.reghao.tnb.content.app.geo.model.po;

import cn.reghao.jutil.jdk.db.BaseObject;
import cn.reghao.tnb.content.api.dto.geo.MallReplyPhotoDto;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author reghao
 * @date 2024-09-07 12:01:03
 */
@NoArgsConstructor
@Setter
@Getter
public class CameraPhoto extends BaseObject<Integer> {
    private Integer type;
    private Long albumId;
    private String objectId;
    private Integer channelId;
    private String photoUrl;
    private String manufacturer;
    private String model;
    private String software;
    private LocalDateTime shotAt;
    private BigDecimal longitude;
    private BigDecimal latitude;

    public CameraPhoto(MallReplyPhotoDto mallReplyPhotoDto) {
        this.type = 2;
        this.albumId = Long.parseLong(mallReplyPhotoDto.getReplyId());
        this.objectId = mallReplyPhotoDto.getUploadId();
        this.channelId = mallReplyPhotoDto.getChannelId();
        this.photoUrl = mallReplyPhotoDto.getPhotoUrl();
        this.manufacturer = mallReplyPhotoDto.getManufacturer();
        this.model = mallReplyPhotoDto.getModel();
        this.software = mallReplyPhotoDto.getSoftware();
        this.longitude = BigDecimal.valueOf(mallReplyPhotoDto.getLongitude());
        this.latitude = BigDecimal.valueOf(mallReplyPhotoDto.getLatitude());
    }
}
