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;
JSONObject jsonObject = new JSONObject();
String result;
TRecord tRecord = new TRecord();
tRecord.setId(recordId);
tRecord.setStatus("1");
tRecordService.updateTRecord(tRecord);
try
{
result = HttpUtils.sendPost(URL, mapper.writeValueAsString(aiPostReq));
}
catch (Exception e)
{
tRecord.setStatus("0");
tRecordService.updateTRecord(tRecord);
throw new ServiceException(e.getMessage());
}
if (!StringUtils.isEmpty(result))
{
jsonObject = removeBase64Image(JSONObject.parseObject(result),recordId);
TRecord tRecord = new TRecord();
tRecord.setId(recordId);
tRecord.setStatus("1");
tRecord.setUpdateTime(new Date());
tRecord.setAiResult(JSONObject.toJSONString(jsonObject, SerializerFeature.WriteMapNullValue));
tRecord.setAiResult2(JSONObject.toJSONString(jsonObject, SerializerFeature.WriteMapNullValue));

Loading…
Cancel
Save