This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
package com.aicheck;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
/**
|
||||
* 单个接口参数的模型,对应 Controller 方法上的一个入参。
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class ApiParameter {
|
||||
|
||||
/** 参数名称(@RequestParam / @PathVariable 的 value,或字段名) */
|
||||
private String name;
|
||||
|
||||
/** Java 类型,如 String、Long、Boolean */
|
||||
private String type;
|
||||
|
||||
/** 是否必填(来自 required 属性或 @NotNull 等,默认 true) */
|
||||
private boolean required = true;
|
||||
|
||||
/** 参数来源:query / path / body / header / form */
|
||||
private String source;
|
||||
|
||||
/** 参数说明(来自 @ApiParam、@Parameter 等注解的 description) */
|
||||
private String description;
|
||||
|
||||
public ApiParameter() {
|
||||
}
|
||||
|
||||
public ApiParameter(String name, String type, boolean required, String source) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.required = required;
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public boolean isRequired() {
|
||||
return required;
|
||||
}
|
||||
|
||||
public void setRequired(boolean required) {
|
||||
this.required = required;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user