¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.entity.all; |
| | | |
| | | /** |
| | | * ååºæ¶æ¯ç±» |
| | | * @author www |
| | | * @param <T> æ³å |
| | | */ |
| | | public class ResponseMsg<T> { |
| | | public ResponseMsg() { |
| | | this.time = System.currentTimeMillis(); |
| | | } |
| | | |
| | | public ResponseMsg(HttpStatus code, T result) { |
| | | this.code = code.getValue(); |
| | | this.msg = this.code == 200 ? "æå" : "失败"; |
| | | this.result = result; |
| | | this.time = System.currentTimeMillis(); |
| | | } |
| | | |
| | | public ResponseMsg(HttpStatus code, String msg, T result) { |
| | | this.code = code.getValue(); |
| | | this.msg = msg; |
| | | this.result = result; |
| | | this.time = System.currentTimeMillis(); |
| | | } |
| | | |
| | | public ResponseMsg(int code, String msg, T result, long time) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | this.result = result; |
| | | this.time = time; |
| | | } |
| | | |
| | | public ResponseMsg(HttpStatus code, long count, T result) { |
| | | this.code = code.getValue(); |
| | | this.msg = this.code == 200 ? "æå" : "失败"; |
| | | this.count = count; |
| | | this.result = result; |
| | | this.time = System.currentTimeMillis(); |
| | | } |
| | | |
| | | public ResponseMsg(HttpStatus code, String msg, long count, T result) { |
| | | this.code = code.getValue(); |
| | | this.msg = msg; |
| | | this.count = count; |
| | | this.result = result; |
| | | this.time = System.currentTimeMillis(); |
| | | } |
| | | |
| | | public ResponseMsg(int code, String msg, long count, T result, long time) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | this.count = count; |
| | | this.result = result; |
| | | this.time = time; |
| | | } |
| | | |
| | | private int code; |
| | | |
| | | private String msg; |
| | | |
| | | private long count; |
| | | |
| | | private T result; |
| | | |
| | | private long time; |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public long getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(long count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public T getResult() { |
| | | return result; |
| | | } |
| | | |
| | | public void setResult(T result) { |
| | | this.result = result; |
| | | } |
| | | |
| | | public long getTime() { |
| | | return time; |
| | | } |
| | | |
| | | public void setTime(long time) { |
| | | this.time = time; |
| | | } |
| | | } |