🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
``` public class Message{ private int code; private String statu; private Map<String, Object> data = new HashMap<String, Object>(); //成功 public static Message getSuccess() { Messageto message = new Message(); message.setCode(100); message.setStatu("成功"); return message ; } //失败 public static ToJson getFail() { Messageto message = new Message(); message .setCode(200); message .setStatu("失败"); return message ; } //钻石表达式 public Messageto putMap(String key, Object value) { this.getData().put(key, value); return this; } public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getStatu() { return statu; } public void setStatu(String statu) { this.statu = statu; } public Map<String, Object> getData() { return data; } public void setData(Map<String, Object> data) { this.data = data; } } ```