package com.trc.mall; import java.io.Serializable; import java.util.List; /** * @author dy * @since 2016-12-01 & JDK 1.8.0_91 */ public class ResultModel<T> implements Serializable{ public static final String SUCCESS="success"; public static final String FAILED="failed"; /** * 接口调用是否成功 * ture 成功、false 失败 */ private boolean result = true; /** * 接口调用返回对象模型 */ private T model; /** * 接口调用失败code */ private String errorCode; /** * 接口调用信息 */ private String message; /** * 接口调用异常类 */ private Exception exception; public ResultModel() {} public ResultModel(boolean result,String errorCode,String message) { this.result = result; this.errorCode = errorCode; this.message = message; } public ResultModel(T model) { this.model = model; } get set 方法自己生成! }
转载于:https://my.oschina.net/dyyweb/blog/802291