package com.mmc.csf.release.task.qo;

import com.mmc.csf.release.model.group.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @Author LW
 * @date 2023/5/17 14:16
 * 概要：
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TaskServiceQo implements Serializable {
    @ApiModelProperty(value = "地域id")
    private Integer regionId;
    @ApiModelProperty(value = "行业id")
    private Integer industryId;
    @ApiModelProperty(value = "应用id")
    private Integer appTypeId;
    @ApiModelProperty(value = "服务名称")
    private String inspectionName;
    @ApiModelProperty(value = "页码", required = true)
    @NotNull(message = "页码不能为空", groups = { Page.class })
    @Min(value = 1, groups = Page.class)
    private Integer pageNo;
    @ApiModelProperty(value = "每页显示数", required = true)
    @NotNull(message = "每页显示数不能为空", groups = { Page.class })
    @Min(value = 1, groups = Page.class)
    private Integer pageSize;
    public void buildCurrentPage() {
        this.pageNo = (pageNo - 1) * pageSize;
    }
}
