com.gitee.easyopen.ApiResultCreator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of easyopen-mini Show documentation
Show all versions of easyopen-mini Show documentation
easyopen mini版,保留基本签名校验,文档功能。https://gitee.com/durcframework/easyopen
package com.gitee.easyopen;
/**
* 负责对返回结果进行封装
*
* @author tanghc
*
*/
public class ApiResultCreator implements ResultCreator {
@Override
public Result createResult(Object returnObj) {
return new ApiResult(returnObj);
}
@Override
public Result createErrorResult(Object code, String errorMsg, Object data) {
Result ret = new ApiResult();
ret.setCode(code);
ret.setMsg(errorMsg);
ret.setData(data);
return ret;
}
}