• 大小: 22.46MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-07
  • 语言: 数据库
  • 标签: javaweb  

资源简介

项目开发环境:jdk1.7 Tomcat 7 MySQL 5.7 Myexlipse2017

资源截图

代码片段和文件信息

package com.ischoolbar.programmer.controller.admin;

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

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.ischoolbar.programmer.entity.admin.Log;
import com.ischoolbar.programmer.page.admin.Page;
import com.ischoolbar.programmer.service.admin.LogService;

/**
 * 日志管理控制器
 * @author llq
 *
 */
@RequestMapping(“/admin/log“)
@Controller
public class LogController {
@Autowired
private LogService logService;

/**
 * 日志列表页面
 * @param model
 * @return
 */
@RequestMapping(value=“/list“method=RequestMethod.GET)
public ModelAndView list(ModelAndView model){
model.setViewName(“log/list“);
return model;
}

/**
 * 获取日志列表
 * @param page
 * @param content
 * @param roleId
 * @param sex
 * @return
 */
@RequestMapping(value=“/list“method=RequestMethod.POST)
@ResponseBody
public Mapject> getList(Page page
@RequestParam(name=“content“required=falsedefaultValue=““) String content
){
Mapject> ret = new HashMapject>();
Mapject> queryMap = new HashMapject>();
queryMap.put(“content“ content);
queryMap.put(“offset“ page.getOffset());
queryMap.put(“pageSize“ page.getRows());
ret.put(“rows“ logService.findList(queryMap));
ret.put(“total“ logService.getTotal(queryMap));
return ret;
}

/**
 * 添加日志
 * @param user
 * @return
 */
@RequestMapping(value=“/add“method=RequestMethod.POST)
@ResponseBody
public Map add(Log log){
Map ret = new HashMap();
if(log == null){
ret.put(“type“ “error“);
ret.put(“msg“ “请填写正确的日志信息!“);
return ret;
}
if(StringUtils.isEmpty(log.getContent())){
ret.put(“type“ “error“);
ret.put(“msg“ “请填写日志内容!“);
return ret;
}
log.setCreateTime(new Date());
if(logService.add(log) <= 0){
ret.put(“type“ “error“);
ret.put(“msg“ “日志添加失败,请联系管理员!“);
return ret;
}
ret.put(“type“ “success“);
ret.put(“msg“ “日志添加成功!“);
return ret;
}



/**
 * 批量删除日志
 * @param ids
 * @return
 */
@RequestMapping(value=“/delete“method=RequestMethod.POST)
@ResponseBody
public Map delete(String ids){
Map ret = new HashMap();
if(StringUtils.isEmpty(ids)){
ret.put(“type“ “error“);
ret.put(“msg“ “选择要删除的数据!“);
return ret;
}
if(ids.contains(““)){
ids = ids.substring(0ids.length()-1);
}
if(logService.de

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        8102  2019-03-26 09:19  db_base_project.sql
     目录           0  2018-12-16 19:28  baseProjectSSM\
     文件         834  2018-12-03 22:00  baseProjectSSM\.classpath
     文件        1047  2018-12-03 22:00  baseProjectSSM\.project
     目录           0  2018-12-16 19:28  baseProjectSSM\.settings\
     文件         503  2018-12-03 22:00  baseProjectSSM\.settings\.jsdtscope
     文件         462  2018-12-16 16:31  baseProjectSSM\.settings\org.eclipse.core.resources.prefs
     文件         364  2018-12-03 22:00  baseProjectSSM\.settings\org.eclipse.jdt.core.prefs
     文件         494  2018-12-03 22:00  baseProjectSSM\.settings\org.eclipse.wst.common.component
     文件         345  2018-12-03 22:00  baseProjectSSM\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2018-12-03 22:00  baseProjectSSM\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2018-12-03 22:00  baseProjectSSM\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-12-16 19:28  baseProjectSSM\build\
     目录           0  2018-12-16 19:28  baseProjectSSM\build\classes\
     目录           0  2018-12-16 19:28  baseProjectSSM\build\classes\com\
     目录           0  2018-12-16 19:28  baseProjectSSM\build\classes\com\ischoolbar\
     目录           0  2018-12-16 19:28  baseProjectSSM\build\classes\com\ischoolbar\programmer\
     目录           0  2018-12-16 19:28  baseProjectSSM\build\classes\com\ischoolbar\programmer\controller\
     目录           0  2018-12-16 19:28  baseProjectSSM\build\classes\com\ischoolbar\programmer\controller\admin\
     文件        4502  2018-12-16 17:41  baseProjectSSM\build\classes\com\ischoolbar\programmer\controller\admin\LogController.class
     文件        7432  2018-12-12 19:53  baseProjectSSM\build\classes\com\ischoolbar\programmer\controller\admin\MenuController.class
     文件        7291  2018-12-15 12:57  baseProjectSSM\build\classes\com\ischoolbar\programmer\controller\admin\RoleController.class
     文件       10247  2018-12-16 19:11  baseProjectSSM\build\classes\com\ischoolbar\programmer\controller\admin\SystemController.class
     文件        8478  2018-12-15 21:17  baseProjectSSM\build\classes\com\ischoolbar\programmer\controller\admin\UserController.class
     目录           0  2018-12-16 19:28  baseProjectSSM\build\classes\com\ischoolbar\programmer\dao\
     目录           0  2018-12-16 19:28  baseProjectSSM\build\classes\com\ischoolbar\programmer\dao\admin\
     文件         517  2018-12-12 21:12  baseProjectSSM\build\classes\com\ischoolbar\programmer\dao\admin\AuthorityDao.class
     文件         622  2018-12-16 16:54  baseProjectSSM\build\classes\com\ischoolbar\programmer\dao\admin\LogDao.class
     文件        1071  2018-12-16 15:08  baseProjectSSM\build\classes\com\ischoolbar\programmer\dao\admin\MenuDao.class
     文件         720  2018-12-16 15:00  baseProjectSSM\build\classes\com\ischoolbar\programmer\dao\admin\RoleDao.class
     文件         757  2018-12-16 18:33  baseProjectSSM\build\classes\com\ischoolbar\programmer\dao\admin\UserDao.class
............此处省略3492个文件信息

评论

共有 条评论