package com.qmth.themis.business.dto.response;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @Description: 考试候考dto
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/8/3
 */
public class TEExamWaitDto implements Serializable {

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(name = "考试批次id")
    private Long id;//考试id

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(name = "考试场次id")
    private String examActivityId;//考试场次id

    @ApiModelProperty(name = "考试名称")
    private String name;//考试名称

    @ApiModelProperty(name = "考试编码")
    private String code;//考试编码

    @ApiModelProperty(name = "考试场次集合")
    private List<TEExamActivityWaitDto> activities;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getExamActivityId() {
        return examActivityId;
    }

    public void setExamActivityId(String examActivityId) {
        this.examActivityId = examActivityId;
    }

    public Long getId() {
        return id;
    }

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

    public String getName() {
        if (Objects.nonNull(code)) {
            return name + "(" + code + ")";
        } else {
            return name;
        }
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<TEExamActivityWaitDto> getActivities() {
        return activities;
    }

    public void setActivities(List<TEExamActivityWaitDto> activities) {
        this.activities = activities;
    }
}
