Files
AI-Check-Test/.gitea/java-parser/src/main/java/com/aicheck/ApiParameter.java
dongzi 556f5b8ab6
Some checks failed
API Parameter Change Check / api-param-check (push) Failing after 3s
test
2026-06-03 15:02:21 +08:00

76 lines
1.7 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
}
}