From 2086b90ce7de24d0ae10b9ba52180212fc100fab Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Sat, 8 Oct 2022 14:31:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BD=95app=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/api/AppController.java | 5 +++- .../ruoyi/common/utils/http/HttpUtils.java | 4 +-- .../java/com/ruoyi/system/domain/TRecord.java | 13 ++++++++++ .../ruoyi/system/domain/req/AIPostReqEx.java | 25 +++++++++++++++++++ .../resources/mapper/system/TRecordMapper.xml | 1 + 5 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AIPostReqEx.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java index c97895c..4ec562c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java @@ -417,8 +417,10 @@ public class AppController extends BaseController @ApiOperation("ai接口") @Log(title = "调用ai接口", businessType = BusinessType.OTHER) @Transactional - public AjaxResult aiPost(@PathVariable("recordId") Long recordId, @RequestBody AiPostReq aiPostReq) + public AjaxResult aiPost(@PathVariable("recordId") Long recordId, @RequestBody AIPostReqEx aiPostReqEx) { + AiPostReq aiPostReq = new AiPostReq(); + BeanUtils.copyProperties(aiPostReqEx, aiPostReq); //删除同一次预约调用多次ai接口的图片数据 logger.info("aiPost param is {}", aiPostReq); imageService.deleteTImageByThirdId(recordId); @@ -429,6 +431,7 @@ public class AppController extends BaseController TRecord tRecord = new TRecord(); tRecord.setId(recordId); tRecord.setStatus("1"); + tRecord.setAppDealTime(aiPostReqEx.getAppDealTime()); tRecordService.updateTRecord(tRecord); String result; Date start; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java index 633a768..dc9fa79 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java @@ -133,7 +133,7 @@ public class HttpUtils StringBuilder result = new StringBuilder(); try { -// log.info("sendPost - {}", url); + log.info("sendPost - {}", url); URL realUrl = new URL(url); URLConnection conn = realUrl.openConnection(); conn.setRequestProperty("accept", "*/*"); @@ -152,7 +152,7 @@ public class HttpUtils { result.append(line); } -// log.info("recv - {}", result); + log.info("recv - {}", result); } catch (ConnectException e) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java index c0b44da..95db218 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java @@ -89,6 +89,19 @@ public class TRecord extends BaseEntity */ private String delFlag; + /** + * app处理图片时长 + */ + private int appDealTime; + + public int getAppDealTime() { + return appDealTime; + } + + public void setAppDealTime(int appDealTime) { + this.appDealTime = appDealTime; + } + public String getDelFlag() { return delFlag; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AIPostReqEx.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AIPostReqEx.java new file mode 100644 index 0000000..e6341fe --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AIPostReqEx.java @@ -0,0 +1,25 @@ +package com.ruoyi.system.domain.req; + +import io.swagger.annotations.ApiModel; + +import java.util.Date; + +/** + * 接口请求实体 + * + * @author gongzhenkun + * @date 2022/10/8 11:44 + */ +@ApiModel(value = "AIPostReqEx", description = "AI接口请求实体") +public class AIPostReqEx extends AiPostReq{ + private int appDealTime; + + public int getAppDealTime() { + return appDealTime; + } + + public void setAppDealTime(int appDealTime) { + this.appDealTime = appDealTime; + } + +} diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index 72a1d1f..2cbe1fc 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -397,6 +397,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" response_time = #{responseTime}, ai_result_return_time = #{aiResultReturnTime}, ai_result_modify_time = #{aiResultModifyTime}, + app_deal_time = #{appDealTime}, del_flag = #{delFlag}, where id = #{id}