package com.ssm.manage.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.ssm.manage.page.BasePage;
import com.ssm.manage.utils.DateUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@Table(name = "sms_messages_${tab}")
@JsonIgnoreProperties(ignoreUnknown = true)
public class SmsMessagesRequest extends BasePage {
    private Long id;
    private String phone;
    private String content;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date startTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date endTime;
    @ApiModelProperty("会员名字")
    private String memberName;
    private Date sendTime;
    private Integer status;
    private String errorMessage;
    private Long storeId;
    private String storeNum;
    private String storeName;
    private String smsAccount;
    private String smsPassword;
    private String smsUrl;

    private Integer smsType;
    @JsonIgnore
    public String getTab(){
        return DateUtils.YMFormat(startTime);
    }
}
