Commit cc44697fe85d7c1e767e54c9f6b4c55bfd462c8d
1 parent
1a9633bc
开发日志管理模块
Showing
10 changed files
with
628 additions
and
3 deletions
src/main/java/com/cnlive/shenhe/controller/ShyLogController.java
0 → 100644
| 1 | +package com.cnlive.shenhe.controller; | ||
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 4 | +import com.cnlive.shenhe.bean.ErrorEnum; | ||
| 5 | +import com.cnlive.shenhe.bean.ResponseBean; | ||
| 6 | +import com.cnlive.shenhe.dto.ShyLogDTO; | ||
| 7 | +import com.cnlive.shenhe.entity.ShyLog; | ||
| 8 | +import com.cnlive.shenhe.serviceImpl.ShyLogServiceImpl; | ||
| 9 | +import com.github.pagehelper.PageInfo; | ||
| 10 | +import org.slf4j.Logger; | ||
| 11 | +import org.slf4j.LoggerFactory; | ||
| 12 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 13 | +import org.springframework.stereotype.Controller; | ||
| 14 | +import org.springframework.ui.Model; | ||
| 15 | +import org.springframework.web.bind.annotation.GetMapping; | ||
| 16 | +import org.springframework.web.bind.annotation.PostMapping; | ||
| 17 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 18 | +import org.springframework.web.bind.annotation.ResponseBody; | ||
| 19 | + | ||
| 20 | +/** | ||
| 21 | + * @author 王言钊 | ||
| 22 | + * @author shkstart | ||
| 23 | + * @create 2022-05-16 11:36 | ||
| 24 | + */ | ||
| 25 | +@Controller | ||
| 26 | +@RequestMapping("/log") | ||
| 27 | +public class ShyLogController { | ||
| 28 | + private static Logger logger = LoggerFactory.getLogger(ShyLogController.class); | ||
| 29 | + | ||
| 30 | + @Autowired | ||
| 31 | + private ShyLogServiceImpl shyLogServiceImpl; | ||
| 32 | + | ||
| 33 | + | ||
| 34 | + @GetMapping("/page") | ||
| 35 | + public String getShyLog(ShyLogDTO shyLogDTO, Model model) { | ||
| 36 | + logger.info("进入查询日志方法,接受的对象为,ShyLogDTO:{}", JSON.toJSONString(shyLogDTO)); | ||
| 37 | + PageInfo<ShyLog> shyLogPageInfo = shyLogServiceImpl.selectByExample(shyLogDTO); | ||
| 38 | + model.addAttribute("shyLogPageInfo", shyLogPageInfo); | ||
| 39 | + return "page/log.html"; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + @PostMapping("/add") | ||
| 43 | + @ResponseBody | ||
| 44 | + public ResponseBean insterShyLog(ShyLog shyLog) { | ||
| 45 | + logger.info("访问了日志添加方法,接受的对象为,ShyLog:{}",JSON.toJSONString(shyLog)); | ||
| 46 | + int result = shyLogServiceImpl.addShyLog(shyLog); | ||
| 47 | + if (result > 0) { | ||
| 48 | + return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前日志添加成功"); | ||
| 49 | + } | ||
| 50 | + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "日志添加失败,请重试"); | ||
| 51 | + } | ||
| 52 | +} |
src/main/java/com/cnlive/shenhe/controller/UsersController.java
| @@ -4,8 +4,10 @@ import com.alibaba.fastjson.JSON; | @@ -4,8 +4,10 @@ import com.alibaba.fastjson.JSON; | ||
| 4 | import com.alibaba.fastjson.JSONObject; | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | import com.cnlive.shenhe.bean.SessionUser; | 5 | import com.cnlive.shenhe.bean.SessionUser; |
| 6 | import com.cnlive.shenhe.dto.UsersDTO; | 6 | import com.cnlive.shenhe.dto.UsersDTO; |
| 7 | +import com.cnlive.shenhe.entity.ShyLog; | ||
| 7 | import com.cnlive.shenhe.entity.ShySites; | 8 | import com.cnlive.shenhe.entity.ShySites; |
| 8 | import com.cnlive.shenhe.entity.ShyUsers; | 9 | import com.cnlive.shenhe.entity.ShyUsers; |
| 10 | +import com.cnlive.shenhe.serviceImpl.ShyLogServiceImpl; | ||
| 9 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; | 11 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| 10 | import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; | 12 | import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; |
| 11 | import com.cnlive.shenhe.utils.CommonConst; | 13 | import com.cnlive.shenhe.utils.CommonConst; |
| @@ -22,6 +24,7 @@ import org.springframework.web.bind.annotation.*; | @@ -22,6 +24,7 @@ import org.springframework.web.bind.annotation.*; | ||
| 22 | 24 | ||
| 23 | import javax.servlet.http.HttpServletRequest; | 25 | import javax.servlet.http.HttpServletRequest; |
| 24 | import javax.servlet.http.HttpSession; | 26 | import javax.servlet.http.HttpSession; |
| 27 | +import java.util.Date; | ||
| 25 | import java.util.HashMap; | 28 | import java.util.HashMap; |
| 26 | import java.util.List; | 29 | import java.util.List; |
| 27 | import java.util.Map; | 30 | import java.util.Map; |
| @@ -38,9 +41,11 @@ public class UsersController extends BaseController { | @@ -38,9 +41,11 @@ public class UsersController extends BaseController { | ||
| 38 | private static Logger logger = LoggerFactory.getLogger(UsersController.class); | 41 | private static Logger logger = LoggerFactory.getLogger(UsersController.class); |
| 39 | 42 | ||
| 40 | @Autowired | 43 | @Autowired |
| 41 | - UsersServiceImpl usersService; | 44 | + private UsersServiceImpl usersService; |
| 42 | @Autowired | 45 | @Autowired |
| 43 | - SitesServiceImpl sitesService; | 46 | + private SitesServiceImpl sitesService; |
| 47 | + @Autowired | ||
| 48 | + private ShyLogServiceImpl shyLogService; | ||
| 44 | 49 | ||
| 45 | /** | 50 | /** |
| 46 | * 登录入口 | 51 | * 登录入口 |
| @@ -86,9 +91,17 @@ public class UsersController extends BaseController { | @@ -86,9 +91,17 @@ public class UsersController extends BaseController { | ||
| 86 | sessionUser.setLogo(user.getUser_logo()); | 91 | sessionUser.setLogo(user.getUser_logo()); |
| 87 | sessionUser.setMaster(user.getMaster()); | 92 | sessionUser.setMaster(user.getMaster()); |
| 88 | request.getSession().setAttribute(SessionUser.SESSION_KEY, sessionUser); | 93 | request.getSession().setAttribute(SessionUser.SESSION_KEY, sessionUser); |
| 94 | + ShyLog shyLog = new ShyLog(); | ||
| 95 | + shyLog.setVideoName(id); | ||
| 96 | + shyLog.setOperator(user.getUsername()); | ||
| 97 | + shyLog.setOperationTime(new Date()); | ||
| 98 | + shyLog.setOperationType("登录"); | ||
| 99 | + shyLog.setRemark(user.getUsername()+"登录"); | ||
| 100 | + shyLogService.addShyLog(shyLog); | ||
| 89 | return "redirect:" + redirectURL + "/videos/page?video_title=&start_date=&end_date=&state=0&receive=0&video_priority="; | 101 | return "redirect:" + redirectURL + "/videos/page?video_title=&start_date=&end_date=&state=0&receive=0&video_priority="; |
| 90 | } | 102 | } |
| 91 | } | 103 | } |
| 104 | + | ||
| 92 | return "page/error.html"; | 105 | return "page/error.html"; |
| 93 | } | 106 | } |
| 94 | 107 |
src/main/java/com/cnlive/shenhe/dto/ShyActivityDTO.java
| @@ -41,5 +41,11 @@ public class ShyActivityDTO extends ShyActivity implements Serializable { | @@ -41,5 +41,11 @@ public class ShyActivityDTO extends ShyActivity implements Serializable { | ||
| 41 | this.pageSize = pageSize; | 41 | this.pageSize = pageSize; |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | - | 44 | + @Override |
| 45 | + public String toString() { | ||
| 46 | + return "ShyActivityDTO{" + | ||
| 47 | + "pageNum=" + pageNum + | ||
| 48 | + ", pageSize=" + pageSize + | ||
| 49 | + "} " + super.toString(); | ||
| 50 | + } | ||
| 45 | } | 51 | } |
src/main/java/com/cnlive/shenhe/dto/ShyLogDTO.java
0 → 100644
| 1 | +package com.cnlive.shenhe.dto; | ||
| 2 | + | ||
| 3 | +import com.cnlive.shenhe.entity.ShyLog; | ||
| 4 | + | ||
| 5 | +import java.io.Serializable; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * @author 王言钊 | ||
| 9 | + * @author shkstart | ||
| 10 | + * @create 2022-05-16 11:18 | ||
| 11 | + */ | ||
| 12 | +public class ShyLogDTO extends ShyLog implements Serializable { | ||
| 13 | + | ||
| 14 | + private Integer page; | ||
| 15 | + | ||
| 16 | + private Integer pageSize ; | ||
| 17 | + | ||
| 18 | + public ShyLogDTO() { | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + public Integer getPage() { | ||
| 22 | + return page == null ? 1 : page; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + public void setPage(Integer pageNum) { | ||
| 26 | + this.page = page; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + public Integer getPageSize() { | ||
| 30 | + return pageSize == null ? 10 : pageSize; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + public void setPageSize(Integer pageSize) { | ||
| 34 | + this.pageSize = pageSize; | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + public ShyLogDTO(Integer page, Integer pageSize) { | ||
| 38 | + this.page = page; | ||
| 39 | + this.pageSize = pageSize; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + @Override | ||
| 43 | + public String toString() { | ||
| 44 | + return "ShyLogDTO{" + | ||
| 45 | + "page=" + page + | ||
| 46 | + ", pageSize=" + pageSize + | ||
| 47 | + "} " + super.toString(); | ||
| 48 | + } | ||
| 49 | +} |
src/main/java/com/cnlive/shenhe/entity/ShyLog.java
0 → 100644
| 1 | +package com.cnlive.shenhe.entity; | ||
| 2 | + | ||
| 3 | +import javax.persistence.Column; | ||
| 4 | +import javax.persistence.Table; | ||
| 5 | +import java.util.Date; | ||
| 6 | + | ||
| 7 | +@Table(name = "shy_log") | ||
| 8 | +public class ShyLog { | ||
| 9 | + /** | ||
| 10 | + * 视频ID 如果为空 为用户登录操作 | ||
| 11 | + */ | ||
| 12 | + @Column(name = "video_id") | ||
| 13 | + private String videoId; | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * 视频名称 | ||
| 17 | + */ | ||
| 18 | + @Column(name = "video_name") | ||
| 19 | + private String videoName; | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * 操作人 | ||
| 23 | + */ | ||
| 24 | + private String operator; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * 操作时间 | ||
| 28 | + */ | ||
| 29 | + @Column(name = "operation_time") | ||
| 30 | + private Date operationTime; | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 操作类型 | ||
| 34 | + */ | ||
| 35 | + @Column(name = "operation_type") | ||
| 36 | + private String operationType; | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * 备注 | ||
| 40 | + */ | ||
| 41 | + private String remark; | ||
| 42 | + | ||
| 43 | + /** | ||
| 44 | + * 获取视频ID 如果为空 为用户登录操作 | ||
| 45 | + * | ||
| 46 | + * @return video_id - 视频ID 如果为空 为用户登录操作 | ||
| 47 | + */ | ||
| 48 | + public String getVideoId() { | ||
| 49 | + return videoId; | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * 设置视频ID 如果为空 为用户登录操作 | ||
| 54 | + * | ||
| 55 | + * @param videoId 视频ID 如果为空 为用户登录操作 | ||
| 56 | + */ | ||
| 57 | + public void setVideoId(String videoId) { | ||
| 58 | + this.videoId = videoId; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * 获取视频名称 | ||
| 63 | + * | ||
| 64 | + * @return video_name - 视频名称 | ||
| 65 | + */ | ||
| 66 | + public String getVideoName() { | ||
| 67 | + return videoName; | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + /** | ||
| 71 | + * 设置视频名称 | ||
| 72 | + * | ||
| 73 | + * @param videoName 视频名称 | ||
| 74 | + */ | ||
| 75 | + public void setVideoName(String videoName) { | ||
| 76 | + this.videoName = videoName; | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + /** | ||
| 80 | + * 获取操作人 | ||
| 81 | + * | ||
| 82 | + * @return operator - 操作人 | ||
| 83 | + */ | ||
| 84 | + public String getOperator() { | ||
| 85 | + return operator; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + /** | ||
| 89 | + * 设置操作人 | ||
| 90 | + * | ||
| 91 | + * @param operator 操作人 | ||
| 92 | + */ | ||
| 93 | + public void setOperator(String operator) { | ||
| 94 | + this.operator = operator; | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + /** | ||
| 98 | + * 获取操作时间 | ||
| 99 | + * | ||
| 100 | + * @return operation_time - 操作时间 | ||
| 101 | + */ | ||
| 102 | + public Date getOperationTime() { | ||
| 103 | + return operationTime; | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + /** | ||
| 107 | + * 设置操作时间 | ||
| 108 | + * | ||
| 109 | + * @param operationTime 操作时间 | ||
| 110 | + */ | ||
| 111 | + public void setOperationTime(Date operationTime) { | ||
| 112 | + this.operationTime = operationTime; | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + /** | ||
| 116 | + * 获取操作类型 | ||
| 117 | + * | ||
| 118 | + * @return operation_type - 操作类型 | ||
| 119 | + */ | ||
| 120 | + public String getOperationType() { | ||
| 121 | + return operationType; | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + /** | ||
| 125 | + * 设置操作类型 | ||
| 126 | + * | ||
| 127 | + * @param operationType 操作类型 | ||
| 128 | + */ | ||
| 129 | + public void setOperationType(String operationType) { | ||
| 130 | + this.operationType = operationType; | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + /** | ||
| 134 | + * 获取备注 | ||
| 135 | + * | ||
| 136 | + * @return remark - 备注 | ||
| 137 | + */ | ||
| 138 | + public String getRemark() { | ||
| 139 | + return remark; | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + /** | ||
| 143 | + * 设置备注 | ||
| 144 | + * | ||
| 145 | + * @param remark 备注 | ||
| 146 | + */ | ||
| 147 | + public void setRemark(String remark) { | ||
| 148 | + this.remark = remark; | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + @Override | ||
| 152 | + public String toString() { | ||
| 153 | + return "ShyLog{" + | ||
| 154 | + "videoId='" + videoId + '\'' + | ||
| 155 | + ", videoName='" + videoName + '\'' + | ||
| 156 | + ", operator='" + operator + '\'' + | ||
| 157 | + ", operationTime=" + operationTime + | ||
| 158 | + ", operationType='" + operationType + '\'' + | ||
| 159 | + ", remark='" + remark + '\'' + | ||
| 160 | + '}'; | ||
| 161 | + } | ||
| 162 | +} | ||
| 0 | \ No newline at end of file | 163 | \ No newline at end of file |
src/main/java/com/cnlive/shenhe/mapper/ShyLogMapper.java
0 → 100644
src/main/java/com/cnlive/shenhe/serviceImpl/ShyLogServiceImpl.java
0 → 100644
| 1 | +package com.cnlive.shenhe.serviceImpl; | ||
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 4 | +import com.cnlive.shenhe.dto.ShyLogDTO; | ||
| 5 | +import com.cnlive.shenhe.entity.ShyActivity; | ||
| 6 | +import com.cnlive.shenhe.entity.ShyLog; | ||
| 7 | +import com.cnlive.shenhe.mapper.ShyLogMapper; | ||
| 8 | +import com.github.pagehelper.PageHelper; | ||
| 9 | +import com.github.pagehelper.PageInfo; | ||
| 10 | +import org.slf4j.Logger; | ||
| 11 | +import org.slf4j.LoggerFactory; | ||
| 12 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 13 | +import org.springframework.stereotype.Service; | ||
| 14 | +import tk.mybatis.mapper.entity.Example; | ||
| 15 | + | ||
| 16 | +import java.util.List; | ||
| 17 | + | ||
| 18 | +/** | ||
| 19 | + * @author 王言钊 | ||
| 20 | + * @author shkstart | ||
| 21 | + * @create 2022-05-16 11:09 | ||
| 22 | + */ | ||
| 23 | +@Service | ||
| 24 | +public class ShyLogServiceImpl { | ||
| 25 | + | ||
| 26 | + private static Logger logger = LoggerFactory.getLogger(ShyLogServiceImpl.class); | ||
| 27 | + | ||
| 28 | + @Autowired | ||
| 29 | + private ShyLogMapper shyLogMapper; | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 查询所有的日志 | ||
| 33 | + * | ||
| 34 | + * @return | ||
| 35 | + */ | ||
| 36 | + public PageInfo<ShyLog> selectByExample(ShyLogDTO shyLogDTO) { | ||
| 37 | + logger.info("进入日志查询方法,参数接受对象为,ShyLogDTO:{}", JSON.toJSONString(shyLogDTO)); | ||
| 38 | + Example example = new Example(ShyActivity.class); | ||
| 39 | + //如果为空 按照倒序排序 分页查询所有 | ||
| 40 | + //以创建时间为条件进行倒序 | ||
| 41 | + example.setOrderByClause("`operation_time` desc"); | ||
| 42 | + | ||
| 43 | + Example.Criteria criteria = example.createCriteria(); | ||
| 44 | + PageHelper.startPage(shyLogDTO.getPage(), shyLogDTO.getPageSize()); | ||
| 45 | + List<ShyLog> shyLogs = shyLogMapper.selectByExample(example); | ||
| 46 | + PageInfo<ShyLog> shyLogPageInfo = new PageInfo<>(shyLogs); | ||
| 47 | + return shyLogPageInfo; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + /** | ||
| 51 | + * 添加日志记录 | ||
| 52 | + * | ||
| 53 | + * @param shyLog | ||
| 54 | + * @return | ||
| 55 | + */ | ||
| 56 | + public Integer addShyLog(ShyLog shyLog) { | ||
| 57 | + logger.info("进入日志添加方法 接受日志对象为,ShyLog:{}", JSON.toJSONString(shyLog)); | ||
| 58 | + int i = shyLogMapper.insertSelective(shyLog); | ||
| 59 | + return i; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | +} |
src/main/resources/mapper/ShyLogMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 3 | +<mapper namespace="com.cnlive.shenhe.mapper.ShyLogMapper"> | ||
| 4 | + <resultMap id="BaseResultMap" type="com.cnlive.shenhe.entity.ShyLog"> | ||
| 5 | + <!-- | ||
| 6 | + WARNING - @mbg.generated | ||
| 7 | + --> | ||
| 8 | + <result column="video_id" jdbcType="VARCHAR" property="videoId" /> | ||
| 9 | + <result column="video_name" jdbcType="VARCHAR" property="videoName" /> | ||
| 10 | + <result column="operator" jdbcType="VARCHAR" property="operator" /> | ||
| 11 | + <result column="operation_time" jdbcType="TIMESTAMP" property="operationTime" /> | ||
| 12 | + <result column="operation_type" jdbcType="VARCHAR" property="operationType" /> | ||
| 13 | + <result column="remark" jdbcType="VARCHAR" property="remark" /> | ||
| 14 | + </resultMap> | ||
| 15 | +</mapper> | ||
| 0 | \ No newline at end of file | 16 | \ No newline at end of file |
src/main/resources/templates/common/frame.html
| @@ -99,6 +99,7 @@ line-height: 2em; margin: 0 auto;font-size: 2em" | @@ -99,6 +99,7 @@ line-height: 2em; margin: 0 auto;font-size: 2em" | ||
| 99 | <li><a href="/usersFree/page" id="/usersFree/page"> 网++白名单管理</a></li> | 99 | <li><a href="/usersFree/page" id="/usersFree/page"> 网++白名单管理</a></li> |
| 100 | <li><a href="/notSpeak/page" id="/notSpeak/page"> 网++禁言管理</a></li> | 100 | <li><a href="/notSpeak/page" id="/notSpeak/page"> 网++禁言管理</a></li> |
| 101 | <li><a href="/activity/page" id="/activity/page"> 活动管理</a></li> | 101 | <li><a href="/activity/page" id="/activity/page"> 活动管理</a></li> |
| 102 | + <li><a href="/log/page" id="/log/page"> 日志管理</a></li> | ||
| 102 | </ul> | 103 | </ul> |
| 103 | </li> | 104 | </li> |
| 104 | </ul> | 105 | </ul> |
src/main/resources/templates/page/log.html
0 → 100644
| 1 | +<!DOCTYPE html> | ||
| 2 | +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> | ||
| 3 | + | ||
| 4 | +<head th:replace="../templates/common/head::head"></head> | ||
| 5 | +<style> | ||
| 6 | + .fixed-table-toolbar .bs-bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search{margin-top: 0px;} | ||
| 7 | + .table{margin-bottom:0;} | ||
| 8 | + | ||
| 9 | +</style> | ||
| 10 | +<body class="skin-blue sidebar-mini"> | ||
| 11 | + | ||
| 12 | +<div class="wrapper"> | ||
| 13 | + | ||
| 14 | + <div th:replace="../templates/common/frame::frame"></div> | ||
| 15 | + | ||
| 16 | + <div class="content-wrapper" style="min-height: 788px;"> | ||
| 17 | + <section class="content-header"> | ||
| 18 | + <h1> | ||
| 19 | + 日志操作记录管理 | ||
| 20 | + </h1> | ||
| 21 | + <ol class="breadcrumb"> | ||
| 22 | + <li>首页</li> | ||
| 23 | + <li>系统管理</li> | ||
| 24 | + <li class="active">日志操作记录管理</li> | ||
| 25 | + </ol> | ||
| 26 | + </section> | ||
| 27 | + <section class="content"> | ||
| 28 | + <div class="row"> | ||
| 29 | + <div class="col-xs-12"> | ||
| 30 | + <div class="box box-info"> | ||
| 31 | + <div class="box-body"> | ||
| 32 | + <div class="bootstrap-table"> | ||
| 33 | + <div class="fixed-table-toolbar"> | ||
| 34 | + <div class="bs-bars pull-left"> | ||
| 35 | + <div id="toolbar" class="btn-group"> | ||
| 36 | + </div> | ||
| 37 | + </div> | ||
| 38 | + <div class="columns columns-right btn-group pull-right"> | ||
| 39 | + <button class="btn btn-default" type="button" name="refresh" title="搜索" id="site_query">搜索</button> | ||
| 40 | + <ul class="dropdown-menu" role="menu"> | ||
| 41 | + <li><label><input type="checkbox" data-field="sp_id" value="0" | ||
| 42 | + checked="checked"> 视频ID</label></li> | ||
| 43 | + <li><label><input type="checkbox" data-field="sp_id_brief" value="1" | ||
| 44 | + checked="checked"> 视频名称</label></li> | ||
| 45 | + <li><label><input type="checkbox" data-field="type" value="2" | ||
| 46 | + checked="checked"> 操作人</label></li> | ||
| 47 | + <li><label><input type="checkbox" data-field="service_time" value="3" | ||
| 48 | + checked="checked"> 操作时间</label></li> | ||
| 49 | + <li><label><input type="checkbox" data-field="upload_time" value="4" | ||
| 50 | + checked="checked"> 操作类型</label></li> | ||
| 51 | + <li><label><input type="checkbox" data-field="action" value="6" | ||
| 52 | + checked="checked"> 备注</label></li> | ||
| 53 | + </ul> | ||
| 54 | + </div> | ||
| 55 | + </div> | ||
| 56 | + <div class="pull-right search"> | ||
| 57 | + <form id="searchForm"> | ||
| 58 | + <input class="form-control" type="text" placeholder="搜索" id="keyword" name="keyword" th:value="${param.keyword}"> | ||
| 59 | + </form> | ||
| 60 | + </div> | ||
| 61 | + </div> | ||
| 62 | + <div class="fixed-table-container" style="padding-bottom: 0px;"> | ||
| 63 | + <div class="fixed-table-body"> | ||
| 64 | + <table data-toggle="table" data-pagination="true" | ||
| 65 | + data-search="false" data-show-refresh="true" data-show-toggle="true" | ||
| 66 | + data-show-columns="true" data-toolbar="#toolbar" | ||
| 67 | + class="table table-hover"> | ||
| 68 | + <thead> | ||
| 69 | + <tr> | ||
| 70 | + <th style="text-align: center; width: 50px; " data-field="sp_id" | ||
| 71 | + tabindex="0"> | ||
| 72 | + <div class="th-inner ">视频ID</div> | ||
| 73 | + <div class="fht-cell"></div> | ||
| 74 | + </th> | ||
| 75 | + <th style="text-align: center; width: 120px; " data-field="sp_id_brief" | ||
| 76 | + tabindex="0"> | ||
| 77 | + <div class="th-inner ">视频名称</div> | ||
| 78 | + <div class="fht-cell"></div> | ||
| 79 | + </th> | ||
| 80 | + <th style="text-align: center; width: 200px; " data-field="type" | ||
| 81 | + tabindex="0"> | ||
| 82 | + <div class="th-inner ">操作人 | ||
| 83 | + </div> | ||
| 84 | + <div class="fht-cell"></div> | ||
| 85 | + </th> | ||
| 86 | + <th style="text-align: center; width: 120px; " data-field="upload_time" | ||
| 87 | + tabindex="0"> | ||
| 88 | + <div class="th-inner ">操作时间 | ||
| 89 | + </div> | ||
| 90 | + <div class="fht-cell"></div> | ||
| 91 | + </th> | ||
| 92 | + <th style="text-align: center; width: 120px; " data-field="updated_at" | ||
| 93 | + tabindex="0"> | ||
| 94 | + <div class="th-inner ">操作类型</div> | ||
| 95 | + <div class="fht-cell"></div> | ||
| 96 | + </th> | ||
| 97 | + <th style="text-align: center; width: 100px; " data-field="action" | ||
| 98 | + tabindex="0"> | ||
| 99 | + <div class="th-inner ">备注 | ||
| 100 | + </div> | ||
| 101 | + <div class="fht-cell"></div> | ||
| 102 | + </th> | ||
| 103 | + </tr> | ||
| 104 | + </thead> | ||
| 105 | + <tbody> | ||
| 106 | + <tr th:data-index="${logStat.index}" th:each="log : ${shyLogPageInfo.list}"> | ||
| 107 | + <td style="text-align: center; width: 50px;" th:text="${log.videoId}">视频ID</td> | ||
| 108 | + <td style="text-align: center; width: 120px;" th:text="${log.videoName}">视频名称</td> | ||
| 109 | + <td style="text-align: center; width: 200px;" th:text="${log.operator}">操作人</td> | ||
| 110 | + <td style="text-align: center; width: 120px;" th:text="${#dates.format(log.operationTime, 'yyyy-MM-dd HH:mm:ss')}">2018-11-22 23:08:48</td> | ||
| 111 | + <td style="text-align: center; width: 120px;" th:text="${log.operationType}">操作类型</td> | ||
| 112 | + <td style="text-align: center; width: 120px;" th:text="${log.remark}">备注</td> | ||
| 113 | + </tr> | ||
| 114 | + | ||
| 115 | + </tbody> | ||
| 116 | + </table> | ||
| 117 | + </div> | ||
| 118 | + | ||
| 119 | + <div class="fixed-table-pagination" style="display: block;"> | ||
| 120 | + <div class="pull-left pagination-detail"> | ||
| 121 | + <span class="pagination-info" th:text="'共 '+${shyLogPageInfo.total}+' 条记录,每页显示'">共 0 条记录</span> | ||
| 122 | + <select class="" id="pageSize" name="pageSize" onchange="selectPageSize()"> | ||
| 123 | + <option value="10" th:selected="${pageSize==10}">10</option> | ||
| 124 | + <option value="20" th:selected="${pageSize==20}">20</option> | ||
| 125 | + <option value="50" th:selected="${pageSize==50}">50</option> | ||
| 126 | + <option value="100" th:selected="${pageSize==100}">100</option> | ||
| 127 | + </select> | ||
| 128 | + <span class="pagination-info" >条记录</span> | ||
| 129 | + </div> | ||
| 130 | + <div class="pull-right pagination"> | ||
| 131 | + <ul class="pagination" th:if="${shyLogPageInfo.pages>1}"> | ||
| 132 | + <li class="page-pre"><a th:href="'javascript:fanye(1);'">‹‹</a></li> | ||
| 133 | + <li class="page-pre" th:if="${!shyLogPageInfo.isFirstPage}"><a | ||
| 134 | + th:onclick="'javascript:fanye(\''+${shyLogPageInfo.pageNum-1}+'\');'">‹</a> | ||
| 135 | + </li> | ||
| 136 | + | ||
| 137 | + <li class="page-number" th:if="${shyLogPageInfo.pageNum-3>=1}"><a | ||
| 138 | + th:onclick="'javascript:fanye(\''+${shyLogPageInfo.pageNum-3}+'\');'" | ||
| 139 | + th:text="${shyLogPageInfo.pageNum-3}">2</a></li> | ||
| 140 | + <li class="page-number" th:if="${shyLogPageInfo.pageNum-2>=1}"><a | ||
| 141 | + th:onclick="'javascript:fanye(\''+${shyLogPageInfo.pageNum-2}+'\');'" | ||
| 142 | + th:text="${shyLogPageInfo.pageNum-2}">2</a></li> | ||
| 143 | + <li class="page-number" th:if="${shyLogPageInfo.pageNum-1>=1}"><a | ||
| 144 | + th:onclick="'javascript:fanye(\''+${shyLogPageInfo.pageNum-1}+'\');'" | ||
| 145 | + th:text="${shyLogPageInfo.pageNum-1}">2</a></li> | ||
| 146 | + <li class="page-number active"><a href="javaScript:void(0);" | ||
| 147 | + th:text="${shyLogPageInfo.pageNum}">2</a></li> | ||
| 148 | + <li class="page-number" th:if="${shyLogPageInfo.pageNum+1<=shyLogPageInfo.pages}"><a | ||
| 149 | + th:onclick="'javascript:fanye(\''+${shyLogPageInfo.pageNum+1}+'\');'" | ||
| 150 | + th:text="${shyLogPageInfo.pageNum+1}">2</a></li> | ||
| 151 | + <li class="page-number" th:if="${shyLogPageInfo.pageNum+2<=shyLogPageInfo.pages}"><a | ||
| 152 | + th:onclick="'javascript:fanye(\''+${shyLogPageInfo.pageNum+2}+'\');'" | ||
| 153 | + th:text="${shyLogPageInfo.pageNum+2}">2</a></li> | ||
| 154 | + <li class="page-number" th:if="${shyLogPageInfo.pageNum+3<=shyLogPageInfo.pages}"><a | ||
| 155 | + th:onclick="'javascript:fanye(\''+${shyLogPageInfo.pageNum+3}+'\');'" | ||
| 156 | + th:text="${shyLogPageInfo.pageNum+3}">2</a></li> | ||
| 157 | + | ||
| 158 | + <li class="page-next" th:if="${!shyLogPageInfo.isLastPage}"><a | ||
| 159 | + th:onclick="'javascript:fanye(\''+${shyLogPageInfo.pageNum+1}+'\');'">›</a> | ||
| 160 | + </li> | ||
| 161 | + <li class="page-next"><a | ||
| 162 | + th:onclick="'javascript:fanye(\''+${shyLogPageInfo.pages}+'\');'">››</a> | ||
| 163 | + </li> | ||
| 164 | + </ul> | ||
| 165 | + </div> | ||
| 166 | + </div> | ||
| 167 | + </div> | ||
| 168 | + </div> | ||
| 169 | + <div class="clearfix"></div> | ||
| 170 | + </div> | ||
| 171 | + </div> | ||
| 172 | + </div> | ||
| 173 | + </div> | ||
| 174 | + </section> | ||
| 175 | + </div> | ||
| 176 | + | ||
| 177 | + | ||
| 178 | + | ||
| 179 | +<!-- /.modal --> | ||
| 180 | + <script> | ||
| 181 | + //翻页函数 | ||
| 182 | + function fanye(page) { | ||
| 183 | + var param = location.search; | ||
| 184 | + if (param.indexOf("page=") != -1) { | ||
| 185 | + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连 | ||
| 186 | + var split = se.split("&"); | ||
| 187 | + var h = ""; | ||
| 188 | + for (var i = 0; i < split.length; i++) { | ||
| 189 | + var s = split[i]; | ||
| 190 | + if (s.indexOf("page=") < 0) h = h + "&" + split[i]; | ||
| 191 | + } | ||
| 192 | + h = h.substring(1, h.length); | ||
| 193 | + window.location.href = "/log/page?" + h + "&page=" + page; | ||
| 194 | + } else { | ||
| 195 | + param = param.substring(1, param.length); | ||
| 196 | + window.location.href = "/log/page?" + param + "&page=" + page; | ||
| 197 | + } | ||
| 198 | + } | ||
| 199 | + | ||
| 200 | + //选择每页数量触发函数 | ||
| 201 | + function selectPageSize(){ | ||
| 202 | + var pageSize=$("#pageSize").val(); | ||
| 203 | + var param = location.search; | ||
| 204 | + if (param.indexOf("pageSize=") != -1) { | ||
| 205 | + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连 | ||
| 206 | + var split = se.split("&"); | ||
| 207 | + var h = ""; | ||
| 208 | + for (var i = 0; i < split.length; i++) { | ||
| 209 | + var s = split[i]; | ||
| 210 | + if (s.indexOf("pageSize=") < 0 &&s.indexOf("page=") < 0) h = h + "&" + split[i]; | ||
| 211 | + } | ||
| 212 | + h = h.substring(1, h.length); | ||
| 213 | + window.location.href = "/sites/page?" + h + "&pageSize=" + pageSize; | ||
| 214 | + } else { | ||
| 215 | + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连 | ||
| 216 | + var split = se.split("&"); | ||
| 217 | + var h = ""; | ||
| 218 | + for (var i = 0; i < split.length; i++) { | ||
| 219 | + var s = split[i]; | ||
| 220 | + if (s.indexOf("page=") < 0) h = h + "&" + split[i]; | ||
| 221 | + } | ||
| 222 | + h = h.substring(1, h.length); | ||
| 223 | + window.location.href = "/log/page?" + h + "&pageSize=" + pageSize; | ||
| 224 | + } | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + //搜索 | ||
| 228 | + $('#site_query').click(function () { | ||
| 229 | + var keyword = $("#keyword").val(); | ||
| 230 | + var pageSize = $("#pageSize").val(); | ||
| 231 | + window.location.href = "/log/page?keyword=" + keyword + "&pageSize=" + pageSize; | ||
| 232 | + }); | ||
| 233 | + | ||
| 234 | + </script> | ||
| 235 | + | ||
| 236 | + <footer th:replace="../templates/common/foot::foot" ></footer> | ||
| 237 | + | ||
| 238 | + | ||
| 239 | + <!-- Add the sidebar's background. This div must be placed | ||
| 240 | + immediately after the control sidebar --> | ||
| 241 | + <div class="control-sidebar-bg" style="position: fixed; height: auto;"></div> | ||
| 242 | + | ||
| 243 | +</div><!-- ./wrapper --> | ||
| 244 | + | ||
| 245 | + | ||
| 246 | +<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip --> | ||
| 247 | +<script type="text/javascript"> | ||
| 248 | + $('div.alert').not('.alert-danger').delay(3000).slideUp(300); | ||
| 249 | +</script> | ||
| 250 | + | ||
| 251 | +<!-- AdminLTE App --> | ||
| 252 | +<script src="../../static/js/app.min.js"></script> | ||
| 253 | +<!-- AdminLTE for demo purposes --> | ||
| 254 | +<script src="../../static/js/sidebar.js"></script> | ||
| 255 | + | ||
| 256 | + | ||
| 257 | +</body> | ||
| 258 | +</html> | ||
| 0 | \ No newline at end of file | 259 | \ No newline at end of file |