195 lines
4.4 KiB
Java
195 lines
4.4 KiB
Java
package com.eactive.httpmockserver;
|
|
|
|
import java.io.Serializable;
|
|
|
|
import javax.persistence.Column;
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.GeneratedValue;
|
|
import javax.persistence.GenerationType;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.Index;
|
|
import javax.persistence.Lob;
|
|
import javax.persistence.Table;
|
|
import javax.persistence.UniqueConstraint;
|
|
import javax.validation.constraints.Digits;
|
|
import javax.validation.constraints.NotBlank;
|
|
import javax.validation.constraints.Positive;
|
|
|
|
@SuppressWarnings("serial")
|
|
@Entity
|
|
@Table(uniqueConstraints = { @UniqueConstraint(columnNames = { "url", "serviceValue" }) }, indexes = {
|
|
@Index(name = "idxApiInfo01", columnList = "apiGroupName") })
|
|
public class ApiInfo implements Serializable {
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private Long id;
|
|
|
|
@NotBlank
|
|
@Column(length = 100, nullable = false)
|
|
private String apiGroupName;
|
|
|
|
@NotBlank
|
|
@Column(length = 100, nullable = false)
|
|
private String apiName;
|
|
|
|
@NotBlank
|
|
@Column(length = 200, nullable = false)
|
|
private String url;
|
|
|
|
@Column(length = 50)
|
|
private String serviceValue;
|
|
|
|
@NotBlank
|
|
@Column(length = 10)
|
|
private String method;
|
|
|
|
@Column(length = 50)
|
|
private String responseContentType;
|
|
|
|
@Column(length = 5000)
|
|
private String responseHeaders;
|
|
|
|
@Digits(fraction = 0, integer = 3)
|
|
private Integer responseStatusCode;
|
|
|
|
@Positive
|
|
private Integer sleepSeconds;
|
|
|
|
@Column(length = 50)
|
|
private String syntaxResponseBody1;
|
|
|
|
@Column
|
|
@Lob
|
|
private String responseBody1;
|
|
|
|
@Column(length = 50)
|
|
private String syntaxResponseBody2;
|
|
|
|
@Column
|
|
@Lob
|
|
private String responseBody2;
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getApiGroupName() {
|
|
return apiGroupName;
|
|
}
|
|
|
|
public void setApiGroupName(String apiGroupName) {
|
|
this.apiGroupName = apiGroupName;
|
|
}
|
|
|
|
public String getApiName() {
|
|
return apiName;
|
|
}
|
|
|
|
public void setApiName(String apiName) {
|
|
this.apiName = apiName;
|
|
}
|
|
|
|
public String getUrl() {
|
|
return url;
|
|
}
|
|
|
|
public void setUrl(String url) {
|
|
this.url = url;
|
|
}
|
|
|
|
public String getServiceValue() {
|
|
return serviceValue;
|
|
}
|
|
|
|
public void setServiceValue(String serviceValue) {
|
|
this.serviceValue = serviceValue;
|
|
}
|
|
|
|
public String getMethod() {
|
|
return method;
|
|
}
|
|
|
|
public void setMethod(String method) {
|
|
this.method = method;
|
|
}
|
|
|
|
public String getResponseContentType() {
|
|
return responseContentType;
|
|
}
|
|
|
|
public void setResponseContentType(String responseContentType) {
|
|
this.responseContentType = responseContentType;
|
|
}
|
|
|
|
public String getResponseHeaders() {
|
|
return responseHeaders;
|
|
}
|
|
|
|
public void setResponseHeaders(String responseHeaders) {
|
|
this.responseHeaders = responseHeaders;
|
|
}
|
|
|
|
public Integer getResponseStatusCode() {
|
|
return responseStatusCode;
|
|
}
|
|
|
|
public void setResponseStatusCode(Integer responseStatusCode) {
|
|
this.responseStatusCode = responseStatusCode;
|
|
}
|
|
|
|
public Integer getSleepSeconds() {
|
|
return sleepSeconds;
|
|
}
|
|
|
|
public void setSleepSeconds(Integer sleepSeconds) {
|
|
this.sleepSeconds = sleepSeconds;
|
|
}
|
|
|
|
public String getResponseBody1() {
|
|
return responseBody1;
|
|
}
|
|
|
|
public void setResponseBody1(String responseBody1) {
|
|
this.responseBody1 = responseBody1;
|
|
}
|
|
|
|
public String getResponseBody2() {
|
|
return responseBody2;
|
|
}
|
|
|
|
public void setResponseBody2(String responseBody2) {
|
|
this.responseBody2 = responseBody2;
|
|
}
|
|
|
|
public String getSyntaxResponseBody1() {
|
|
return syntaxResponseBody1;
|
|
}
|
|
|
|
public void setSyntaxResponseBody1(String syntaxResponseBody1) {
|
|
this.syntaxResponseBody1 = syntaxResponseBody1;
|
|
}
|
|
|
|
public String getSyntaxResponseBody2() {
|
|
return syntaxResponseBody2;
|
|
}
|
|
|
|
public void setSyntaxResponseBody2(String syntaxResponseBody2) {
|
|
this.syntaxResponseBody2 = syntaxResponseBody2;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "ApiInfo{" + "id=" + id + ", apiGroupName='" + apiGroupName + '\'' + ", apiName='" + apiName + '\''
|
|
+ ", url='" + url + '\'' + ", serviceValue='" + serviceValue + '\'' + ", method='" + method + '\''
|
|
+ ", responseContentType='" + responseContentType + '\'' + ", responseHeaders='" + responseHeaders
|
|
+ '\'' + ", responseStatusCode=" + responseStatusCode + ", sleepSeconds=" + sleepSeconds
|
|
+ ", syntaxResponseBody1='" + syntaxResponseBody1 + '\'' + ", responseBody1='" + responseBody1 + '\''
|
|
+ ", syntaxResponseBody2='" + syntaxResponseBody2 + '\'' + ", responseBody2='" + responseBody2 + '\''
|
|
+ '}';
|
|
}
|
|
}
|