DinerDTO.java 1.76 KB
package com.infoloop.tianting.model.dto;

import com.infoloop.tianting.annotation.RequestKeyParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Data
@ApiModel(description = "就餐人DTO")
public class DinerDTO {

    @Data
    @ApiModel(description = "查询唯一就餐人")
    public static class QueryUniqueDinerDTO {

        @ApiModelProperty(value = "学号")
        private String studentNo;

    }


    @Data
    @ApiModel(description = "添加就餐人")
    public static class CreateDinerDTO {

        @ApiModelProperty(value = "学校编码")
        @NotEmpty(message = "学校编码不能为空")
        @RequestKeyParam
        private String clientCode;

        @ApiModelProperty(value = "班级")
        @NotNull(message = "班级不能为空")
        @RequestKeyParam
        private Integer classId;

        @ApiModelProperty(value = "学号")
        @NotEmpty(message = "学号不能为空")
        @RequestKeyParam
        private String studentNo;

        @ApiModelProperty(value = "姓名")
        @NotEmpty(message = "姓名不能为空")
        private String name;
    }

    @Data
    @ApiModel(description = "修改就餐人")
    public static class UpdateDinerDTO {

        @ApiModelProperty(value = "学校编码")
        @NotEmpty(message = "学校编码不能为空")
        private String clientCode;

        @ApiModelProperty(value = "班级")
        @NotNull(message = "班级不能为空")
        private Integer classId;

        @ApiModelProperty(value = "学号")
        private String studentNo;

        @ApiModelProperty(value = "姓名")
        private String name;
    }
}