|
@@ -5,7 +5,6 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.io.FileTypeUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
-import cn.hutool.json.JSON;
|
|
|
import cn.hutool.json.JSONArray;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -23,12 +22,13 @@ import edu.travel.commodity.mapper.ShopReviewMapper;
|
|
|
import edu.travel.commodity.service.ShopReviewService;
|
|
|
import edu.travel.commodity.utils.*;
|
|
|
import edu.travel.remote.dto.AddReviewDto;
|
|
|
-import edu.travel.remote.dto.FIleDto;
|
|
|
+import edu.travel.remote.dto.FileDto;
|
|
|
import edu.travel.remote.dto.GetOrderItemDto;
|
|
|
import edu.travel.remote.dto.ProductSpecDto;
|
|
|
import edu.travel.exception.BaseException;
|
|
|
import edu.travel.remote.feign.mode.vo.tenant.EduTenantVo;
|
|
|
import edu.travel.remote.upload.dto.EduFileDTO;
|
|
|
+import edu.travel.remote.upload.vo.FileVo;
|
|
|
import edu.travel.remote.vo.*;
|
|
|
import edu.travel.rpc.RPCBaseResponse;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -79,7 +79,7 @@ public class ShopReviewServiceImpl extends ServiceImpl<ShopReviewMapper, ShopRev
|
|
|
}
|
|
|
for (ShopReviewVo record : records) {
|
|
|
JSONArray objects = JSONUtil.parseArray(record.getImage());
|
|
|
- List<FIleDto> list = JSONUtil.toList(objects, FIleDto.class);
|
|
|
+ List<FileDto> list = JSONUtil.toList(objects, FileDto.class);
|
|
|
record.setImageUrls(list);
|
|
|
if(!ObjectUtil.isEmpty(record.getSkuDetails())){
|
|
|
String jsonPrettyStr = JSONUtil.toJsonPrettyStr(record.getSkuDetails());
|
|
@@ -152,7 +152,7 @@ public class ShopReviewServiceImpl extends ServiceImpl<ShopReviewMapper, ShopRev
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public RPCBaseResponse<String> uploadReviewImage(MultipartFile file) {
|
|
|
+ public RPCBaseResponse<FileWebVo> uploadReviewImage(MultipartFile file) {
|
|
|
|
|
|
if (file == null || file.isEmpty()) {
|
|
|
return error();
|
|
@@ -180,9 +180,12 @@ public class ShopReviewServiceImpl extends ServiceImpl<ShopReviewMapper, ShopRev
|
|
|
|
|
|
eduFileDTO.setFileMd5(FIleUtil.calculateFileMd5(file.getBytes()));
|
|
|
|
|
|
- RPCBaseResponse rpcBaseResponse = uploadAdapter.uploadFile(eduFileDTO, file);
|
|
|
+ RPCBaseResponse<FileVo> result = uploadAdapter.uploadFilePath(eduFileDTO, file);
|
|
|
|
|
|
- return success(rpcBaseResponse.getData().toString());
|
|
|
+ if(result.getCode()!=200){
|
|
|
+ return error();
|
|
|
+ }
|
|
|
+ return success(BeanUtil.toBean(result.getCode(), FileWebVo.class));
|
|
|
}
|
|
|
}catch (Exception e) {
|
|
|
e.printStackTrace();
|