|
|
|
@ -40,8 +40,8 @@ public class KcInfoController extends BaseController { |
|
|
|
kcInfo.setType(1l); |
|
|
|
Long total = kcFileMapper.getKcCount(kcInfo); |
|
|
|
List<KcInfo> list = kcFileMapper.getkcList(kcInfo); |
|
|
|
for(int i=0;i<list.size();i++){ |
|
|
|
List<KcTwImg> imgList = twImgMapper.getKcTwImgList(list.get(i).getId()); |
|
|
|
for (int i = 0; i < list.size(); i++) { |
|
|
|
List<KcTwImg> imgList = twImgMapper.getKcTwImgList(list.get(i).getId()); |
|
|
|
list.get(i).setImgList(imgList); |
|
|
|
} |
|
|
|
|
|
|
|
@ -96,7 +96,7 @@ public class KcInfoController extends BaseController { |
|
|
|
KcInfo aa = kcFileMapper.selectById(id); |
|
|
|
|
|
|
|
//判断这个实体是什么类型
|
|
|
|
if(aa.getType()==1){ |
|
|
|
if (aa.getType() == 1) { |
|
|
|
List<KcTwImg> list = twImgMapper.getKcTwImgList(aa.getId()); |
|
|
|
aa.setImgList(list); |
|
|
|
|
|
|
|
@ -108,7 +108,7 @@ public class KcInfoController extends BaseController { |
|
|
|
ajax.put("data", aa); |
|
|
|
return AjaxResult.success(ajax); |
|
|
|
} |
|
|
|
if(aa.getType()==2){ |
|
|
|
if (aa.getType() == 2) { |
|
|
|
System.out.println(aa); |
|
|
|
ajax.put("data", aa); |
|
|
|
return AjaxResult.success(ajax); |
|
|
|
@ -124,7 +124,7 @@ public class KcInfoController extends BaseController { |
|
|
|
public AjaxResult editInfo(@RequestBody KcInfo kcInfo) throws IOException { |
|
|
|
|
|
|
|
//判断这个info是什么
|
|
|
|
if(kcInfo.getType()==1){ |
|
|
|
if (kcInfo.getType() == 1) { |
|
|
|
Long id = kcInfo.getId(); |
|
|
|
String name = kcInfo.getName(); |
|
|
|
String contentInfo = kcInfo.getContentInfo(); |
|
|
|
@ -138,14 +138,14 @@ public class KcInfoController extends BaseController { |
|
|
|
int d = twImgMapper.deleteImgs(id); |
|
|
|
|
|
|
|
List<KcTwImg> list = new ArrayList<>(); |
|
|
|
if (imgList.length!=0){ |
|
|
|
if (imgList.length != 0) { |
|
|
|
for (int a = 0; a < imgList.length; a++) { |
|
|
|
KcTwImg twimg = new KcTwImg(); |
|
|
|
twimg.setTwId(id); |
|
|
|
twimg.setImgUrl(imgList[a]); |
|
|
|
list.add(twimg); |
|
|
|
} |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
KcTwImg twimg = new KcTwImg(); |
|
|
|
twimg.setTwId(id); |
|
|
|
twimg.setImgUrl(imgs); |
|
|
|
@ -174,15 +174,15 @@ public class KcInfoController extends BaseController { |
|
|
|
info.setName(name); |
|
|
|
info.setTwUrl(String.valueOf(newPath)); |
|
|
|
int a = kcFileMapper.updateDocById(info); |
|
|
|
if (a>0){ |
|
|
|
if (a > 0) { |
|
|
|
return AjaxResult.success(); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
return AjaxResult.error(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//视频
|
|
|
|
if(kcInfo.getType()==2){ |
|
|
|
if (kcInfo.getType() == 2) { |
|
|
|
Long id = kcInfo.getId(); |
|
|
|
String name = kcInfo.getName(); |
|
|
|
String spUrl = kcInfo.getSpUrl(); |
|
|
|
@ -190,9 +190,9 @@ public class KcInfoController extends BaseController { |
|
|
|
aa.setSpUrl(spUrl); |
|
|
|
aa.setName(name); |
|
|
|
int a = kcFileMapper.updateDocById(aa); |
|
|
|
if (a>0){ |
|
|
|
if (a > 0) { |
|
|
|
return AjaxResult.success(); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
return AjaxResult.error(); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -200,11 +200,6 @@ public class KcInfoController extends BaseController { |
|
|
|
return AjaxResult.error(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|