修改添加系统模特到个人lib接口和保存模特接口
This commit is contained in:
@@ -24,6 +24,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -69,7 +70,7 @@ public class LibraryModelPointServiceImpl extends ServiceImpl<LibraryModelPointM
|
||||
// 当前模特路径
|
||||
String url = libraryModelPointDTO.getModelPath();
|
||||
// 标志是否有更改过模特比例(即更换模特图)
|
||||
boolean flag = url.equals(libModel.getUrl());
|
||||
boolean flag = !url.equals(libModel.getUrl());
|
||||
|
||||
if (libraryModelPointDTO.getIsCovered() && Objects.nonNull(libraryModelPointDTO.getTemplateId())){
|
||||
// 覆盖保存,即更新原有数据(点位数据和模特图片)
|
||||
@@ -102,6 +103,8 @@ public class LibraryModelPointServiceImpl extends ServiceImpl<LibraryModelPointM
|
||||
saveAsModel.setAccountId(libModel.getAccountId());
|
||||
saveAsModel.setLevel1Type(libModel.getLevel1Type());
|
||||
saveAsModel.setLevel2Type(libModel.getLevel2Type());
|
||||
String ageGroup = StringUtil.isNullOrEmpty(libModel.getLevel3Type()) ? "Adult" : libModel.getLevel3Type();
|
||||
saveAsModel.setLevel3Type(ageGroup);
|
||||
saveAsModel.setName(DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD));
|
||||
saveAsModel.setUrl(url);
|
||||
saveAsModel.setMd5(MD5Utils.encryptFile(minioUtil.getPreSignedUrl(url, CommonConstant.MINIO_IMAGE_EXPIRE_TIME), false));
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.exceptions.ExceptionUtil;
|
||||
import com.ai.da.common.config.FileProperties;
|
||||
import com.ai.da.common.config.exception.BusinessException;
|
||||
import com.ai.da.common.constant.CommonConstant;
|
||||
import com.ai.da.common.context.UserContext;
|
||||
import com.ai.da.common.enums.*;
|
||||
import com.ai.da.common.response.PageBaseResponse;
|
||||
@@ -842,7 +843,7 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long addSysModelToLib(long sysModelId) {
|
||||
public Map<String, String> addSysModelToLib(long sysModelId) {
|
||||
Long accountId = UserContext.getUserHolder().getId();
|
||||
SysFile sysFile = sysFileMapper.selectById(sysModelId);
|
||||
if (Objects.isNull(sysFile)) {
|
||||
@@ -871,6 +872,9 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
||||
sysModelPoint.setCreateDate(new Date());
|
||||
libraryModelPointService.save(sysModelPoint);
|
||||
|
||||
return library.getId();
|
||||
Map<String, String> resp = new HashMap<>();
|
||||
resp.put("id", library.getId().toString());
|
||||
resp.put("url", minioUtil.getPreSignedUrl(library.getUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||
return resp;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user