Skip to content

Instantly share code, notes, and snippets.

@greenyleaf
Last active June 19, 2020 12:53
Show Gist options
  • Save greenyleaf/b0643eb6781d705450eb50cfca6a5abe to your computer and use it in GitHub Desktop.
Save greenyleaf/b0643eb6781d705450eb50cfca6a5abe to your computer and use it in GitHub Desktop.
Response entity class for returning messages after uploading files from CKEditor 4.
package top.sdrkyj.custom.dto;
import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.NON_NULL)
public class CkMsg {
/**
* null is permitted。 the filename for the uploaded file
*/
private String fileName;
/**
* 0 or null for failure, 1 for success.
*/
private Integer uploaded;
/**
* thr URL to access the uploaded file
*/
private String url;
/**
* Message returned when upload fails。 Optional on success.
*/
private ErrorMsg error;
@JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.NON_NULL)
public static class ErrorMsg {
/**
* Message text
*/
private String message;
public ErrorMsg() {
}
public ErrorMsg(String message) {
this.message = message;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public Integer getUploaded() {
return uploaded;
}
public void setUploaded(Integer uploaded) {
this.uploaded = uploaded;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public ErrorMsg getError() {
return error;
}
public void setError(ErrorMsg error) {
this.error = error;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment