diff --git a/src/main/java/com/cm/news/controller/app/apis/newscomment/NewsCommentAppController.java b/src/main/java/com/cm/news/controller/app/apis/newscomment/NewsCommentAppController.java index 46a3fbb..224641a 100644 --- a/src/main/java/com/cm/news/controller/app/apis/newscomment/NewsCommentAppController.java +++ b/src/main/java/com/cm/news/controller/app/apis/newscomment/NewsCommentAppController.java @@ -23,6 +23,7 @@ import com.cm.news.pojo.vos.newscomment.NewsCommentVO; import com.cm.news.service.newscomment.INewsCommentService; import com.github.pagehelper.util.StringUtil; import io.swagger.annotations.*; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -30,6 +31,7 @@ import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; +import java.util.Arrays; import java.util.List; import java.util.Map; @@ -55,7 +57,9 @@ public class NewsCommentAppController extends AbstractController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("getcountbynewscontentids" + ISystemConstant.APP_RELEASE_SUFFIX + "/{newsContentIds}") public List getCountbyNewsContentIds(@PathVariable("newsContentIds") String newsContentIds) throws SearchException { - return newsCommentService.getCountbyNewsContentIds(newsContentIds); + String[] newsContentIdArr = newsContentIds.split("_"); + List newsContentIdList = Arrays.asList(newsContentIdArr); + return newsCommentService.countCountByNewsContentIds(newsContentIdList); } private String getRemortIP() throws Exception {