diff --git a/hzims-service/inspect/pom.xml b/hzims-service/inspect/pom.xml index 461b216..6957e38 100644 --- a/hzims-service/inspect/pom.xml +++ b/hzims-service/inspect/pom.xml @@ -69,7 +69,6 @@ org.eclipse.paho org.eclipse.paho.client.mqttv3 - 1.2.1 com.xuxueli @@ -85,11 +84,11 @@ ehcache-core 2.6.9 - - io.minio - minio - 6.0.7 - + + + + + @@ -137,6 +136,11 @@ commons-compress 1.18 + + com.squareup.okhttp3 + okhttp + 4.9.3 + diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/RobotController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/RobotController.java index 740a04d..448a90b 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/RobotController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/RobotController.java @@ -29,6 +29,7 @@ import org.springblade.core.oss.OssTemplate; import org.springblade.core.oss.model.BladeFile; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; +import org.springblade.resource.feign.IOssClient; import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; import org.springframework.validation.annotation.Validated; @@ -56,7 +57,7 @@ import java.util.Optional; public class RobotController extends BladeController { private final IRobotService st_robotService; - private final OssTemplate ossTemplate; + private final IOssClient ossTemplate; /** @@ -147,9 +148,9 @@ public class RobotController extends BladeController { public R putFileMore(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file, @ApiParam(value = "其他参数,标准json格式", required = true) @RequestParam String jsonPara) { String type = file.getContentType(); - BladeFile bladeFile = ossTemplate.putFile(file); - bladeFile.setName(bladeFile.getName() + "; 上传的其他参数:" + jsonPara + "; type = " + type); - return R.data(bladeFile); + R bladeFile = ossTemplate.putFile(file); + bladeFile.getData().setName(bladeFile.getData().getName() + "; 上传的其他参数:" + jsonPara + "; type = " + type); + return bladeFile; } @PostMapping("/generateDeviceInstance") diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/RobotTaskController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/RobotTaskController.java index b4b0e78..4c43fbc 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/RobotTaskController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/controller/RobotTaskController.java @@ -17,6 +17,7 @@ import org.springblade.core.oss.model.BladeFile; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springblade.mqtt.producer.IMqttSender; +import org.springblade.resource.feign.IOssClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -40,7 +41,7 @@ import java.util.Map; public class RobotTaskController extends BladeController { private final IRobotTaskService robot_taskService; - private final OssTemplate ossTemplate; + private final IOssClient ossTemplate; // @Autowired // BladeLogger logger; @@ -155,7 +156,7 @@ public class RobotTaskController extends BladeController { @GetMapping("/putFileTest") @ApiOperation(value = "测试minio文件上传", notes = "测试minio文件上传") public R putFile(@ApiParam(value = "文件", required = true) @RequestParam MultipartFile file) { - return R.data(ossTemplate.putFile(file)); + return ossTemplate.putFile(file); } /** diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotTaskServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotTaskServiceImpl.java index d8f0ff4..9cbb33a 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotTaskServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/RobotTaskServiceImpl.java @@ -35,19 +35,19 @@ import com.hnac.hzinfo.inspect.ai.entity.RobotTaskEntity; import com.hnac.hzinfo.inspect.ai.mapper.RobotTaskMapper; import com.hnac.hzinfo.inspect.ai.service.IRobotTaskService; import org.springblade.core.mp.support.Condition; -import org.springblade.core.oss.OssTemplate; import org.springblade.core.oss.model.BladeFile; +import org.springblade.core.tool.api.R; import org.springblade.core.tool.jackson.JsonUtil; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.Func; import org.springblade.mqtt.producer.IMqttSender; +import org.springblade.resource.feign.IOssClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; - -import java.io.ByteArrayInputStream; import java.util.*; /** @@ -71,7 +71,7 @@ public class RobotTaskServiceImpl extends ServiceImpl bladeFile = ossTemplate.putFile(file); + handlePicData(object, bladeFile.getData().getLink()); break; case THERMAL: /** 热成像 */ handleThermalData(file, object); break; case IDENTIFY: - BladeFile bladeFile2 = ossTemplate.putFile(file); + R bladeFile2 = ossTemplate.putFile(file); /** 识别 */ - handleIdentifyData(object, bladeFile2.getLink()); + handleIdentifyData(object, bladeFile2.getData().getLink()); break; case VOICE: /** 声音 */ - BladeFile bladeFile3 = ossTemplate.putFile(file); - handleVoiceData(object, bladeFile3.getLink()); + R bladeFile3 = ossTemplate.putFile(file); + handleVoiceData(object, bladeFile3.getData().getLink()); break; } } @@ -567,8 +567,9 @@ public class RobotTaskServiceImpl extends ServiceImpl implements IUserFaceDataService { +public class UserFaceDataServiceImpl extends ServiceImpl implements IUserFaceDataService { @Autowired private FaceConfig config; @@ -86,15 +88,9 @@ public class UserFaceDataServiceImpl extends BaseServiceImpl { - System.out.println("获取人脸DATA失败:" + e.toString()); - })) - .asValue(FaceResponse.class); + String uri = config.baseAddUrl("/getcode"); + FaceResponse result = HttpClientUtils.post(uri,multipartBody,FaceResponse.class); + if(Func.isEmpty(result) || Func.isEmpty(result.getData())){ return null; }