:bug:修复部分场景下出现的错误

This commit is contained in:
hello-hao
2022-03-28 15:43:03 +08:00
parent 9a6ce4d5eb
commit 95889c42ef
5 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ public interface ImgMapper {
Integer md5Count(Images images);
Images selectImgUrlByMD5(@Param("md5key") String md5key);
List<Images> selectImgUrlByMD5(@Param("md5key") String md5key);
List<Images> RecentlyUploaded(@Param("userid") Integer userid);
@@ -37,7 +37,7 @@ public interface ImgService {
Integer md5Count(Images images);
Images selectImgUrlByMD5(String md5key);
List<Images> selectImgUrlByMD5(String md5key);
List<Images> RecentlyUploaded(Integer userid);
@@ -153,10 +153,10 @@ public class ClientService {
imaOBJ.setMd5key(md5key);
imaOBJ.setUserid(u.getId());
if (imgMapper.md5Count(imaOBJ) > 0) {
Images images = imgMapper.selectImgUrlByMD5(md5key);
jsonObject.put("url", images.getImgurl());
List<Images> images = imgMapper.selectImgUrlByMD5(md5key);
jsonObject.put("url", images.get(0).getImgurl());
jsonObject.put("name", file.getName());
jsonObject.put("size", images.getSizes());
jsonObject.put("size", images.get(0).getSizes());
msg.setData(jsonObject);
return msg;
}
@@ -220,7 +220,7 @@ public class ImgServiceImpl implements ImgService {
}
@Override
public Images selectImgUrlByMD5(String md5key) {
public List<Images> selectImgUrlByMD5(String md5key) {
return imgMapper.selectImgUrlByMD5(md5key);
}
@@ -127,10 +127,10 @@ public class UploadServicel {
imaOBJ.setMd5key(md5key);
imaOBJ.setUserid(u==null?0:u.getId());
if(imgMapper.md5Count(imaOBJ)>0){
Images images = imgMapper.selectImgUrlByMD5(md5key);
jsonObject.put("url", images.getImgurl());
List<Images> images = imgMapper.selectImgUrlByMD5(md5key);
jsonObject.put("url", images.get(0).getImgurl());
jsonObject.put("name",file.getName());
jsonObject.put("imguid",images.getImguid());
jsonObject.put("imguid",images.get(0).getImguid());
// jsonObject.put("shortLink",images.getShortlink());
msg.setData(jsonObject);
return msg;