加@Data
package com.itheima.education.content.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* User: ldj
* Date: 2023/4/18
* Time: 20:09
* Description: 课程查询条件模型类
*/
@Data
@ApiModel("课程查询入参模型")
public class QueryCourseParamsDto {
@ApiModelProperty("课程名称")
private String courseName;
@ApiModelProperty("审核状态")
private String auditStatus;
@ApiModelProperty("发布状态")
private String publishStatus;
}
1.spring- boot -swagger2-starter
<!-- Spring Boot 集成 swagger -->
<dependency>
<groupId>com.spring4all</groupId>
<artifactId>swagger-spring-boot-starter</artifactId>
<version>1.9.0.RELEASE</version>
</dependency>
2. bootstrap.yml
#swagger2 文档配置
swagger:
title: "内容管理系统"
description: "内容系统管理系统对课程相关信息进行业务管理数据"
base-package: com.itheima.education.content #(扫描模块Controller)
enabled: true
version: 1.0.0
3.启动类加@EnableSwagger2Docfamhe
package com.itheima.education.content;
import com.spring4all.swagger.EnableSwagger2Doc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
@EnableCaching
@EnableSwagger2Doc //开启swagger
@SpringBootApplication
public class ContentApiApplication {
public static void main(String[] args) {
SpringApplication.run(ContentApiApplication.class, args);
}
}