swagger 返回参数注解

 第一种

@ApiOperation(value = "取消/流失列表")
@GetMapping("/getStudentLoseList")
@ApiImplicitParams({
    @ApiImplicitParam(paramType = "query", name = "type", value = "类型(0:取消分班 1:流失)",required = true,dataType = "int"),
    @ApiImplicitParam(paramType = "query", name = "studentId", value = "学生id",required = true, dataType = "Long")
})
@ApiResponses({
        @ApiResponse(code=100,message = "操作成功",response = StudentLoseVo.class)
})
public R getStudentLoseList(Long studentId, Integer type){
    return R.ok(studentLoseFollowService.getStudentLoseList( studentId,  type));
}
package com.skyedu.crm.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author 
 * @Description: 
 */
@Data
public class StudentLoseVo {
    @ApiModelProperty(value = "学生班级id")
    private Long studentCourseId;

    @ApiModelProperty(value = "学期")
    private String periodName;

    @ApiModelProperty(value = "学科")
    private String subjectName;

    @ApiModelProperty(value = "年级")
    private String gradeName;

    @ApiModelProperty(value = "层次")
    private String gradationName;

    @ApiModelProperty(value = "课程属性")
    private String classTypeName;

    @ApiModelProperty(value = "校区")
    private String campusName;

    @ApiModelProperty(value = "班级名称")
    private String courseName;

    @ApiModelProperty(value = "教师")
    private String teacherNames;

    @ApiModelProperty(value = "开课日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date beginDate;

    @ApiModelProperty(value = "结课日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endDate;

    @ApiModelProperty(value = "上课时间")
    private String classTime;

    @ApiModelProperty(value = "取消分班时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date cancelDate;
}

 swagger 返回参数注解_第1张图片

 

第二种

@ApiOperation(value = "学生跟进",response =StudentLoseFollow.class)

你可能感兴趣的:(java,swagger,后端,swagger,java)