package com.yonge.cooleshow.biz.dal.dto.search;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yonge.cooleshow.biz.dal.enums.InOrOutEnum;
import com.yonge.toolset.base.page.QueryInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * @Author: liweifan
 * @Data: 2022-08-03 16:44:34
 */
@ApiModel(value = "PianoRoomChangeRecordSearch对象", description = "琴房时长变更记录表查询对象")
public class PianoRoomChangeRecordSearch extends QueryInfo{
	private static final long serialVersionUID = 1L;

	@ApiModelProperty("用户id ")
	private Long userId;

	@ApiModelProperty("操作类型：IN、增加 OUT、减少 ")
	private InOrOutEnum inOrOut;

	@ApiModelProperty("操作人")
	private String operaUser;

	@ApiModelProperty(value = "交易开始时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime startTime;

	@ApiModelProperty(value = "交易结束时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime endTime;

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public InOrOutEnum getInOrOut() {
		return inOrOut;
	}

	public void setInOrOut(InOrOutEnum inOrOut) {
		this.inOrOut = inOrOut;
	}

	public String getOperaUser() {
		return operaUser;
	}

	public void setOperaUser(String operaUser) {
		this.operaUser = operaUser;
	}

	public LocalDateTime getStartTime() {
		return startTime;
	}

	public void setStartTime(LocalDateTime startTime) {
		if(null != startTime){
			this.startTime = LocalDateTime.of(startTime.toLocalDate(), LocalTime.MIN);
		}
	}

	public LocalDateTime getEndTime() {
		return endTime;
	}

	public void setEndTime(LocalDateTime endTime) {
		if(null != endTime){
			this.endTime = LocalDateTime.of(endTime.toLocalDate(), LocalTime.MAX);
		}
	}
}