SpringMVC请求处理操作

    @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";
    }


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值