展连设备数据解析策略
This commit is contained in:
@ -41,10 +41,11 @@ public class RenKeAuthorizationService {
|
||||
HttpResponse response = HttpRequest.post(AUTH_URL)
|
||||
.body(JSONUtil.toJsonStr(reqBody)).execute();
|
||||
String resultObjectStr = response.body();
|
||||
if(StringUtils.isBlank(response.toString())){
|
||||
throw new RuntimeException("获取token失败!");
|
||||
}
|
||||
|
||||
JSONObject resultObject = JSONUtil.parseObj(resultObjectStr);
|
||||
if(!resultObject.get("code").toString().equals("1000")){
|
||||
throw new RuntimeException("仁科获取token失败!");
|
||||
}
|
||||
JSONObject tokenObject = JSONUtil.parseObj(resultObject.get("data"));
|
||||
int currDate = Integer.parseInt(tokenObject.get("currDate").toString());
|
||||
int expDate = Integer.parseInt(tokenObject.get("expDate").toString());
|
||||
|
@ -5,8 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Data;
|
||||
import lombok.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
@ -22,6 +21,9 @@ import java.util.Date;
|
||||
*/
|
||||
@ApiModel(value = "DeviceRealtimedataWorms",description = "虫情设备实时数据 iot_device_realtimedata_worms")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("iot_device_realtimedata_worms")
|
||||
public class DeviceRealtimedataWorms extends BaseEntity
|
||||
|
Reference in New Issue
Block a user