|
@@ -3,9 +3,11 @@ package com.simuwang.manage.service.impl;
|
|
|
import com.simuwang.base.common.util.DateUtils;
|
|
|
import com.simuwang.base.mapper.daq.ImageMapper;
|
|
|
import com.simuwang.base.pojo.dos.ImageInfoDO;
|
|
|
+import com.simuwang.base.pojo.vo.ImageInfoVO;
|
|
|
import com.simuwang.manage.service.ImageSevice;
|
|
|
import com.simuwang.shiro.utils.UserUtils;
|
|
|
import com.smppw.common.pojo.ResultVo;
|
|
|
+import com.smppw.common.pojo.enums.status.ResultCode;
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -52,7 +54,17 @@ public class ImageSeviceImpl implements ImageSevice {
|
|
|
imageInfoDO.setCreateTime(new Date());
|
|
|
imageInfoDO.setUpdateTime(new Date());
|
|
|
imageMapper.insert(imageInfoDO);
|
|
|
- vo.setData(imageInfoDO);
|
|
|
+ ImageInfoVO imageInfoVO = imageInfoDO.toVO();
|
|
|
+ vo.setData(imageInfoVO);
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResultVo getImageById(Integer fileId) {
|
|
|
+ ResultVo vo = new ResultVo(ResultCode.SUCCESS.getCode());
|
|
|
+ ImageInfoDO imageInfoDO = imageMapper.selectById(fileId);
|
|
|
+ ImageInfoVO imageInfoVO = imageInfoDO.toVO();
|
|
|
+ vo.setData(imageInfoVO);
|
|
|
return vo;
|
|
|
}
|
|
|
}
|