Commit 210696b9 authored by tianbo's avatar tianbo

城燃管道图片算法调用feignclient修改

parent b62cfc07
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.ugp.biz.fegin.MaasServiceFeignClient; import com.yeejoin.amos.boot.module.ugp.biz.fegin.MaasServiceFeignClient;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify; import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -135,6 +136,9 @@ public class AttachmentController extends BaseController { ...@@ -135,6 +136,9 @@ public class AttachmentController extends BaseController {
@Autowired @Autowired
MaasServiceFeignClient maasServiceFeignClient; MaasServiceFeignClient maasServiceFeignClient;
@Value("${maas.service.ocr.id}")
String ocrServiceId;
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/test") @GetMapping(value = "/test")
@ApiOperation(httpMethod = "Get",value="测试",notes= "测试") @ApiOperation(httpMethod = "Get",value="测试",notes= "测试")
...@@ -145,7 +149,7 @@ public class AttachmentController extends BaseController { ...@@ -145,7 +149,7 @@ public class AttachmentController extends BaseController {
url.put("url", urlPath); url.put("url", urlPath);
urls.add(url); urls.add(url);
param.put("data", urls); param.put("data", urls);
ResponseModel<Object> result = maasServiceFeignClient.getPatrolDangerInfo(param); ResponseModel<Object> result = maasServiceFeignClient.execProcessApiByServiceId(param);
String resultStr = JSONObject.parseObject(JSONObject.toJSONString(result.getResult())).getJSONObject("result1").getJSONArray("rows").getJSONObject(0).getString("ocrResult"); String resultStr = JSONObject.parseObject(JSONObject.toJSONString(result.getResult())).getJSONObject("result1").getJSONArray("rows").getJSONObject(0).getString("ocrResult");
return ResponseHelper.buildResponse(resultStr); return ResponseHelper.buildResponse(resultStr);
} }
......
...@@ -16,15 +16,13 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -16,15 +16,13 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
{MultipartSupportConfig.class}) {MultipartSupportConfig.class})
public interface MaasServiceFeignClient { public interface MaasServiceFeignClient {
String ocrServiceId = "0a456d67-5e12-48af-8923-ccc447d4cb2b";
/** /**
* 获取图片识别数据 * 获取图片识别数据
* *
* @param param * @param param
* @return * @return
*/ */
@RequestMapping(value = "/maas/processes/api/" + ocrServiceId, method = RequestMethod.POST) @RequestMapping(value = "/maas/processes/api/" + "${maas.service.ocr.id}", method = RequestMethod.POST)
ResponseModel<Object> getPatrolDangerInfo(@RequestBody Object param); ResponseModel<Object> execProcessApiByServiceId(@RequestBody Object param);
} }
...@@ -1244,7 +1244,7 @@ return jsonArray; ...@@ -1244,7 +1244,7 @@ return jsonArray;
url.put("url", urlPath); url.put("url", urlPath);
urls.add(url); urls.add(url);
param.put("data", urls); param.put("data", urls);
ResponseModel<Object> result = maasServiceFeignClient.getPatrolDangerInfo(param); ResponseModel<Object> result = maasServiceFeignClient.execProcessApiByServiceId(param);
String resultStr = JSONObject.parseObject(JSONObject.toJSONString(result.getResult())).getJSONObject("result1").getJSONArray("rows").getJSONObject(0).getString("ocrResult"); String resultStr = JSONObject.parseObject(JSONObject.toJSONString(result.getResult())).getJSONObject("result1").getJSONArray("rows").getJSONObject(0).getString("ocrResult");
return resultStr; return resultStr;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment