BUGFIX: like detail;

This commit is contained in:
shahaibo
2023-10-18 16:51:08 +08:00
parent 4b28732d32
commit 201b188579
2 changed files with 9 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ import com.ai.da.common.response.PageBaseResponse;
import com.ai.da.common.response.PageResponse;
import com.ai.da.common.response.Response;
import com.ai.da.common.utils.CopyUtil;
import com.ai.da.common.utils.MinioUtil;
import com.ai.da.mapper.entity.Account;
import com.ai.da.mapper.entity.Collection;
import com.ai.da.mapper.entity.UserLikeGroup;
@@ -46,6 +47,8 @@ public class SavedCollectionController {
private UserLikeService userLikeService;
@Resource
private AccountService accountService;
@Resource
private MinioUtil minioUtil;
@ApiOperation(value = "History用户分页分组列表")
@PostMapping("/queryUserGroup")
@@ -84,6 +87,9 @@ public class SavedCollectionController {
userLikeGroupVO.setAuthor(account.getUserName());
//count 和detail
List<UserLikeVO> details = groupDetailMap.get(group.getId());
for (UserLikeVO detail : details) {
detail.setUrl(minioUtil.getPresignedUrl(detail.getUrl(), 24 * 60));
}
userLikeGroupVO.setGroupDetails(details);
userLikeGroupVO.setSketchCount(CollectionUtils.isEmpty(details) ? 0 :details.size());
return userLikeGroupVO;

View File

@@ -225,7 +225,7 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
MediaType mediaType = MediaType.parse("application/json");
//关闭FastJson的引用检测 防止出现$ref 现象
String param = JSON.toJSONString(modelPathObject, SerializerFeature.DisableCircularReferenceDetect);
log.info("design请求python 参数:####{}", param);
log.info("processMannequins请求python 参数:####{}", param);
RequestBody body = RequestBody.create(mediaType, param);
Request request = new Request.Builder()
.url("http://18.167.251.121:9991/api/model_process")
@@ -238,12 +238,12 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
try {
response = client.newCall(request).execute();
} catch (IOException ioException) {
log.error("PythonService##design异常###{}", ExceptionUtil.getThrowableList(ioException));
log.error("PythonService##processMannequins异常###{}", ExceptionUtil.getThrowableList(ioException));
}
//去除限流
// AccessLimitUtils.validateOut("design");
if (Objects.isNull(response)) {
log.error("PythonService##design异常###{}", "response or body is empty!");
log.error("PythonService##processMannequins异常###{}", "response or body is empty!");
throw new BusinessException("system error!");
}
if (response.isSuccessful()) {