package cn.ey.biz.module.system.controller.admin.app.vo;

import cn.ey.biz.common.pojo.PageParam;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Size;
import java.util.Date;

import static cn.ey.biz.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@ApiModel("管理后台 - 系统应用分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class AppPageReqVO extends PageParam {

    @ApiModelProperty(value = "编码")
    @Size(max = 16, message = "编码标签长度不能超过16个字符")
    private String code;

    @ExcelProperty("app 路径")
    @Size(max = 16, message = "app路径长度不能超过100个字符")
    private String appRoad;

    @ApiModelProperty(value = "名称")
    @Size(max = 30, message = "app名长度不能超过30个字符")
    private String name;

    @ApiModelProperty(value = "生产地址")
    @Size(max = 300, message = "生产地址长度不能超过300个字符")
    private String url;

    @ApiModelProperty(value = "开发地址")
    @Size(max = 300, message = "开发地址长度不能超过300个字符")
    private String urlDev;

    @ApiModelProperty(value = "状态（0正常 1停用）")
    @Max(value = 1, message = "状态只能为0或1")
    @Min(value = 0, message = "状态只能为0或1")
    private Integer status;

    @ApiModelProperty(value = "备注")
    @Size(max = 300, message = "备注长度不能超过300个字符")
    private String remark;

    @ApiModelProperty(value = "创建日期")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private Date[] createTime;

}
