// Path: app/src/main/java/com/demo/amazing/net/action/Action.java
// public class Action {
// 
//     public static final int UNKNOWN_ACTION = -1;
// 
//     public static final int LINK_ACTION = 1;
// 
//     public static final int FAIL_ACTION = 2;
// 
//     public static final int VOTE_ACTION = 3;
// 
//     public static final int DESC_ACTION = 4;
// 
//     public int action;// 动作类型
// 
//     public String desc;
// 
//     public Action(int action) {
//         this.action = action;
//     }
// 
//     public Action(int action, String desc) {
//         this.action = action;
//         this.desc = desc;
//     }
// 
//     public static Action builder() {
//         return new Action(UNKNOWN_ACTION, null);
//     }
// }


import android.text.TextUtils;
import com.demo.amazing.net.action.Action;
import org.json.JSONException;
import org.json.JSONObject;
package com.demo.amazing.net.bean;




/**
 * Created by hzsunyj on 2017/8/30.
 */

public class LinkPing {

    public String linkData;

    public String linkPing() {
        if (!TextUtils.isEmpty(linkData)) {
            return linkData;
        }
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.putOpt("action", Action.LINK_ACTION);
            jsonObject.putOpt("desc", "heart beat");
        } catch (JSONException e) {
            e.printStackTrace();
        }

// Path: app/src/main/java/com/demo/amazing/net/action/Action.java
// public class Action {
// 
//     public static final int UNKNOWN_ACTION = -1;
// 
//     public static final int LINK_ACTION = 1;
// 
//     public static final int FAIL_ACTION = 2;
// 
//     public static final int VOTE_ACTION = 3;
// 
//     public static final int DESC_ACTION = 4;
// 
//     public int action;// 动作类型
// 
//     public String desc;
// 
//     public Action(int action) {
//         this.action = action;
//     }
// 
//     public Action(int action, String desc) {
//         this.action = action;
//         this.desc = desc;
//     }
// 
//     public static Action builder() {
//         return new Action(UNKNOWN_ACTION, null);
//     }
// }


// Path: app/src/main/java/com/demo/amazing/net/bean/LinkPing.java
import android.text.TextUtils;
import com.demo.amazing.net.action.Action;
import org.json.JSONException;
import org.json.JSONObject;

package com.demo.amazing.net.bean;




/**
 * Created by hzsunyj on 2017/8/30.
 */

public class LinkPing {

    public String linkData;

    public String linkPing() {
        if (!TextUtils.isEmpty(linkData)) {
            return linkData;
        }
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.putOpt("action", Action.LINK_ACTION);
            jsonObject.putOpt("desc", "heart beat");
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return linkData = jsonObject.toString();