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;
|
}
|
}
|