在Json解析过程中,我为什么用object1.optInt ,和 object1.optString

本文深入探讨了深度学习技术在音视频处理领域的应用,涵盖了从图像处理AR特效到AI音视频处理等多个方面,详细阐述了各种深度学习模型在解决实际问题中的优势与挑战。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://www.cnblogs.com/zhaoyanjun/p/4818763.html
package com.lc.bailingbird.conn; import android.content.Context; import android.text.TextUtils; import android.util.Log; import com.google.gson.Gson; import com.lc.bailingbird.base.BaseApplication; import com.lc.bailingbird.util.TextUtil; import com.zcx.helper.http.AsyGet; import com.zcx.helper.http.note.HttpFinish; import com.zcx.helper.http.note.HttpServer; import org.json.JSONObject; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import okhttp3.Headers; /** * Created by Administrator on 2017/2/3. */ @HttpFinish(true) @HttpServer(Conn.SERVICE_LT) public class BaseAsyGetLT<T> extends AsyGet<T> { private Context context; public BaseAsyGetLT(BaseAsyCallBack<T> asyCallBack) { super(asyCallBack); context = asyCallBack.context; } /** * 解析响应头数据,会在parser前被调用 * * @param headers */ @Override protected void parserHeaders(Headers headers) { if (!TextUtils.isEmpty(headers.get("token"))) { Log.e("parserHeaders: ", headers.get("token")); // BaseApplication.MYMMKV.encode("token", headers.get("token")); header("token", "63633bd12e294da5b7dcf949ac526d75"); } } @Override protected T parser(JSONObject object) throws Exception { TOAST = object.optString("message"); if (object.optInt("code") == 0) { Type[] types = ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments(); return new Gson().fromJson(object.toString(), types[0]); } else if (object.optInt("code") == -200 || object.optInt("code") == -201) { BaseApplication.MYMMKV.encode("token", ""); BaseApplication.MYMMKV.encode("uid", ""); } return null; } @Override public void execute(boolean isShow) { super.execute(context,isShow); } @Override public void execute() { super.execute(context); } @Override public void execute(Context context, boolean isShow, int type, Object object) { if (!TextUtil.isNull(BaseApplication.MYMMKV.decodeString("token", ""))) { header("token", BaseApplication.MYMMKV.decodeString("token", "")); } super.execute(context, isShow, type, object); } } 在这个里面怎么获取我给后台接口传的值
最新发布
07-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值