Merge remote-tracking branch 'origin/master'

This commit is contained in:
sjm 2023-12-28 00:27:30 +08:00
commit b9320ecd9c
4 changed files with 31 additions and 21 deletions

View File

@ -70,13 +70,13 @@ public class AttachmentController {
if (config1==null){
bytes1= "没有该Config!".getBytes();
headers.setContentType(MediaType.APPLICATION_JSON);
return new ResponseEntity<byte[]>(bytes1, headers, HttpStatus.NOT_FOUND);
return new ResponseEntity<byte[]>(bytes1, headers, HttpStatus.OK);
}
Attachment attachment =attachmentService.selectAttachment(Long.valueOf(config1.getValue()));
if (attachment==null){
bytes1= "没有该Attachment!".getBytes();
headers.setContentType(MediaType.APPLICATION_JSON);
return new ResponseEntity<byte[]>(bytes1, headers, HttpStatus.NOT_FOUND);
return new ResponseEntity<byte[]>(bytes1, headers, HttpStatus.OK);
}
String fileUrl=attachment.getPath()+attachment.getFileName()+attachment.getSuffix();
out.println(fileUrl);

View File

@ -29,6 +29,9 @@ public class SearchController {
@RequestMapping("/searchByInput")
public String searchByInput(String searchKey,String userId ) throws IOException {
if(searchKey == null ){
return setResult(500,"未添加搜索内容");
}
String placeholder = "***";
//非法敏感词汇判断
SensitiveFilter filter = SensitiveFilter.getInstance();
@ -38,7 +41,7 @@ public class SearchController {
//存在非法字符
if(n > 0){
logger.info("这个人输入了非法字符--> {},不知道他到底要查什么~ userid--> {}",searchKey,1);
return setResult(500,"查询失败");
return setResult(500,"非法搜索");
}

View File

@ -36,18 +36,20 @@ public class UrlListController {
UrlList urlList = urlListService.selectUrlListByUrlId(Long.valueOf(urlId));
String parentString = urlCateListService.selectUrListCateByUrlCateId(urlList.getCateId());
String [] parentList = parentString.split(",");
//System.out.println(parentString);
System.out.println(parentString);
for(String parent : parentList)
{
if(parent.equals("0")){
continue;
}
UrlCateList urlCateList =urlCateListService.selectByPrimaryKey(Integer.valueOf(parent));
if(urlCateListService.updateByUrlCateList(urlCateList) == 0)
System.out.println(urlCateList);
urlCateList.setUrlNumber(urlCateList.getUrlNumber()-1);
if(String.valueOf(urlCateListService.updateByUrlCateList(urlCateList)).equals("0"))
{
flag = 0;
}else{
flag = 1;
flag = urlListService.deleteByPrimaryKey(Long.valueOf(urlId));
}
}
if(flag == 1)
@ -80,7 +82,7 @@ public class UrlListController {
continue;
}
UrlCateList urlCateList =urlCateListService.selectByPrimaryKey(Integer.valueOf(parent));
if(urlCateListService.updateByUrlCateList(urlCateList) == 0)
if(String.valueOf(urlCateListService.updateByUrlCateList(urlCateList)).equals("0") )
{
flag = 0;
}else{

View File

@ -23,23 +23,28 @@ public class QRCServiceImpl implements QRCService{
private CollectIconListDao collectIconListDao;
public String QR(Integer url_id) throws Exception {
String logoPath = "src/main/resources/static/logo/NAV.png";
String destPath = "src/main/resources/static/qr";
UrlList urlList = urlListDao.selectByPrimaryKey(Long.valueOf(url_id));
CollectIconList collectIconList = new CollectIconList();
String url = urlList.getUrl();
collectIconList.setUrl_id(url_id);
String list = collectIconListDao.selectByUrlid(url_id);
if (list == null) {
String base64 = QRCodeUtil.ImageToBase64(QRCodeUtil.encode(url, logoPath, destPath, true));
collectIconList.setQr_url(base64);
collectIconListDao.insertSelective(collectIconList);
if(url_id!=null){
String logoPath = "src/main/resources/static/logo/NAV.png";
String destPath = "src/main/resources/static/qr";
UrlList urlList = urlListDao.selectByPrimaryKey(Long.valueOf(url_id));
CollectIconList collectIconList = new CollectIconList();
String url = urlList.getUrl();
collectIconList.setUrl_id(url_id);
String list = collectIconListDao.selectByUrlid(url_id);
if (list == null) {
String base64 = QRCodeUtil.ImageToBase64(QRCodeUtil.encode(url, logoPath, destPath, true));
collectIconList.setQr_url(base64);
collectIconListDao.insertSelective(collectIconList);
// return JSON.toJSONString(collectIconListDao.selectByUrlid(url_id));
return JSON.toJSONString(base64);
return JSON.toJSONString(base64);
// return null;
}else {
return JSON.toJSONString(collectIconListDao.selectByUrlid(url_id));
}else {
return JSON.toJSONString(collectIconListDao.selectByUrlid(url_id));
}
}else{
return null;
}
//
//// 通过collect的url_id查找网址id对应网址
// UrlList urlList = urlListDao.selectByPrimaryKey(Long.valueOf(collect.getUrl_id()));