com.hn.doc.xyj.domain.DocContent Maven / Gradle / Ivy
package com.hn.doc.xyj.domain;
import cn.hutool.core.util.StrUtil;
import java.util.ArrayList;
import java.util.List;
/**
* 文档内容
*/
public class DocContent {
/**
* 请求方法
*/
private String requestMethod;
/**
* 请求数据类型
*/
private String dataType;
/**
* 响应类型
*/
private String contentType = "JSON";
/**
* 请求参数
*/
private List requestArgs = new ArrayList<>();
/**
* 请求头
*/
private List requestHeaders = new ArrayList<>();
/**
* 响应头
*/
private List responseHeaders = new ArrayList<>();
/**
* 响应数据
*/
private List responseArgs = new ArrayList<>();
/**
* 请求地址
*/
private String url;
/**
* 状态 有效 废弃
*/
private String status = "有效";
/**
* 示例数据
*/
private String example;
/**
* 接口描述
*/
private String description;
public static DocContent create(){
return new DocContent();
}
public DocContent setRequestArg(DocData docData) {
requestArgs.add(docData);
return this;
}
public DocContent setRequestHeaderArg(DocData docData) {
requestHeaders.add(docData);
return this;
}
public DocContent setResponseHeaderArg(DocData docData) {
responseHeaders.add(docData);
return this;
}
public DocContent setResponseArg(DocData docData) {
responseArgs.add(docData);
return this;
}
public String getRequestMethod() {
if (StrUtil.isBlank(requestMethod)) {
return "POST";
}
return requestMethod;
}
public void setRequestMethod(String requestMethod) {
this.requestMethod = requestMethod;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public List getRequestArgs() {
return requestArgs;
}
public void setRequestArgs(DocData... requestArgs) {
this.requestArgs = DocData.createList(requestArgs);
}
public void setRequestArgs(List docDatas) {
this.requestArgs = docDatas;
}
public List getRequestHeaders() {
return requestHeaders;
}
public void setRequestHeaders(DocData... requestHeaders) {
this.requestHeaders = DocData.createList(requestHeaders);
}
public List getResponseHeaders() {
return responseHeaders;
}
public void setResponseHeaders(DocData... responseHeaders) {
this.responseHeaders = DocData.createList(responseHeaders);
}
public List getResponseArgs() {
return responseArgs;
}
public void setResponseArgs(DocData... responseArgs) {
this.responseArgs = DocData.createList(responseArgs);
}
public void setResponseArgs(List docDatas) {
this.responseArgs = docDatas;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getExample() {
return example;
}
public void setExample(String example) {
this.example = example;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy