main
parent
63e9f8e54b
commit
297a16847b
|
|
@ -119,7 +119,6 @@ public class AppDynamicCommentController extends BaseController
|
||||||
@GetMapping("/treeList")
|
@GetMapping("/treeList")
|
||||||
@ApiOperation(value = "评论树列表", notes = "评论树列表", httpMethod = "GET")
|
@ApiOperation(value = "评论树列表", notes = "评论树列表", httpMethod = "GET")
|
||||||
public AjaxResult treeList(AppDynamicComment appDynamicComment) {
|
public AjaxResult treeList(AppDynamicComment appDynamicComment) {
|
||||||
startPage();
|
|
||||||
Map list = appDynamicCommentService.treeList(appDynamicComment);
|
Map list = appDynamicCommentService.treeList(appDynamicComment);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ import com.ruoyi.app.mapper.AppDynamicCommentMapper;
|
||||||
import com.ruoyi.app.domain.AppDynamicComment;
|
import com.ruoyi.app.domain.AppDynamicComment;
|
||||||
import com.ruoyi.app.service.IAppDynamicCommentService;
|
import com.ruoyi.app.service.IAppDynamicCommentService;
|
||||||
|
|
||||||
|
import static com.ruoyi.common.core.utils.PageUtils.startPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 动态评论Service业务层处理
|
* 动态评论Service业务层处理
|
||||||
*
|
*
|
||||||
|
|
@ -126,10 +128,12 @@ public class AppDynamicCommentServiceImpl implements IAppDynamicCommentService
|
||||||
if (appDynamicComment.getDynamicId() == null) {
|
if (appDynamicComment.getDynamicId() == null) {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
List<AppDynamicCommentVo> list = appDynamicCommentMapper.selectCommentList(appDynamicComment);
|
||||||
|
startPage();
|
||||||
List<AppDynamicCommentVo> appDynamicComments = appDynamicCommentMapper.selectCommentList(appDynamicComment);
|
List<AppDynamicCommentVo> appDynamicComments = appDynamicCommentMapper.selectCommentList(appDynamicComment);
|
||||||
List<AppDynamicCommentVo> parentList = appDynamicComments.stream().filter(entity -> entity.getParentId() == null).collect(Collectors.toList());
|
List<AppDynamicCommentVo> parentList = appDynamicComments.stream().filter(entity -> entity.getParentId() == null).collect(Collectors.toList());
|
||||||
List<AppDynamicCommentVo> srcList = appDynamicComments.stream().filter(entity -> entity.getParentId() != null).collect(Collectors.toList());
|
List<AppDynamicCommentVo> srcList = appDynamicComments.stream().filter(entity -> entity.getParentId() != null).collect(Collectors.toList());
|
||||||
map.put("countNum",appDynamicComments.size());
|
map.put("countNum",list.size());
|
||||||
map.put("list",buildList(parentList,srcList));
|
map.put("list",buildList(parentList,srcList));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,9 @@ public class AppUserServiceImpl implements IAppUserService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private AppRegisterMapper appRegisterMapper;
|
private AppRegisterMapper appRegisterMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AppDynamicCommentMapper appDynamicCommentMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult statistics() {
|
public AjaxResult statistics() {
|
||||||
StatisticsVo statisticsVo = new StatisticsVo();
|
StatisticsVo statisticsVo = new StatisticsVo();
|
||||||
|
|
@ -221,6 +224,14 @@ public class AppUserServiceImpl implements IAppUserService {
|
||||||
List<AppUserDynamic> list = appUserDynamicMapper.selectAppUserDynamicList(appUserDynamic);
|
List<AppUserDynamic> list = appUserDynamicMapper.selectAppUserDynamicList(appUserDynamic);
|
||||||
if (list != null && list.size() > 0) {
|
if (list != null && list.size() > 0) {
|
||||||
for (AppUserDynamic userDynamic : list) {
|
for (AppUserDynamic userDynamic : list) {
|
||||||
|
AppDynamicComment appDynamicComment = new AppDynamicComment();
|
||||||
|
appDynamicComment.setDynamicId(userDynamic.getId());
|
||||||
|
List<AppDynamicComment> appDynamicComments = appDynamicCommentMapper.selectAppDynamicCommentList(appDynamicComment);
|
||||||
|
if (appDynamicComments != null && list.size() > 0) {
|
||||||
|
for (AppDynamicComment dynamicComment : appDynamicComments) {
|
||||||
|
appDynamicCommentMapper.deleteAppDynamicCommentById(dynamicComment.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
appUserDynamicMapper.deleteAppUserDynamicById(userDynamic.getId());
|
appUserDynamicMapper.deleteAppUserDynamicById(userDynamic.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue