当前位置:网站首页>xutils3传集合
xutils3传集合
2022-06-29 23:15:00 【xiyangyang8110】
入参是集合,就这样传
核心:
params.addBodyParameter("collectionDtoList", collectionDtoList);
都是集合的名字
List<CancelCollectBean.CollectionDtoListDTO> collectionDtoList = new ArrayList<>();
CancelCollectBean.CollectionDtoListDTO collectionDtoListDTO = new CancelCollectBean.CollectionDtoListDTO();
collectionDtoListDTO.setCollectionType(1);
collectionDtoListDTO.setTypeId(professionInfo.getData().getRecords().get(position).getProductId());
collectionDtoList.add(collectionDtoListDTO);
RequestParams params = new RequestParams(Constant.delCollection);
params.addHeader("Authorization", Constant.authorization);
params.addHeader("language", Constant.system_language);
params.setAsJsonContent(true);
收藏类型,1:商品,2:服务,3:SPU,4:专家,5,:品牌
// params.addBodyParameter("collectionType", 4);
// // expertRemarkName 专家备注名
params.addBodyParameter("expertRemarkName", "lbb");
// // 收藏对象ID。收藏商品时传商品ID,收藏服务时传服务ID,收藏SPU时传SpuId,收藏专家时传专家id
// params.addBodyParameter("typeId", professionInfo.getData().get(position).getExpertId());
params.addBodyParameter("collectionDtoList", collectionDtoList);
Log.e("wy", "249onViewCreated params: " + params);
x.http().post(params, new Callback.CommonCallback<String>() {
@Override
public void onSuccess(String result) {
LoveBean professionInfo = JSON.parseObject(result, LoveBean.class);
if (professionInfo.getCode().equals("00000000")) {
Toast.makeText(x.app(), R.string.cancels, Toast.LENGTH_SHORT).show();
getData(keywords);
} else {
Toast.makeText(x.app(), professionInfo.getMsg(), Toast.LENGTH_LONG).show();
startActivity(new Intent(ShopCustomSearchNewActivity.this, LoginActivity.class));
}
}
@Override
public void onError(Throwable ex, boolean isOnCallback) {
Log.e("wy", "result: " + ex.getMessage());
}
@Override
public void onCancelled(CancelledException cex) {
Toast.makeText(x.app(), "cancelled", Toast.LENGTH_LONG).show();
}
@Override
public void onFinished() {
}
});
边栏推荐
猜你喜欢

NRM explanation

Sword finger offer 38 Arrangement of strings

redis客户端

Leetcode 1385. 两个数组间的距离值

Matplotlib plt Hist() parameter explanation

Head on Amway! Good looking and practical motor SolidWorks model material see here

Discussion on distributed unique ID generation scheme

收藏!这些提高程序员生产力的工具你用过吗?

二叉树的序列化 力扣 297. 二叉树的序列化与反序列化 652. 寻找重复的子树

软件测试 接口测试 Jmeter 5.5 安装教程
随机推荐
111. simple chat room 14: chat room client
GWD: rotating target detection based on Gaussian Wasserstein distance | ICML 2021
2022 PMP project management examination agile knowledge points (5)
Provide effective performance evaluation 
Cacti最大监控数测试
Mysql database: read write separation
为什么 JSX 语法这么香?
二叉树的序列化 力扣 297. 二叉树的序列化与反序列化 652. 寻找重复的子树
Under the epidemic, I left my job for a year, and my income increased 10 times
Mysql database: use the show profile command to analyze performance
How to solve the problem that the computer time is not automatically updated after proofreading
Leetcode(633)——平方数之和
nrm详解
Evaluation of powerful and excellent document management software: image management, book management and document management
matplotlib matplotlib中plt.hist()参数解释
关于 Apache 的 25 个初中级面试题
搭建企业级NTP时间服务器
软件测试 接口测试 Postman测试工具 接口测试的流程 执行接口测试 接口关联 环境变量和全局变量 内置动态参数以及自动有的动态参数
Database - playful data -pgsql uses UUID as primary key
Solr basic operation 2