Commit 7051b506 authored by sml's avatar sml

公共实体与响应编码

parent 03867c3e
package com.jz.common.bean;
import java.util.List;
/**
* @author ybz
*
*/
public class BaseBeanResponse<T> extends BaseResponse {
private T data;
private List<T> datas;
public BaseBeanResponse(){
super();
}
public BaseBeanResponse(String code, T data) {
super(code);
this.data = data;
}
public BaseBeanResponse(String code, List<T> datas) {
super(code);
this.datas = datas;
}
public BaseBeanResponse(String code, String message, T data) {
super(code, message);
this.data = data;
}
public BaseBeanResponse(String code, String message, List<T> datas) {
super(code, message);
this.datas = datas;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
public List<T> getDatas() {
return datas;
}
public void setDatas(List<T> datas) {
this.datas = datas;
}
}
package com.jz.common.bean;
/**分页信息封装
* @author ybz
*
*/
public class BasePageBean {
private int pageNum = 1;
private int pageSize = 10;
public int getPageNum() {
return pageNum;
}
public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
}
package com.jz.common.bean;
/**
* @author ybz
*
*/
public class BaseResponse {
//错误码
private String code;
//错误消息
private String message;
public BaseResponse() {}
public BaseResponse(String code) {
this.code = code;
}
public BaseResponse(String code, String message) {
this.code = code;
this.message = message;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.jz.common.bean;
import com.github.pagehelper.PageInfo;
/**
* @author ybz
*
*/
public class PageInfoResponse<T> extends BaseResponse {
private PageInfo<T> data;
public PageInfo<T> getData() {
return data;
}
public void setData(PageInfo<T> data) {
this.data = data;
}
}
package com.jz.common.constant;
/**常量
* @author ybz
*
*/
public class Constants {
public final static String SUCCESS_CODE = "200";
public final static String FAILURE_CODE = "201";
/*****************************************************************************/
//第三方请求返回结果码定义
public static String CODE_SUCCESS = "000";
public static String MSG_SUCCESS = "操作成功";
public static String CODE_ERROR_REQUESTMETHOD = "100";
public static String MSG_ERROR_REQUESTMETHOD = "请求方式错误(只支持POST方式请求)";
public static String CODE_ERROR_PARAMETER = "101";
public static String MSG_ERROR_PARAMETER = "参数不正确(格式不正确或必填参数为空)";
public static String CODE_ERROR_CITYCODE = "102";
public static String MSG_ERROR_CITYCODE = "城市区域代码错误";
public static String CODE_NOT_SIGNED = "103";
public static String MSG_NOT_SIGNED = "尚未登录或者登录已过期";
public static String CODE_DATA_EXISTED = "106";
public static String MSG_DATA_EXISTED = "企业已备案,请勿重复备案";
public static String CODE_ERROR_USERNAMEORPASSWD = "107";
public static String MSG_ERROR_USERNAMEORPASSWD = "用户名或密码错误";
public static String CODE_USER_LOGGEDOFF = "108";
public static String MSG_USER_LOGGEDOFF = "用户已注销";
public static String CODE_DATA_NOTMEET = "201";
public static String MSG_DATA_NOTMEET = "数据不符合业务处理要求";
public static String CODE_SYS_EXCEPTION = "500";
public static String MSG_SYS_EXCEPTION = "系统异常,请联系接口提供方";
/*****************************************************************************/
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment