com.apus.hades.admin.web.controller.log.LogController.java Source code

Java tutorial

Introduction

Here is the source code for com.apus.hades.admin.web.controller.log.LogController.java

Source

/*
 * Copyright 2015 ireader.com All right reserved. This software is the
 * confidential and proprietary information of ireader.com ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with ireader.com.
 */
package com.apus.hades.admin.web.controller.log;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import com.apus.hades.admin.util.Struts2Utils;
import com.apus.hades.admin.web.controller.BaseController;
import com.apus.hades.common.orm.mybatis.paginator.domain.PageBounds;
import com.apus.hades.common.orm.mybatis.paginator.domain.PageList;
import com.apus.hades.core.manager.log.UserOperatLogManager;
import com.apus.hades.core.model.log.UserOperatLog;

/**
 * @Descriptions?.
 * @date 2015731
 * @author xueguolin
 */
public class LogController extends BaseController {

    private static final long serialVersionUID = -1532268475226733313L;

    @Autowired
    private UserOperatLogManager userOperatLogManager;

    private PageList<UserOperatLog> pages;

    private UserOperatLog userOperatLog;

    /**
     * .
     * 
     * @return
     */
    public String list() {
        Map<String, Object> params = new HashMap<String, Object>();

        String user_name = Struts2Utils.getParameter("user_name");
        String role_names = Struts2Utils.getParameter("role_names");
        String begin_time = Struts2Utils.getParameter("begin_time");
        String end_time = Struts2Utils.getParameter("end_time");
        if (StringUtils.isNotBlank(user_name)) {
            params.put("user_name", user_name);
            Struts2Utils.setAttribute("user_name", user_name);
        }
        if (StringUtils.isNotBlank(role_names)) {
            params.put("role_names", role_names);
            Struts2Utils.setAttribute("role_names", role_names);
        }
        if (StringUtils.isNotBlank(begin_time)) {
            params.put("begin_time", begin_time);
            Struts2Utils.setAttribute("begin_time", begin_time);
        }
        if (StringUtils.isNotBlank(end_time)) {
            params.put("end_time", end_time);
            Struts2Utils.setAttribute("end_time", end_time);
        }

        pages = userOperatLogManager.findByPage(params,
                new PageBounds(pagination.getPageNo(), pagination.getPageSize()));
        if (null != pages) {
            this.setPagination(pages.getPagination());
        }
        return "list";
    }

    public PageList<UserOperatLog> getPages() {
        return pages;
    }

    public void setPages(PageList<UserOperatLog> pages) {
        this.pages = pages;
    }

    public UserOperatLog getUserOperatLog() {
        return userOperatLog;
    }

    public void setUserOperatLog(UserOperatLog userOperatLog) {
        this.userOperatLog = userOperatLog;
    }

}