@RequiresPermissions("content:v_list")
@RequestMapping("/content/v_list.do")
public String list(String queryStatus, Integer queryTypeId,
Boolean queryTopLevel, Boolean queryRecommend,
Integer queryOrderBy, Integer cid, Integer pageNo,
HttpServletRequest request, ModelMap model) {
long time = System.currentTimeMillis();
String queryTitle = RequestUtils.getQueryParam(request, "queryTitle");
queryTitle = StringUtils.trim(queryTitle);
String queryInputUsername = RequestUtils.getQueryParam(request,
"queryInputUsername");
queryInputUsername = StringUtils.trim(queryInputUsername);
if (queryTopLevel == null) {
queryTopLevel = false;
}
if (queryRecommend == null) {
queryRecommend = false;
}
if (queryOrderBy == null) {
queryOrderBy = 4; //指定默认排序
}
ContentStatus status;
if (!StringUtils.isBlank(queryStatus)) {
status = ContentStatus.valueOf(queryStatus);
} else {
status = ContentStatus.all;
}
Integer queryInputUserId = null;
if (!StringUtils.isBlank(queryInputUsername)) {
CmsUser u = cmsUserMng.findByUsername(queryInputUsername);
if (u != null) {
queryInputUserId = u.getId();
} else {
// 用户名不存在,清空。
queryInputUsername = null;
}
}
CmsSite site = CmsUtils.getSite(request);
Integer siteId = site.getId();
CmsUser user = CmsUtils.getUser(request);
Integer userId = user.getId();
byte currStep = user.getCheckStep(siteId);
Pagination p = manager.getPageByRight(queryTitle, queryTypeId,user.getId(),
queryInputUserId, queryTopLevel, queryRecommend, status, user
.getCheckStep(siteId), siteId, cid, userId,
queryOrderBy, cpn(pageNo), CookieUtils.getPageSize(request));
List<ContentType> typeList = contentTypeMng.getList(true);
List<CmsModel>models=cmsModelMng.getList(false, true);
if(cid!=null){
Channel c=channelMng.findById(cid);
models=c.getModels(models);
}
model.addAttribute("pagination", p);
model.addAttribute("cid", cid);
model.addAttribute("typeList", typeList);
model.addAttribute("currStep", currStep);
model.addAttribute("site", site);
model.addAttribute("models", models);
addAttibuteForQuery(model, queryTitle, queryInputUsername, queryStatus,
queryTypeId, queryTopLevel, queryRecommend, queryOrderBy,
pageNo);
time = System.currentTimeMillis() - time;
return "content/list";
}
SpringMVC请求处理操作
最新推荐文章于 2024-04-20 15:04:33 发布