对比新文件 |
| | |
| | | package com.gk.firework.Domain.Utils; |
| | | |
| | | import com.gk.firework.Domain.Enum.ErrorCode; |
| | | |
| | | public class Msg { |
| | | private String code; |
| | | |
| | | private String message; |
| | | |
| | | private Object result; |
| | | |
| | | 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; |
| | | } |
| | | |
| | | public Object getResult() { |
| | | return result; |
| | | } |
| | | |
| | | public void setResult(Object result) { |
| | | this.result = result; |
| | | } |
| | | |
| | | public Msg() { |
| | | } |
| | | |
| | | public Msg(String code, String message) { |
| | | this.code = code; |
| | | this.message = message; |
| | | } |
| | | |
| | | public Msg(boolean init){ |
| | | if (init){ |
| | | this.code = ErrorCode.SUCCESS.getCode(); |
| | | this.message = ErrorCode.SUCCESS.getMsg(); |
| | | }else { |
| | | this.code = ErrorCode.ERROR_999.getCode(); |
| | | this.message = ErrorCode.ERROR_999.getMsg(); |
| | | } |
| | | } |
| | | |
| | | public Msg(ErrorCode errorCode){ |
| | | this.setCode(errorCode.getCode()); |
| | | this.setMessage(errorCode.getMsg()); |
| | | } |
| | | |
| | | public Msg(ErrorCode errorCode,String msg){ |
| | | this.setCode(errorCode.getCode()); |
| | | this.setMessage(errorCode.getMsg()+":"+msg); |
| | | } |
| | | |
| | | public Msg(String code, String message, Object result) { |
| | | this.code = code; |
| | | this.message = message; |
| | | this.result = result; |
| | | } |
| | | } |