cn.net.wanmo.common.result.HttpResult Maven / Gradle / Ivy
The newest version!
package cn.net.wanmo.common.result;
import cn.net.wanmo.common.constant.HttpStatus;
public class HttpResult extends DefaultResult {
@Override
public Integer defaultSuccessCode() {
return HttpStatus.SUCCESS;
}
@Override
public String defaultSuccessMsg() {
return "操作成功";
}
@Override
public Integer defaultErrorCode() {
return HttpStatus.ERROR;
}
@Override
public String defaultErrorMsg() {
return "操作失败";
}
@Override
public boolean isSuccess() {
int defaultSuccessCode = defaultSuccessCode();
int code = getCode();
return defaultSuccessCode == code;
}
}