|
|
@@ -10,6 +10,8 @@ import com.sheep.gamegroup.model.entity.SystemNotification;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.module.user.model.BuyVipReq;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
+import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
|
|
|
import java.lang.annotation.Retention;
|
|
|
import java.lang.annotation.RetentionPolicy;
|
|
|
@@ -26,6 +28,45 @@ public class ApiJSONUtil {
|
|
|
public static final int COMMENT_TYPE_GAME = 1;
|
|
|
public static final int COMMENT_TYPE_ARTICLE = 2;
|
|
|
public static final int COMMENT_TYPE_VIDEO = 3;
|
|
|
+// UserDeviceLog{
|
|
|
+// brand: string 手机品牌
|
|
|
+// device_id: string 设备ID/imei
|
|
|
+// device_name: string 设备名
|
|
|
+// mac_address: string 设备MAC地址
|
|
|
+// main_board: string 手机主板名
|
|
|
+// manufacturer: string 手机厂商名
|
|
|
+// model: string 手机型号
|
|
|
+// product: string 手机产品名
|
|
|
+// }
|
|
|
+ public static void postUserDeviceLog() {
|
|
|
+ String token = SpUtils.getToken(SheepApp.getInstance());
|
|
|
+ if(!TextUtils.isEmpty(token)){
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("brand",SysAppUtil.getDeviceBrand());
|
|
|
+ jsonObject.put("device_id", DeviceUtil.getDeviceId(SheepApp.getInstance()));
|
|
|
+ jsonObject.put("device_name",SysAppUtil.getDeviceDevice());
|
|
|
+ jsonObject.put("mac_address",SysAppUtil.getDeviceMac());
|
|
|
+ jsonObject.put("main_board",SysAppUtil.getDeviceBoard());
|
|
|
+ jsonObject.put("manufacturer",SysAppUtil.getDeviceManufacturer());
|
|
|
+ jsonObject.put("model",SysAppUtil.getDeviceModel());
|
|
|
+ jsonObject.put("product",SysAppUtil.getDeviceProduct());
|
|
|
+
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService().postUserDeviceLog(jsonObject)
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+ G.showToast(baseMessage);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
@IntDef({COMMENT_TYPE_GAME, COMMENT_TYPE_ARTICLE, COMMENT_TYPE_VIDEO})
|
|
|
@Retention(RetentionPolicy.SOURCE)
|