parent
9127574316
commit
f2e70b9378
@ -0,0 +1,121 @@
|
|||||||
|
package com.example.zxweb.common.constant.enums;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: IOT设备API接口路径
|
||||||
|
* @author: ZhouWenTao
|
||||||
|
* @date: 2023/9/8 12:05
|
||||||
|
*/
|
||||||
|
public enum IotApiPathsEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取单个设备信息 GET,query
|
||||||
|
*/
|
||||||
|
get_devices("/devices", "获取单个设备信息"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设备列表 GET,query
|
||||||
|
*/
|
||||||
|
get_devices_list("/devices/list", "获取设备列表"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向设备发送消息 POST,body
|
||||||
|
*/
|
||||||
|
post_devices_datastreams("/devices/datastreams", "向设备发送消息"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备历史数据 GET
|
||||||
|
*/
|
||||||
|
get_devices_datastreams("/devices/datastreams", "查询设备历史数据"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询消息是否下达到设备 GET
|
||||||
|
*/
|
||||||
|
get_devices_datastreams_state("/devices/datastreams/state", "查询消息是否下达到设备"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询事件历史数据 GET
|
||||||
|
*/
|
||||||
|
get_devices_events("/devices/events", "查询事件历史数据"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向设备发送方法 POST,body
|
||||||
|
*/
|
||||||
|
post_devices_methods("/devices/methods", "向设备发送方法"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询方法历史数据 GET
|
||||||
|
*/
|
||||||
|
get_devices_methods("/devices/methods", "查询方法历史数据"),
|
||||||
|
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址
|
||||||
|
*/
|
||||||
|
String path;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
String text;
|
||||||
|
|
||||||
|
|
||||||
|
public String getPath() {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPath(String path) {
|
||||||
|
this.path = path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getText(){
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setText(String text) {
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造器
|
||||||
|
*
|
||||||
|
* @param path 地址
|
||||||
|
* @param text 描述
|
||||||
|
*/
|
||||||
|
IotApiPathsEnum(String path, String text) {
|
||||||
|
this.path = path;
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据描述匹配
|
||||||
|
*
|
||||||
|
* @param path 请求地址
|
||||||
|
* @return String 描述
|
||||||
|
*/
|
||||||
|
public static String getTextByPath(String path){
|
||||||
|
for (IotApiPathsEnum e : IotApiPathsEnum.values()) {
|
||||||
|
if (path.startsWith(e.getPath())) {
|
||||||
|
return e.getText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据路径描述获取路径
|
||||||
|
* @param text 描述
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getPathByText(String text){
|
||||||
|
for (IotApiPathsEnum e : IotApiPathsEnum.values()) {
|
||||||
|
if (text.startsWith(e.getText())) {
|
||||||
|
return e.getPath();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
package com.example.zxweb.controller;
|
||||||
|
|
||||||
|
import com.example.zxweb.common.api.vo.Result;
|
||||||
|
import com.example.zxweb.common.constant.enums.IotApiPathsEnum;
|
||||||
|
import com.example.zxweb.utils.AssertUtils;
|
||||||
|
import com.example.zxweb.utils.IotUtils;
|
||||||
|
import com.example.zxweb.utils.RestUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description
|
||||||
|
* @Author ZhouWenTao
|
||||||
|
* @Date 2023/9/8 11:43
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/iot")
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "设备管理")
|
||||||
|
public class IotController {
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取单个设备信息")
|
||||||
|
@GetMapping(value = "/devices")
|
||||||
|
public Result<?> devices(@RequestParam(value = "serial",defaultValue = "")String serial,@RequestParam(value = "productId",defaultValue = "")String productId){
|
||||||
|
AssertUtils.notEmpty(serial,"请输入-[serial]");AssertUtils.notEmpty(productId,"请输入-[productId]");
|
||||||
|
Map<String,Object> queryData=new LinkedHashMap<>();
|
||||||
|
queryData.put("serial",serial);
|
||||||
|
queryData.put("productId",productId);
|
||||||
|
//请求数据
|
||||||
|
return Result.OK(IotUtils.getApi(IotApiPathsEnum.getPathByText("获取单个设备信息"),queryData));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
package com.example.zxweb.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.zxweb.common.api.vo.Result;
|
||||||
|
import com.example.zxweb.common.constant.enums.IotApiPathsEnum;
|
||||||
|
import com.example.zxweb.utils.AssertUtils;
|
||||||
|
import com.example.zxweb.utils.IotUtils;
|
||||||
|
import com.example.zxweb.utils.RmsUtils;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 访客机
|
||||||
|
* @Author ZhouWenTao
|
||||||
|
* @Date 2023/9/8 13:16
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/rms")
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "访客机")
|
||||||
|
public class RmsController {
|
||||||
|
@ApiOperation(value = "访客查询")
|
||||||
|
@PostMapping(value = "/fkterminal/findAccessRecord")
|
||||||
|
public Result<?> fkterminalFindAccessRecord(@RequestBody JSONObject requestBody){
|
||||||
|
JSONObject responseBody = RmsUtils.fkterminalFindAccessRecord(requestBody);
|
||||||
|
responseBody.remove("msg");
|
||||||
|
responseBody.remove("code");
|
||||||
|
responseBody.remove("success");
|
||||||
|
return Result.OK(responseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "访客预约")
|
||||||
|
@PostMapping(value = "/sync/orderrecord")
|
||||||
|
public Result<?> syncOrderrecord(@RequestBody JSONObject requestBody){
|
||||||
|
JSONObject responseBody = RmsUtils.syncOrderrecord(requestBody);
|
||||||
|
responseBody.remove("msg");
|
||||||
|
responseBody.remove("code");
|
||||||
|
responseBody.remove("success");
|
||||||
|
return Result.OK(responseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "访客注销")
|
||||||
|
@PostMapping(value = "/fkterminal/recoverCard")
|
||||||
|
public Result<?> fkterminalRecoverCard(@RequestBody JSONObject requestBody){
|
||||||
|
JSONObject responseBody = RmsUtils.fkterminalRecoverCard(requestBody);
|
||||||
|
responseBody.remove("msg");
|
||||||
|
responseBody.remove("code");
|
||||||
|
responseBody.remove("success");
|
||||||
|
return Result.OK(responseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package com.example.zxweb.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: bussiness自定义401异常
|
||||||
|
* @Author ZhouWenTao
|
||||||
|
* @Date 2023/9/8 11:46
|
||||||
|
*/
|
||||||
|
public class Business401Exception extends RuntimeException {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public Business401Exception(String message){
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Business401Exception(Throwable cause)
|
||||||
|
{
|
||||||
|
super(cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Business401Exception(String message, Throwable cause)
|
||||||
|
{
|
||||||
|
super(message,cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package com.example.zxweb.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 自定义异常
|
||||||
|
* @Author ZhouWenTao
|
||||||
|
* @Date 2023/9/8 11:46
|
||||||
|
*/
|
||||||
|
public class BusinessException extends RuntimeException {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public BusinessException(String message){
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BusinessException(Throwable cause)
|
||||||
|
{
|
||||||
|
super(cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BusinessException(String message, Throwable cause)
|
||||||
|
{
|
||||||
|
super(message,cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package com.example.zxweb.utils;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.example.zxweb.common.constant.enums.IotApiPathsEnum;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description ios 设备请求工具
|
||||||
|
* @Author ZhouWenTao
|
||||||
|
* @Date 2023/9/8 11:59
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class IotUtils {
|
||||||
|
//请求服务地址
|
||||||
|
private static final String API_PREFIX = "https://10.0.10.153:2443/api/iot/v1";
|
||||||
|
|
||||||
|
public static JSONObject getApi(String apiUrl,Map<String,Object> queryData) {
|
||||||
|
StringBuilder sb=new StringBuilder();
|
||||||
|
int i=0;
|
||||||
|
for (String field : queryData.keySet()) {
|
||||||
|
String value = (String) queryData.get(field);
|
||||||
|
sb.append(i==0?"?":"&");
|
||||||
|
sb.append(field).append("=").append(value);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
JSONObject jsonObject = RestUtil.get(API_PREFIX+apiUrl + sb);
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
package com.example.zxweb.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description
|
||||||
|
* @Author ZhouWenTao
|
||||||
|
* @Date 2023/9/8 11:46
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel(value="获取单个设备信息入参", description="获取单个设备信息入参")
|
||||||
|
public class QueryDevicesVO implements Serializable {
|
||||||
|
@ApiModelProperty(value = "设备序列号")
|
||||||
|
public String serial;
|
||||||
|
@ApiModelProperty(value = "产品序列号")
|
||||||
|
public String productId;
|
||||||
|
}
|
||||||
@ -0,0 +1,510 @@
|
|||||||
|
{
|
||||||
|
"swagger": "2.0",
|
||||||
|
"info": {
|
||||||
|
"version": "v1",
|
||||||
|
"title": "设备管理"
|
||||||
|
},
|
||||||
|
"tags": [],
|
||||||
|
"basePath": "",
|
||||||
|
"paths": {
|
||||||
|
"/api/iot/v1/devices": {
|
||||||
|
"get": {
|
||||||
|
"summary": "获取单个设备信息",
|
||||||
|
"description": "",
|
||||||
|
"parameters": [{
|
||||||
|
"name": "serial",
|
||||||
|
"in": "query",
|
||||||
|
"description": "设备序列号",
|
||||||
|
"required": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "productId",
|
||||||
|
"description": "产品序列号",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
}],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "成功"
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "失败,请求不合法"
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "失败,请求参数不合法"
|
||||||
|
},
|
||||||
|
"444": {
|
||||||
|
"description": "失败,出现了业务错误"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/iot/v1/devices/list": {
|
||||||
|
"get": {
|
||||||
|
"summary": "获取设备列表",
|
||||||
|
"description": "",
|
||||||
|
"parameters": [{
|
||||||
|
"name": "serial",
|
||||||
|
"in": "query",
|
||||||
|
"description": "产品序列号",
|
||||||
|
"required": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "modelCode",
|
||||||
|
"description": "设备类型",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "authority",
|
||||||
|
"description": "设备属性",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "pageSize",
|
||||||
|
"description": "分页大小",
|
||||||
|
"required": false,
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "pageNo",
|
||||||
|
"description": "分页序号",
|
||||||
|
"required": false,
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "startTime",
|
||||||
|
"description": "开始时间",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "endTime",
|
||||||
|
"description": "结束时间",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "sort",
|
||||||
|
"description": "排序",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
}],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "成功"
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "失败,请求不合法"
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "失败,请求参数不合法"
|
||||||
|
},
|
||||||
|
"444": {
|
||||||
|
"description": "失败,出现了业务错误"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/iot/v1/devices/datastreams": {
|
||||||
|
"post": {
|
||||||
|
"summary": "向设备发送消息",
|
||||||
|
"description": "",
|
||||||
|
"parameters": [{
|
||||||
|
"in": "body",
|
||||||
|
"name": "body",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["dataStreamInfo"],
|
||||||
|
"properties": {
|
||||||
|
"dataStreamInfo": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["productId",
|
||||||
|
"serial",
|
||||||
|
"dataStreams"],
|
||||||
|
"properties": {
|
||||||
|
"productId": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "产品序列号"
|
||||||
|
},
|
||||||
|
"serial": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "设备序列号"
|
||||||
|
},
|
||||||
|
"dataStreams": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["streamName",
|
||||||
|
"streamValue"],
|
||||||
|
"properties": {
|
||||||
|
"streamName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "数据流名称"
|
||||||
|
},
|
||||||
|
"streamValue": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "数据流值"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
"responses": {
|
||||||
|
"201": {
|
||||||
|
"description": "成功"
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "失败,请求不合法"
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "失败,请求参数不合法"
|
||||||
|
},
|
||||||
|
"444": {
|
||||||
|
"description": "失败,出现了业务错误"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"get": {
|
||||||
|
"summary": "查询设备历史数据",
|
||||||
|
"description": "",
|
||||||
|
"parameters": [{
|
||||||
|
"in": "query",
|
||||||
|
"name": "serial",
|
||||||
|
"description": "设备序列号",
|
||||||
|
"required": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "dataStreamName",
|
||||||
|
"description": "数据流能力名称",
|
||||||
|
"required": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "productId",
|
||||||
|
"description": "产品序列号",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "pageSize",
|
||||||
|
"description": "分页大小",
|
||||||
|
"required": false,
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "pageNo",
|
||||||
|
"description": "分页序列号",
|
||||||
|
"required": false,
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "startTime",
|
||||||
|
"description": "开始时间",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "endTime",
|
||||||
|
"description": "结束时间",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "sort",
|
||||||
|
"description": "排序",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
}],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "成功"
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "失败,请求不合法"
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "失败,请求参数不合法"
|
||||||
|
},
|
||||||
|
"444": {
|
||||||
|
"description": "失败,出现了业务错误"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/iot/v1/devices/datastreams/state": {
|
||||||
|
"get": {
|
||||||
|
"summary": "查询消息是否下达到设备",
|
||||||
|
"description": "",
|
||||||
|
"parameters": [{
|
||||||
|
"in": "query",
|
||||||
|
"name": "serial",
|
||||||
|
"description": "设备序列号",
|
||||||
|
"required": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "streamCinId",
|
||||||
|
"description": "能力实例序列号",
|
||||||
|
"required": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "productId",
|
||||||
|
"description": "产品序列号",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
}],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "成功"
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "失败,请求不合法"
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "失败,请求参数不合法"
|
||||||
|
},
|
||||||
|
"444": {
|
||||||
|
"description": "失败,出现了业务错误"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/iot/v1/devices/events": {
|
||||||
|
"get": {
|
||||||
|
"summary": "查询事件历史数据",
|
||||||
|
"description": "",
|
||||||
|
"parameters": [{
|
||||||
|
"in": "query",
|
||||||
|
"name": "serial",
|
||||||
|
"description": "设备序列号",
|
||||||
|
"required": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "dataStreamName",
|
||||||
|
"description": "数据流能力名称",
|
||||||
|
"required": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "productId",
|
||||||
|
"description": "产品序列号",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "pageSize",
|
||||||
|
"description": "分页大小",
|
||||||
|
"required": false,
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "pageNo",
|
||||||
|
"description": "分页序列号",
|
||||||
|
"required": false,
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "startTime",
|
||||||
|
"description": "开始时间",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "endTime",
|
||||||
|
"description": "结束时间",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "sort",
|
||||||
|
"description": "排序",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
}],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "成功"
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "失败,请求不合法"
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "失败,请求参数不合法"
|
||||||
|
},
|
||||||
|
"444": {
|
||||||
|
"description": "失败,出现了业务错误"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/iot/v1/devices/methods": {
|
||||||
|
"post": {
|
||||||
|
"summary": "向设备发送方法",
|
||||||
|
"description": "",
|
||||||
|
"parameters": [{
|
||||||
|
"in": "body",
|
||||||
|
"name": "body",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["serial",
|
||||||
|
"methodName",
|
||||||
|
"inputData"],
|
||||||
|
"properties": {
|
||||||
|
"serial": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "设备序列号"
|
||||||
|
},
|
||||||
|
"productId": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "产品序列号"
|
||||||
|
},
|
||||||
|
"methodName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "方法名称"
|
||||||
|
},
|
||||||
|
"inputData": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "方法参数"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
"responses": {
|
||||||
|
"201": {
|
||||||
|
"description": "success"
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "error, request is invalid."
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "error, request parameter is invalid."
|
||||||
|
},
|
||||||
|
"444": {
|
||||||
|
"description": "error, exception occurred."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"get": {
|
||||||
|
"summary": "查询方法历史数据",
|
||||||
|
"description": "",
|
||||||
|
"parameters": [{
|
||||||
|
"in": "query",
|
||||||
|
"name": "serial",
|
||||||
|
"description": "设备序列号",
|
||||||
|
"required": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "methodName",
|
||||||
|
"description": "方法名称",
|
||||||
|
"required": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "productId",
|
||||||
|
"description": "产品序列号",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "pageSize",
|
||||||
|
"description": "分页大小",
|
||||||
|
"required": false,
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "pageNo",
|
||||||
|
"description": "分页序列号",
|
||||||
|
"required": false,
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "startTime",
|
||||||
|
"description": "开始时间",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "endTime",
|
||||||
|
"description": "结束时间",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "sort",
|
||||||
|
"description": "排序",
|
||||||
|
"required": false,
|
||||||
|
"type": "string"
|
||||||
|
}],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "成功"
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "失败,请求不合法"
|
||||||
|
},
|
||||||
|
"422": {
|
||||||
|
"description": "失败,请求参数不合法"
|
||||||
|
},
|
||||||
|
"444": {
|
||||||
|
"description": "失败,出现了业务错误"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
"definitions": {}
|
||||||
|
}
|
||||||
Loading…
Reference in new issue