package com.qmth.teachcloud.report.business.bean.params;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
import io.swagger.annotations.ApiModelProperty;

import java.util.Optional;

/**
 * @Description: 考试删除参数
 * @Author: CaoZixuan
 * @Date: 2022-07-12
 */
public class TBExamDeleteParam {
    @ApiModelProperty(value = "考试id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "学校id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long schoolId;

    /**
     * 参数校验
     */
    public void validParams() {
        Optional.ofNullable(this.getId()).orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("考试id为空"));
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(Long schoolId) {
        this.schoolId = schoolId;
    }
}
