Package org.jeecgframework.core.common.model.json

Source Code of org.jeecgframework.core.common.model.json.AjaxJson

package org.jeecgframework.core.common.model.json;

import java.util.Map;

import com.alibaba.fastjson.JSONObject;

/**
* $.ajax后需要接受的JSON
*
* @author
*
*/
public class AjaxJson {

  private boolean success = true;// 是否成功
  private String msg = "操作成功";// 提示信息
  private Object obj = null;// 其他信息
  private Map<String, Object> attributes;// 其他参数
  public Map<String, Object> getAttributes() {
    return attributes;
  }

  public void setAttributes(Map<String, Object> attributes) {
    this.attributes = attributes;
  }

  public String getMsg() {
    return msg;
  }

  public void setMsg(String msg) {
    this.msg = msg;
  }

  public Object getObj() {
    return obj;
  }

  public void setObj(Object obj) {
    this.obj = obj;
  }

  public boolean isSuccess() {
    return success;
  }

  public void setSuccess(boolean success) {
    this.success = success;
  }
  public String getJsonStr(){
    JSONObject obj = new JSONObject();
    obj.put("success", this.isSuccess());
    obj.put("msg", this.getMsg());
    obj.put("obj", this.obj);
    obj.put("attributes", this.attributes);
    return obj.toJSONString();
  }
}
TOP

Related Classes of org.jeecgframework.core.common.model.json.AjaxJson

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.