update QRCode

This commit is contained in:
sjm 2023-12-24 13:57:22 +08:00
parent 3afb5f3228
commit 1358261ad4

View File

@ -33,6 +33,9 @@ public class QRCServiceImpl implements QRCService{
// 通过collect的url_id查找网址id对应网址 // 通过collect的url_id查找网址id对应网址
UrlList urlList = urlListDao.selectByPrimaryKey(Long.valueOf(collect.getUrl_id())); UrlList urlList = urlListDao.selectByPrimaryKey(Long.valueOf(collect.getUrl_id()));
List<CollectIconList> list = collectIconListDao.selectByUrlid(collect.getUrl_id());
if(list.size()==0){
if(urlList != null){ if(urlList != null){
// 获取网址url // 获取网址url
String url = urlList.getUrl(); String url = urlList.getUrl();
@ -42,12 +45,13 @@ public class QRCServiceImpl implements QRCService{
collect.setQr_url(url_wait); collect.setQr_url(url_wait);
collectIconListDao.insert(collect); collectIconListDao.insert(collect);
String base64 = QRCodeUtil.ImageToBase64(url_wait); String base64 = QRCodeUtil.ImageToBase64(url_wait);
return base64; return JSON.toJSONString(base64);
}else{ }else{
HashMap<String,Object> result = new HashMap<>(); HashMap<String,Object> result = new HashMap<>();
result.put("code",500); result.put("code",500);
result.put("msg", "找不到对应网址"); result.put("msg", "找不到对应网址");
return JSON.toJSONString(result); return JSON.toJSONString(result);
} }
}else return JSON.toJSONString("不准重复插入");
} }
} }