Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b9320ecd9c
@ -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);
|
||||
|
@ -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,"非法搜索");
|
||||
}
|
||||
|
||||
|
||||
|
@ -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{
|
||||
|
@ -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()));
|
||||
|
Loading…
Reference in New Issue
Block a user