18034727885
2026-03-19 b008604e79528aecb04ae5d4ecc6245d8c6caf91
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package com.driver.igotrip.bean.websocket;
 
import com.driver.igotrip.BuildConfig;
import com.driver.igotrip.base.Const;
import com.driver.igotrip.netUtls.NetKitKt;
import com.driver.igotrip.utils.Cache.CacheKey;
 
import cn.sinata.xldutils.utils.SPUtils;
 
public class HeartBean {
    private int code = 200;
    private String msg = "SUCCESS";
    private String method = "PING";
    private DataBean data;
 
    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 String getMethod() {
        return method;
    }
 
    public void setMethod(String method) {
        this.method = method;
    }
 
    public DataBean getData() {
        return data;
    }
 
    public void setData(DataBean data) {
        this.data = data;
    }
 
    public static class DataBean{
        private int type = 2;
        private int language = 2;
        private int userId = NetKitKt.getUserId();
        private String token;
        private String device;
        private String version;
 
        public DataBean() {
            type = 2;
            language = getTypeByLanguage();
            userId =  NetKitKt.getUserId();
            token = CacheKey.INSTANCE.getToken();
            device = "phoneDevice";
            version = BuildConfig.VERSION_NAME;
        }
    }
 
    public static int getTypeByLanguage() {
        String lang = SPUtils.getString(Const.language);
        int type = 0;
        if (lang == null || lang.isEmpty() || lang.equals("en")){
            type = 2;
        }
        else if (lang.equals("ch") || lang.equals("zh")){
            type = 1;
        }
        else if (lang.equals("fr")){
            type = 3;
        }
        return type;
    }
}