package com.hh.arome.mvp.model.base;

import com.google.gson.Gson;
import com.hh.arome.http.ApiService;

import okhttp3.MediaType;
import okhttp3.RequestBody;

/**
 * Date: 2022/5/27 0027 10:24
 * Description:
 */
public class BaseModel<T> {

    // 当前类名
    public String mTag = getClass().getSimpleName()+"--";

    public ApiService mApiService;

    public BaseModel(ApiService mApiService) {
        this.mApiService = mApiService;
    }

    public RequestBody createRequestBody(T t){
        RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(t));
        return body;
    }

}
