|
@@ -14,10 +14,7 @@ import com.genersoft.iot.vmp.service.IDeviceChannelService;
|
|
|
import com.genersoft.iot.vmp.service.IDeviceService;
|
|
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
|
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
|
|
-import com.genersoft.iot.vmp.vmanager.bean.AiLib;
|
|
|
-import com.genersoft.iot.vmp.vmanager.bean.BaseTree;
|
|
|
-import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
|
|
-import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
|
|
+import com.genersoft.iot.vmp.vmanager.bean.*;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
@@ -32,6 +29,7 @@ import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.context.request.async.DeferredResult;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.sip.InvalidArgumentException;
|
|
@@ -75,6 +73,7 @@ public class DeviceQuery {
|
|
|
@Autowired
|
|
|
private SubscribeHolder subscribeHolder;
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 使用ID查询国标设备
|
|
|
* @param deviceId 国标ID
|
|
@@ -110,15 +109,41 @@ public class DeviceQuery {
|
|
|
@Operation(summary = "设备使用ai配置")
|
|
|
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
|
|
@Parameter(name = "configId", description = "配置id", required = true)
|
|
|
+ @Parameter(name = "arithmetic", description = "算法标记", required = true)
|
|
|
@GetMapping("/useAi/{deviceId}/{configId}")
|
|
|
- public int devUseConfig(@PathVariable String deviceId,@PathVariable int configId){
|
|
|
+ public int devUseConfig(@PathVariable String deviceId,@PathVariable int configId,@RequestParam int arithmetic){
|
|
|
if (logger.isDebugEnabled()) {
|
|
|
logger.debug("设备使用ai配置");
|
|
|
}
|
|
|
- return storager.devUseAiConfig(deviceId,configId);
|
|
|
+ return storager.devUseAiConfig(deviceId,configId,arithmetic);
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Operation(summary = "添加lib元素")
|
|
|
+ @Parameter(name = "libraryId", description = "lib库id", required = true)
|
|
|
+ @Parameter(name = "itemName", description = "名称,用户名称或者车辆名称",required = true)
|
|
|
+ @Parameter(name = "itemNo", description = "标记号,用于车牌或者工号",required = true)
|
|
|
+ @Parameter(name = "img", description = "图像数据")
|
|
|
+ @Parameter(name = "idCard", description = "身份证号",required = false)
|
|
|
+ @Parameter(name = "carNo", description = "车牌号",required = false)
|
|
|
+ @PostMapping("/addLibItem/{libraryId}")
|
|
|
+ public String addLibItem(
|
|
|
+ @PathVariable int libraryId,
|
|
|
+ @RequestParam(value="img", required = false) MultipartFile file,
|
|
|
+ @RequestParam String itemName,
|
|
|
+ @RequestParam String itemNo,
|
|
|
+ @RequestParam(value="idCard", required = false) String idCard,
|
|
|
+ @RequestParam(value="carNo", required = false) String carNo
|
|
|
+ ){
|
|
|
+ if (logger.isDebugEnabled()) {
|
|
|
+ logger.debug("新增算法库成员");
|
|
|
+ }
|
|
|
+ String card = "";
|
|
|
+ if(idCard != null){card = idCard;}
|
|
|
+ else if(carNo != null){card = carNo;}
|
|
|
+ return storager.addLibItem(libraryId,itemName,itemNo,card,file);
|
|
|
+ }
|
|
|
+
|
|
|
@Operation(summary = "ai数据库查询")
|
|
|
@GetMapping("/aiLibrary")
|
|
|
public List<AiLib> aiLibrary(){
|
|
@@ -138,33 +163,7 @@ public class DeviceQuery {
|
|
|
}
|
|
|
|
|
|
// allowEmptyValue
|
|
|
- @Operation(summary = "添加ai库配置文件")
|
|
|
- @Parameter(name = "aiConfig", description = "配置数据", required = true)
|
|
|
-// @Parameter(name = "configName", description = "配置名称", required = true)
|
|
|
-// @Parameter(name = "arithmetic", description = "算法id")
|
|
|
-// @Parameter(name = "triggerType", description = "触发类型")
|
|
|
-// @Parameter(name = "refreshTime", description = "刷新时间")
|
|
|
-// @Parameter(name = "score", description = "检测阈值",allowEmptyValue = true)
|
|
|
-// @Parameter(name = "resourcePath", description = "资源数据更新获取地址",allowEmptyValue = true)
|
|
|
-// @Parameter(name = "uploadUrl", description = "多媒体资源上传地址",allowEmptyValue = true)
|
|
|
-// @Parameter(name = "pushUrl", description = "回调地址",allowEmptyValue = true)
|
|
|
- @PostMapping("/addAiConfig")
|
|
|
- public int addAiConfig(@RequestBody AiConfig aiConfig){
|
|
|
- if (logger.isDebugEnabled()) {
|
|
|
- logger.debug("创建ai配置");
|
|
|
- }
|
|
|
- return storager.addAiConfig(
|
|
|
- aiConfig.getConfigName(),
|
|
|
- aiConfig.getArithmetic(),
|
|
|
- aiConfig.getTriggerType(),
|
|
|
- aiConfig.getLibraryId(),
|
|
|
- aiConfig.getRefreshTime(),
|
|
|
- aiConfig.getScore(),
|
|
|
- aiConfig.getResourcePath(),
|
|
|
- aiConfig.getUploadUrl(),
|
|
|
- aiConfig.getPushUrl());
|
|
|
-// return 1;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 分页查询国标设备
|