Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@


public class ApiException extends Exception{
private int code;
public ApiException (int code, String msg) {
super(msg);
this.code = code;
}
private int code;
public ApiException (int code, String msg) {
super(msg);
this.code = code;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@


public class ApiOriginFilter implements javax.servlet.Filter {
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse res = (HttpServletResponse) response;
res.addHeader("Access-Control-Allow-Origin", "*");
res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
res.addHeader("Access-Control-Allow-Headers", "Content-Type");
chain.doFilter(request, response);
}
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse res = (HttpServletResponse) response;
res.addHeader("Access-Control-Allow-Origin", "*");
res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
res.addHeader("Access-Control-Allow-Headers", "Content-Type");
chain.doFilter(request, response);
}

public void destroy() {}
public void destroy() {}

public void init(FilterConfig filterConfig) throws ServletException {}
}
public void init(FilterConfig filterConfig) throws ServletException {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,65 @@
@javax.xml.bind.annotation.XmlRootElement

public class ApiResponseMessage {
public static final int ERROR = 1;
public static final int WARNING = 2;
public static final int INFO = 3;
public static final int OK = 4;
public static final int TOO_BUSY = 5;
public static final int ERROR = 1;
public static final int WARNING = 2;
public static final int INFO = 3;
public static final int OK = 4;
public static final int TOO_BUSY = 5;

int code;
String type;
String message;
public ApiResponseMessage(){}
public ApiResponseMessage(int code, String message){
this.code = code;
switch(code){
case ERROR:
setType("error");
break;
case WARNING:
setType("warning");
break;
case INFO:
setType("info");
break;
case OK:
setType("ok");
break;
case TOO_BUSY:
setType("too busy");
break;
default:
setType("unknown");
break;
}
this.message = message;
}
int code;
String type;
String message;
public ApiResponseMessage(){}
public ApiResponseMessage(int code, String message){
this.code = code;
switch(code){
case ERROR:
setType("error");
break;
case WARNING:
setType("warning");
break;
case INFO:
setType("info");
break;
case OK:
setType("ok");
break;
case TOO_BUSY:
setType("too busy");
break;
default:
setType("unknown");
break;
}
this.message = message;
}

@XmlTransient
public int getCode() {
return code;
}
@XmlTransient
public int getCode() {
return code;
}

public void setCode(int code) {
this.code = code;
}
public void setCode(int code) {
this.code = code;
}

public String getType() {
return type;
}
public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}
public void setType(String type) {
this.type = type;
}

public String getMessage() {
return message;
}
public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}
public void setMessage(String message) {
this.message = message;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@


public class NotFoundException extends ApiException {
private int code;
public NotFoundException (int code, String msg) {
super(code, msg);
this.code = code;
}
private int code;
public NotFoundException (int code, String msg) {
super(code, msg);
this.code = code;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Category {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
Expand All @@ -30,7 +30,7 @@ public void setId(Long id) {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("name")
public String getName() {
return name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ModelApiResponse {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("code")
public Integer getCode() {
return code;
Expand All @@ -31,7 +31,7 @@ public void setCode(Integer code) {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("type")
public String getType() {
return type;
Expand All @@ -43,7 +43,7 @@ public void setType(String type) {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("message")
public String getMessage() {
return message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public String toString() {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
Expand All @@ -59,7 +59,7 @@ public void setId(Long id) {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("petId")
public Long getPetId() {
return petId;
Expand All @@ -71,7 +71,7 @@ public void setPetId(Long petId) {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("quantity")
public Integer getQuantity() {
return quantity;
Expand All @@ -83,7 +83,7 @@ public void setQuantity(Integer quantity) {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("shipDate")
public DateTime getShipDate() {
return shipDate;
Expand All @@ -96,7 +96,7 @@ public void setShipDate(DateTime shipDate) {
* Order Status
**/

@ApiModelProperty(example = "null", value = "Order Status")
@ApiModelProperty(value = "Order Status")
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
Expand All @@ -108,7 +108,7 @@ public void setStatus(StatusEnum status) {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("complete")
public Boolean getComplete() {
return complete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public String toString() {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
Expand All @@ -61,7 +61,7 @@ public void setId(Long id) {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("category")
public Category getCategory() {
return category;
Expand All @@ -86,7 +86,7 @@ public void setName(String name) {
/**
**/

@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
@JsonProperty("photoUrls")
@NotNull
public List<String> getPhotoUrls() {
Expand All @@ -99,7 +99,7 @@ public void setPhotoUrls(List<String> photoUrls) {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("tags")
public List<Tag> getTags() {
return tags;
Expand All @@ -112,7 +112,7 @@ public void setTags(List<Tag> tags) {
* pet status in the store
**/

@ApiModelProperty(example = "null", value = "pet status in the store")
@ApiModelProperty(value = "pet status in the store")
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Tag {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
Expand All @@ -30,7 +30,7 @@ public void setId(Long id) {
/**
**/

@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
@JsonProperty("name")
public String getName() {
return name;
Expand Down
Loading