ai上传接口修改状态

master
chenfei 2 years ago
parent 3edea44031
commit 9436a2c889

@ -355,21 +355,24 @@ public class AppController extends BaseController
String URL = RequestParamsUtil.HTTP + ip + RequestParamsUtil.SEPARATOR + port + url; String URL = RequestParamsUtil.HTTP + ip + RequestParamsUtil.SEPARATOR + port + url;
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
String result; String result;
TRecord tRecord = new TRecord();
tRecord.setId(recordId);
tRecord.setStatus("1");
tRecordService.updateTRecord(tRecord);
try try
{ {
result = HttpUtils.sendPost(URL, mapper.writeValueAsString(aiPostReq)); result = HttpUtils.sendPost(URL, mapper.writeValueAsString(aiPostReq));
} }
catch (Exception e) catch (Exception e)
{ {
tRecord.setStatus("0");
tRecordService.updateTRecord(tRecord);
throw new ServiceException(e.getMessage()); throw new ServiceException(e.getMessage());
} }
if (!StringUtils.isEmpty(result)) if (!StringUtils.isEmpty(result))
{ {
jsonObject = removeBase64Image(JSONObject.parseObject(result),recordId); jsonObject = removeBase64Image(JSONObject.parseObject(result),recordId);
TRecord tRecord = new TRecord();
tRecord.setId(recordId);
tRecord.setStatus("1");
tRecord.setUpdateTime(new Date()); tRecord.setUpdateTime(new Date());
tRecord.setAiResult(JSONObject.toJSONString(jsonObject, SerializerFeature.WriteMapNullValue)); tRecord.setAiResult(JSONObject.toJSONString(jsonObject, SerializerFeature.WriteMapNullValue));
tRecord.setAiResult2(JSONObject.toJSONString(jsonObject, SerializerFeature.WriteMapNullValue)); tRecord.setAiResult2(JSONObject.toJSONString(jsonObject, SerializerFeature.WriteMapNullValue));

Loading…
Cancel
Save