package org.come.control; import org.come.action.FromServerAction; import org.come.entity.Goodstable; import org.come.until.GoodsListFromServerUntil; import org.come.until.GsonUtil; import com.tool.image.ImageMixDeal; public class AddGoodControl implements FromServerAction { @Override public void controlMessFromServer(String mes, String type) { // TODO Auto-generated method stub Goodstable goodstable = GsonUtil.getGsonUtil().getgson().fromJson(mes, Goodstable.class); if (goodstable.getRole_id().compareTo(ImageMixDeal.userimg.getRoleShow().getRole_id()) != 0) { return; } if (goodstable.getUsetime() == null) goodstable.setUsetime(1); goodstable.setStatus(0); GoodsListFromServerUntil.addGood(goodstable);
时间: 2023-05-12 07:02:43 浏览: 72
这是一个 Java 类的代码,它实现了一个名为 AddGoodControl 的控制器,实现了 FromServerAction 接口。它的主要功能是从服务器接收消息并处理,将 Goodstable 对象添加到 GoodsListFromServerUntil 中。其中,Goodstable 是一个实体类,包含了商品的各种属性,如角色 ID、使用时间和状态等。GsonUtil 是一个工具类,用于将 JSON 数据转换为 Java 对象。ImageMixDeal 是一个图像处理工具类,用于处理用户头像。
相关问题
import org.apache.http.httpentity;
import org.apache.http.httpentity; 是一个Java类库中的一个包,它提供了HTTP实体的相关类和接口,可以用于处理HTTP请求和响应中的实体部分。其中包括了一些常用的实体类型,如字符串实体、文件实体等,还提供了一些实体的编码和解码方法,方便开发者进行数据传输和处理。
org.springframework.http.HttpEntity
org.springframework.http.HttpEntity 是 Spring Framework 中的一个类,用于表示 HTTP 请求或响应的实体。它包含一个 body 属性,用于存储请求或响应的主体内容,以及一个 headers 属性,用于存储请求或响应的头信息。HttpEntity 通常用于在 Spring 中进行 HTTP 通信时,作为请求或响应的载体。例如,在使用 RestTemplate 进行 HTTP 请求时,可以使用 HttpEntity 作为请求的载体。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)