package com.police.policedatasystem.improve.viewmodel;

import androidx.annotation.NonNull;

import com.google.gson.Gson;
import com.police.policedatasystem.data.activity.KeyPersonDetailActivity;
import com.police.policedatasystem.data.activity.PoliceEmergencyDetailActivity;
import com.police.policedatasystem.data.fragment.DataFragment;
import com.police.policedatasystem.data.model.DataCount;
import com.police.policedatasystem.data.model.KeyPerson;
import com.police.policedatasystem.data.model.KeyPersonDetail;
import com.police.policedatasystem.data.model.PoliceEmergency;
import com.police.policedatasystem.data.model.PoliceEmergencyDetail;
import com.police.policedatasystem.http.CustomCallBack;
import com.police.policedatasystem.http.requestparams.GetKeyPersonListParams;
import com.police.policedatasystem.http.requestparams.GetOrgKeyPersonListParams;
import com.police.policedatasystem.http.requestparams.GetPoliceEmergencyListParams;
import com.police.policedatasystem.improve.fragment.ImproveFragment;
import com.police.policedatasystem.indexActivity;
import com.police.policedatasystem.util.Constants;
import com.police.policedatasystem.util.UiUtils;

import java.util.List;

import okhttp3.Call;

public class ImproveViewModel {
    private final ImproveFragment fragment;
    public int pageNum = 1;
    public indexActivity activity;

    public ImproveViewModel(ImproveFragment fragment, indexActivity activity) {
        this.fragment = fragment;
        this.activity = activity;
    }

    public void keyPersonInit() {
//        fragment.loadingShow();
        pageNum = 1;
//        fragment.personList.clear();
        //加载数据
//        GetKeyPersonListParams params = new GetKeyPersonListParams();
//        params.setPageNum(pageNum + "");
//        if (fragment.filterType == 0) {
//            params.setXm(fragment.binding.etInput.getText().toString());
//        } else {
//            params.setSfzh(fragment.binding.etInput.getText().toString());
//        }
//        activity.requestClient.getKeyPerson(params, new CustomCallBack<List<KeyPerson>>() {
//            @Override
//            public void onError(@NonNull Call call, @NonNull Exception e) {
//                UiUtils.toast(e.getMessage());
//                fragment.loadingNone();
//            }
//
//            @Override
//            public void onSuccess(List<KeyPerson> value) {
//                fragment.loadingNone();
//                if (value != null) {
//                    fragment.personList.addAll(value);
//                }
//                fragment.adapter.notifyDataSetChanged();
//            }
//        });
    }

}
