|
|
@@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
-import com.alibaba.druid.util.StringUtils;
|
|
|
+import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.BaseController;
|
|
|
@@ -60,9 +60,24 @@ public class NewsController extends BaseController {
|
|
|
public Result portalNewsList(Integer type, String pageSize, String pageNo, String noCache){
|
|
|
Result res = new Result();
|
|
|
if (StringUtils.equals(noCache, "clear")) {
|
|
|
- newsService.cleanList();
|
|
|
+ newsService.cleanPortalList();
|
|
|
+ }
|
|
|
+ Integer pSize = null;
|
|
|
+ Integer pNo = null;
|
|
|
+ if (StringUtils.isNumeric(pageSize)) {
|
|
|
+ pSize = Integer.parseInt(pageSize);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNumeric(pageNo)) {
|
|
|
+ pNo = Integer.parseInt(pageNo);
|
|
|
+ }
|
|
|
+ if (pNo == null || pNo < 0) {
|
|
|
+ pNo = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pSize == null || pSize < 0 || pSize > 5) {
|
|
|
+ pSize = 5;
|
|
|
}
|
|
|
- res.setData(newsService.findPortalList(pageSize, pageNo, type));
|
|
|
+ res.setData(newsService.findPortalList(pSize, pNo, type));
|
|
|
return res;
|
|
|
}
|
|
|
|