| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.MessageFormat; |
| | | import java.util.ArrayList; |
| | |
| | | * iot接口调用工具类 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | @RestController |
| | | public class IotInterfaceUtil { |
| | | |
| | | private static final String dataFormat = "json"; |
| | |
| | | |
| | | private String decodeUrl(String url) { |
| | | return MessageFormat.format(url, iotDAConfig.getProjectId()); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | * 创建设备 |
| | | * @param productId 产品ID |
| | | * @param nodeId 设备标识码 通常使用IMEI、MAC地址或Serial No作为node_id |
| | | * @param deviceId 设备ID 使用CodeGenerateUtils.generateVolumeSn() |
| | | * @param deviceId 设备ID 使用设备标识码 |
| | | * @param deviceName 设备名称 |
| | | * @param description 设备描述 |
| | | * @return AddDeviceResponse |