Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
RuoYi Vue
Commits
46444bd0
Commit
46444bd0
authored
Oct 08, 2019
by
RuoYi
Browse files
RuoYi-Vue 1.0
parent
5bc74554
Changes
400
Hide whitespace changes
Inline
Side-by-side
ruoyi/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.framework.web.domain.server
;
import
java.lang.management.ManagementFactory
;
import
com.ruoyi.common.utils.Arith
;
import
com.ruoyi.common.utils.DateUtils
;
/**
* JVM相关信息
*
* @author ruoyi
*/
public
class
Jvm
{
/**
* 当前JVM占用的内存总数(M)
*/
private
double
total
;
/**
* JVM最大可用内存总数(M)
*/
private
double
max
;
/**
* JVM空闲内存(M)
*/
private
double
free
;
/**
* JDK版本
*/
private
String
version
;
/**
* JDK路径
*/
private
String
home
;
public
double
getTotal
()
{
return
Arith
.
div
(
total
,
(
1024
*
1024
),
2
);
}
public
void
setTotal
(
double
total
)
{
this
.
total
=
total
;
}
public
double
getMax
()
{
return
Arith
.
div
(
max
,
(
1024
*
1024
),
2
);
}
public
void
setMax
(
double
max
)
{
this
.
max
=
max
;
}
public
double
getFree
()
{
return
Arith
.
div
(
free
,
(
1024
*
1024
),
2
);
}
public
void
setFree
(
double
free
)
{
this
.
free
=
free
;
}
public
double
getUsed
()
{
return
Arith
.
div
(
total
-
free
,
(
1024
*
1024
),
2
);
}
public
double
getUsage
()
{
return
Arith
.
mul
(
Arith
.
div
(
total
-
free
,
total
,
4
),
100
);
}
/**
* 获取JDK名称
*/
public
String
getName
()
{
return
ManagementFactory
.
getRuntimeMXBean
().
getVmName
();
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getHome
()
{
return
home
;
}
public
void
setHome
(
String
home
)
{
this
.
home
=
home
;
}
/**
* JDK启动时间
*/
public
String
getStartTime
()
{
return
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD_HH_MM_SS
,
DateUtils
.
getServerStartDate
());
}
/**
* JDK运行时间
*/
public
String
getRunTime
()
{
return
DateUtils
.
getDatePoor
(
DateUtils
.
getNowDate
(),
DateUtils
.
getServerStartDate
());
}
}
ruoyi/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.framework.web.domain.server
;
import
com.ruoyi.common.utils.Arith
;
/**
* 內存相关信息
*
* @author ruoyi
*/
public
class
Mem
{
/**
* 内存总量
*/
private
double
total
;
/**
* 已用内存
*/
private
double
used
;
/**
* 剩余内存
*/
private
double
free
;
public
double
getTotal
()
{
return
Arith
.
div
(
total
,
(
1024
*
1024
*
1024
),
2
);
}
public
void
setTotal
(
long
total
)
{
this
.
total
=
total
;
}
public
double
getUsed
()
{
return
Arith
.
div
(
used
,
(
1024
*
1024
*
1024
),
2
);
}
public
void
setUsed
(
long
used
)
{
this
.
used
=
used
;
}
public
double
getFree
()
{
return
Arith
.
div
(
free
,
(
1024
*
1024
*
1024
),
2
);
}
public
void
setFree
(
long
free
)
{
this
.
free
=
free
;
}
public
double
getUsage
()
{
return
Arith
.
mul
(
Arith
.
div
(
used
,
total
,
4
),
100
);
}
}
ruoyi/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.framework.web.domain.server
;
/**
* 系统相关信息
*
* @author ruoyi
*/
public
class
Sys
{
/**
* 服务器名称
*/
private
String
computerName
;
/**
* 服务器Ip
*/
private
String
computerIp
;
/**
* 项目路径
*/
private
String
userDir
;
/**
* 操作系统
*/
private
String
osName
;
/**
* 系统架构
*/
private
String
osArch
;
public
String
getComputerName
()
{
return
computerName
;
}
public
void
setComputerName
(
String
computerName
)
{
this
.
computerName
=
computerName
;
}
public
String
getComputerIp
()
{
return
computerIp
;
}
public
void
setComputerIp
(
String
computerIp
)
{
this
.
computerIp
=
computerIp
;
}
public
String
getUserDir
()
{
return
userDir
;
}
public
void
setUserDir
(
String
userDir
)
{
this
.
userDir
=
userDir
;
}
public
String
getOsName
()
{
return
osName
;
}
public
void
setOsName
(
String
osName
)
{
this
.
osName
=
osName
;
}
public
String
getOsArch
()
{
return
osArch
;
}
public
void
setOsArch
(
String
osArch
)
{
this
.
osArch
=
osArch
;
}
}
ruoyi/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.framework.web.domain.server
;
/**
* 系统文件相关信息
*
* @author ruoyi
*/
public
class
SysFile
{
/**
* 盘符路径
*/
private
String
dirName
;
/**
* 盘符类型
*/
private
String
sysTypeName
;
/**
* 文件类型
*/
private
String
typeName
;
/**
* 总大小
*/
private
String
total
;
/**
* 剩余大小
*/
private
String
free
;
/**
* 已经使用量
*/
private
String
used
;
/**
* 资源的使用率
*/
private
double
usage
;
public
String
getDirName
()
{
return
dirName
;
}
public
void
setDirName
(
String
dirName
)
{
this
.
dirName
=
dirName
;
}
public
String
getSysTypeName
()
{
return
sysTypeName
;
}
public
void
setSysTypeName
(
String
sysTypeName
)
{
this
.
sysTypeName
=
sysTypeName
;
}
public
String
getTypeName
()
{
return
typeName
;
}
public
void
setTypeName
(
String
typeName
)
{
this
.
typeName
=
typeName
;
}
public
String
getTotal
()
{
return
total
;
}
public
void
setTotal
(
String
total
)
{
this
.
total
=
total
;
}
public
String
getFree
()
{
return
free
;
}
public
void
setFree
(
String
free
)
{
this
.
free
=
free
;
}
public
String
getUsed
()
{
return
used
;
}
public
void
setUsed
(
String
used
)
{
this
.
used
=
used
;
}
public
double
getUsage
()
{
return
usage
;
}
public
void
setUsage
(
double
usage
)
{
this
.
usage
=
usage
;
}
}
ruoyi/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.framework.web.exception
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.security.access.AccessDeniedException
;
import
org.springframework.security.authentication.AccountExpiredException
;
import
org.springframework.security.core.userdetails.UsernameNotFoundException
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.RestControllerAdvice
;
import
org.springframework.web.servlet.NoHandlerFoundException
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.exception.BaseException
;
import
com.ruoyi.common.exception.CustomException
;
import
com.ruoyi.common.exception.DemoModeException
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.framework.web.domain.AjaxResult
;
/**
* 全局异常处理器
*
* @author ruoyi
*/
@RestControllerAdvice
public
class
GlobalExceptionHandler
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
GlobalExceptionHandler
.
class
);
/**
* 基础异常
*/
@ExceptionHandler
(
BaseException
.
class
)
public
AjaxResult
baseException
(
BaseException
e
)
{
return
AjaxResult
.
error
(
e
.
getMessage
());
}
/**
* 业务异常
*/
@ExceptionHandler
(
CustomException
.
class
)
public
AjaxResult
businessException
(
CustomException
e
)
{
if
(
StringUtils
.
isNull
(
e
.
getCode
()))
{
return
AjaxResult
.
error
(
e
.
getMessage
());
}
return
AjaxResult
.
error
(
e
.
getCode
(),
e
.
getMessage
());
}
@ExceptionHandler
(
NoHandlerFoundException
.
class
)
public
AjaxResult
handlerNoFoundException
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
AjaxResult
.
error
(
HttpStatus
.
NOT_FOUND
,
"路径不存在,请检查路径是否正确"
);
}
@ExceptionHandler
(
AccessDeniedException
.
class
)
public
AjaxResult
handleAuthorizationException
(
AccessDeniedException
e
)
{
log
.
error
(
e
.
getMessage
());
return
AjaxResult
.
error
(
HttpStatus
.
FORBIDDEN
,
"没有权限,请联系管理员授权"
);
}
@ExceptionHandler
(
AccountExpiredException
.
class
)
public
AjaxResult
handleAccountExpiredException
(
AccountExpiredException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
AjaxResult
.
error
(
e
.
getMessage
());
}
@ExceptionHandler
(
UsernameNotFoundException
.
class
)
public
AjaxResult
handleUsernameNotFoundException
(
UsernameNotFoundException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
AjaxResult
.
error
(
e
.
getMessage
());
}
@ExceptionHandler
(
Exception
.
class
)
public
AjaxResult
handleException
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
AjaxResult
.
error
(
e
.
getMessage
());
}
/**
* 演示模式异常
*/
@ExceptionHandler
(
DemoModeException
.
class
)
public
AjaxResult
demoModeException
(
DemoModeException
e
)
{
return
AjaxResult
.
error
(
"演示模式,不允许操作"
);
}
}
ruoyi/src/main/java/com/ruoyi/framework/web/page/PageDomain.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.framework.web.page
;
import
com.ruoyi.common.utils.StringUtils
;
/**
* 分页数据
*
* @author ruoyi
*/
public
class
PageDomain
{
/** 当前记录起始索引 */
private
Integer
pageNum
;
/** 每页显示记录数 */
private
Integer
pageSize
;
/** 排序列 */
private
String
orderByColumn
;
/** 排序的方向 "desc" 或者 "asc". */
private
String
isAsc
;
public
String
getOrderBy
()
{
if
(
StringUtils
.
isEmpty
(
orderByColumn
))
{
return
""
;
}
return
StringUtils
.
toUnderScoreCase
(
orderByColumn
)
+
" "
+
isAsc
;
}
public
Integer
getPageNum
()
{
return
pageNum
;
}
public
void
setPageNum
(
Integer
pageNum
)
{
this
.
pageNum
=
pageNum
;
}
public
Integer
getPageSize
()
{
return
pageSize
;
}
public
void
setPageSize
(
Integer
pageSize
)
{
this
.
pageSize
=
pageSize
;
}
public
String
getOrderByColumn
()
{
return
orderByColumn
;
}
public
void
setOrderByColumn
(
String
orderByColumn
)
{
this
.
orderByColumn
=
orderByColumn
;
}
public
String
getIsAsc
()
{
return
isAsc
;
}
public
void
setIsAsc
(
String
isAsc
)
{
this
.
isAsc
=
isAsc
;
}
}
ruoyi/src/main/java/com/ruoyi/framework/web/page/TableDataInfo.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.framework.web.page
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 表格分页数据对象
*
* @author ruoyi
*/
public
class
TableDataInfo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/** 总记录数 */
private
long
total
;
/** 列表数据 */
private
List
<?>
rows
;
/** 消息状态码 */
private
int
code
;
/** 消息内容 */
private
int
msg
;
/**
* 表格数据对象
*/
public
TableDataInfo
()
{
}
/**
* 分页
*
* @param list 列表数据
* @param total 总记录数
*/
public
TableDataInfo
(
List
<?>
list
,
int
total
)
{
this
.
rows
=
list
;
this
.
total
=
total
;
}
public
long
getTotal
()
{
return
total
;
}
public
void
setTotal
(
long
total
)
{
this
.
total
=
total
;
}
public
List
<?>
getRows
()
{
return
rows
;
}
public
void
setRows
(
List
<?>
rows
)
{
this
.
rows
=
rows
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
public
int
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
int
msg
)
{
this
.
msg
=
msg
;
}
}
\ No newline at end of file
ruoyi/src/main/java/com/ruoyi/framework/web/page/TableSupport.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.framework.web.page
;
import
com.ruoyi.common.utils.ServletUtils
;
/**
* 表格数据处理
*
* @author ruoyi
*/
public
class
TableSupport
{
/**
* 当前记录起始索引
*/
public
static
final
String
PAGE_NUM
=
"pageNum"
;
/**
* 每页显示记录数
*/
public
static
final
String
PAGE_SIZE
=
"pageSize"
;
/**
* 排序列
*/
public
static
final
String
ORDER_BY_COLUMN
=
"orderByColumn"
;
/**
* 排序的方向 "desc" 或者 "asc".
*/
public
static
final
String
IS_ASC
=
"isAsc"
;
/**
* 封装分页对象
*/
public
static
PageDomain
getPageDomain
()
{
PageDomain
pageDomain
=
new
PageDomain
();
pageDomain
.
setPageNum
(
ServletUtils
.
getParameterToInt
(
PAGE_NUM
));
pageDomain
.
setPageSize
(
ServletUtils
.
getParameterToInt
(
PAGE_SIZE
));
pageDomain
.
setOrderByColumn
(
ServletUtils
.
getParameter
(
ORDER_BY_COLUMN
));
pageDomain
.
setIsAsc
(
ServletUtils
.
getParameter
(
IS_ASC
));
return
pageDomain
;
}
public
static
PageDomain
buildPageRequest
()
{
return
getPageDomain
();
}
}
ruoyi/src/main/java/com/ruoyi/project/common/CaptchaController.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.project.common
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.util.concurrent.TimeUnit
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ruoyi.common.constant.Constants
;
import
com.ruoyi.common.utils.IdUtils
;
import
com.ruoyi.common.utils.VerifyCodeUtils
;
import
com.ruoyi.common.utils.sign.Base64
;
import
com.ruoyi.framework.redis.RedisCache
;
import
com.ruoyi.framework.web.domain.AjaxResult
;
/**
* 验证码操作处理
*
* @author ruoyi
*/
@RestController
public
class
CaptchaController
{
@Autowired
private
RedisCache
redisCache
;
/**
* 生成验证码
*/
@GetMapping
(
"/captchaImage"
)
public
AjaxResult
getCode
(
HttpServletResponse
response
)
throws
IOException
{
// 生成随机字串
String
verifyCode
=
VerifyCodeUtils
.
generateVerifyCode
(
4
);
// 唯一标识
String
uuid
=
IdUtils
.
simpleUUID
();
String
verifyKey
=
Constants
.
CAPTCHA_CODE_KEY
+
uuid
;
redisCache
.
setCacheObject
(
verifyKey
,
verifyCode
,
Constants
.
CAPTCHA_EXPIRATION
,
TimeUnit
.
MINUTES
);
// 生成图片
int
w
=
111
,
h
=
36
;
ByteArrayOutputStream
stream
=
new
ByteArrayOutputStream
();
VerifyCodeUtils
.
outputImage
(
w
,
h
,
stream
,
verifyCode
);
try
{
AjaxResult
ajax
=
AjaxResult
.
success
();
ajax
.
put
(
"uuid"
,
uuid
);
ajax
.
put
(
"img"
,
Base64
.
encode
(
stream
.
toByteArray
()));
return
ajax
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
AjaxResult
.
error
(
e
.
getMessage
());
}
finally
{
stream
.
close
();
}
}
}
ruoyi/src/main/java/com/ruoyi/project/common/CommonController.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.project.common
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.ruoyi.common.utils.file.FileUploadUtils
;
import
com.ruoyi.framework.config.RuoYiConfig
;
import
com.ruoyi.framework.config.ServerConfig
;
import
com.ruoyi.framework.web.domain.AjaxResult
;
/**
* 通用请求处理
*
* @author ruoyi
*/
@RestController
public
class
CommonController
{
@Autowired
private
ServerConfig
serverConfig
;
/**
* 通用上传请求
*/
@PostMapping
(
"/common/upload"
)
public
AjaxResult
uploadFile
(
MultipartFile
file
)
throws
Exception
{
try
{
// 上传文件路径
String
filePath
=
RuoYiConfig
.
getUploadPath
();
// 上传并返回新文件名称
String
fileName
=
FileUploadUtils
.
upload
(
filePath
,
file
);
String
url
=
serverConfig
.
getUrl
()
+
fileName
;
AjaxResult
ajax
=
AjaxResult
.
success
();
ajax
.
put
(
"fileName"
,
fileName
);
ajax
.
put
(
"url"
,
url
);
return
ajax
;
}
catch
(
Exception
e
)
{
return
AjaxResult
.
error
(
e
.
getMessage
());
}
}
}
ruoyi/src/main/java/com/ruoyi/project/monitor/controller/ServerController.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.project.monitor.controller
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ruoyi.framework.web.controller.BaseController
;
import
com.ruoyi.framework.web.domain.AjaxResult
;
import
com.ruoyi.framework.web.domain.Server
;
/**
* 服务器监控
*
* @author ruoyi
*/
@RestController
@RequestMapping
(
"/monitor/server"
)
public
class
ServerController
extends
BaseController
{
@PreAuthorize
(
"@ss.hasPermi('monitor:server:list')"
)
@GetMapping
()
public
AjaxResult
getInfo
()
throws
Exception
{
Server
server
=
new
Server
();
server
.
copyTo
();
return
AjaxResult
.
success
(
server
);
}
}
ruoyi/src/main/java/com/ruoyi/project/monitor/controller/SysLogininforController.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.project.monitor.controller
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ruoyi.framework.web.controller.BaseController
;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.project.monitor.domain.SysLogininfor
;
import
com.ruoyi.project.monitor.service.ISysLogininforService
;
/**
* 系统访问记录
*
* @author ruoyi
*/
@RestController
@RequestMapping
(
"/monitor/logininfor"
)
public
class
SysLogininforController
extends
BaseController
{
@Autowired
private
ISysLogininforService
logininforService
;
@PreAuthorize
(
"@ss.hasPermi('monitor:logininfor:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SysLogininfor
logininfor
)
{
startPage
();
List
<
SysLogininfor
>
list
=
logininforService
.
selectLogininforList
(
logininfor
);
return
getDataTable
(
list
);
}
}
ruoyi/src/main/java/com/ruoyi/project/monitor/controller/SysOperlogController.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.project.monitor.controller
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ruoyi.framework.web.controller.BaseController
;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.project.monitor.domain.SysOperLog
;
import
com.ruoyi.project.monitor.service.ISysOperLogService
;
/**
* 操作日志记录
*
* @author ruoyi
*/
@RestController
@RequestMapping
(
"/monitor/operlog"
)
public
class
SysOperlogController
extends
BaseController
{
@Autowired
private
ISysOperLogService
operLogService
;
@PreAuthorize
(
"@ss.hasPermi('monitor:operlog:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SysOperLog
operLog
)
{
startPage
();
List
<
SysOperLog
>
list
=
operLogService
.
selectOperLogList
(
operLog
);
return
getDataTable
(
list
);
}
}
ruoyi/src/main/java/com/ruoyi/project/monitor/domain/SysLogininfor.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.project.monitor.domain
;
import
java.util.Date
;
import
com.ruoyi.framework.web.domain.BaseEntity
;
/**
* 系统访问记录表 sys_logininfor
*
* @author ruoyi
*/
public
class
SysLogininfor
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** ID */
private
Long
infoId
;
/** 用户账号 */
private
String
userName
;
/** 登录状态 0成功 1失败 */
private
String
status
;
/** 登录IP地址 */
private
String
ipaddr
;
/** 登录地点 */
private
String
loginLocation
;
/** 浏览器类型 */
private
String
browser
;
/** 操作系统 */
private
String
os
;
/** 提示消息 */
private
String
msg
;
/** 访问时间 */
private
Date
loginTime
;
public
Long
getInfoId
()
{
return
infoId
;
}
public
void
setInfoId
(
Long
infoId
)
{
this
.
infoId
=
infoId
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getIpaddr
()
{
return
ipaddr
;
}
public
void
setIpaddr
(
String
ipaddr
)
{
this
.
ipaddr
=
ipaddr
;
}
public
String
getLoginLocation
()
{
return
loginLocation
;
}
public
void
setLoginLocation
(
String
loginLocation
)
{
this
.
loginLocation
=
loginLocation
;
}
public
String
getBrowser
()
{
return
browser
;
}
public
void
setBrowser
(
String
browser
)
{
this
.
browser
=
browser
;
}
public
String
getOs
()
{
return
os
;
}
public
void
setOs
(
String
os
)
{
this
.
os
=
os
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
public
Date
getLoginTime
()
{
return
loginTime
;
}
public
void
setLoginTime
(
Date
loginTime
)
{
this
.
loginTime
=
loginTime
;
}
}
\ No newline at end of file
ruoyi/src/main/java/com/ruoyi/project/monitor/domain/SysOperLog.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.project.monitor.domain
;
import
java.util.Date
;
import
com.ruoyi.framework.web.domain.BaseEntity
;
/**
* 操作日志记录表 oper_log
*
* @author ruoyi
*/
public
class
SysOperLog
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 日志主键 */
private
Long
operId
;
/** 操作模块 */
private
String
title
;
/** 业务类型(0其它 1新增 2修改 3删除) */
private
Integer
businessType
;
/** 业务类型数组 */
private
Integer
[]
businessTypes
;
/** 请求方法 */
private
String
method
;
/** 请求方式 */
private
String
requestMethod
;
/** 操作类别(0其它 1后台用户 2手机端用户) */
private
Integer
operatorType
;
/** 操作人员 */
private
String
operName
;
/** 部门名称 */
private
String
deptName
;
/** 请求url */
private
String
operUrl
;
/** 操作地址 */
private
String
operIp
;
/** 操作地点 */
private
String
operLocation
;
/** 请求参数 */
private
String
operParam
;
/** 返回参数 */
private
String
jsonResult
;
/** 操作状态(0正常 1异常) */
private
Integer
status
;
/** 错误消息 */
private
String
errorMsg
;
/** 操作时间 */
private
Date
operTime
;
public
Long
getOperId
()
{
return
operId
;
}
public
void
setOperId
(
Long
operId
)
{
this
.
operId
=
operId
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
Integer
getBusinessType
()
{
return
businessType
;
}
public
void
setBusinessType
(
Integer
businessType
)
{
this
.
businessType
=
businessType
;
}
public
Integer
[]
getBusinessTypes
()
{
return
businessTypes
;
}
public
void
setBusinessTypes
(
Integer
[]
businessTypes
)
{
this
.
businessTypes
=
businessTypes
;
}
public
String
getMethod
()
{
return
method
;
}
public
void
setMethod
(
String
method
)
{
this
.
method
=
method
;
}
public
String
getRequestMethod
()
{
return
requestMethod
;
}
public
void
setRequestMethod
(
String
requestMethod
)
{
this
.
requestMethod
=
requestMethod
;
}
public
Integer
getOperatorType
()
{
return
operatorType
;
}
public
void
setOperatorType
(
Integer
operatorType
)
{
this
.
operatorType
=
operatorType
;
}
public
String
getOperName
()
{
return
operName
;
}
public
void
setOperName
(
String
operName
)
{
this
.
operName
=
operName
;
}
public
String
getDeptName
()
{
return
deptName
;
}
public
void
setDeptName
(
String
deptName
)
{
this
.
deptName
=
deptName
;
}
public
String
getOperUrl
()
{
return
operUrl
;
}
public
void
setOperUrl
(
String
operUrl
)
{
this
.
operUrl
=
operUrl
;
}
public
String
getOperIp
()
{
return
operIp
;
}
public
void
setOperIp
(
String
operIp
)
{
this
.
operIp
=
operIp
;
}
public
String
getOperLocation
()
{
return
operLocation
;
}
public
void
setOperLocation
(
String
operLocation
)
{
this
.
operLocation
=
operLocation
;
}
public
String
getOperParam
()
{
return
operParam
;
}
public
void
setOperParam
(
String
operParam
)
{
this
.
operParam
=
operParam
;
}
public
String
getJsonResult
()
{
return
jsonResult
;
}
public
void
setJsonResult
(
String
jsonResult
)
{
this
.
jsonResult
=
jsonResult
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
String
getErrorMsg
()
{
return
errorMsg
;
}
public
void
setErrorMsg
(
String
errorMsg
)
{
this
.
errorMsg
=
errorMsg
;
}
public
Date
getOperTime
()
{
return
operTime
;
}
public
void
setOperTime
(
Date
operTime
)
{
this
.
operTime
=
operTime
;
}
}
ruoyi/src/main/java/com/ruoyi/project/monitor/mapper/SysLogininforMapper.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.project.monitor.mapper
;
import
java.util.List
;
import
com.ruoyi.project.monitor.domain.SysLogininfor
;
/**
* 系统访问日志情况信息 数据层
*
* @author ruoyi
*/
public
interface
SysLogininforMapper
{
/**
* 新增系统登录日志
*
* @param logininfor 访问日志对象
*/
public
void
insertLogininfor
(
SysLogininfor
logininfor
);
/**
* 查询系统登录日志集合
*
* @param logininfor 访问日志对象
* @return 登录记录集合
*/
public
List
<
SysLogininfor
>
selectLogininforList
(
SysLogininfor
logininfor
);
/**
* 批量删除系统登录日志
*
* @param ids 需要删除的数据
* @return 结果
*/
public
int
deleteLogininforByIds
(
String
[]
ids
);
/**
* 清空系统登录日志
*
* @return 结果
*/
public
int
cleanLogininfor
();
}
ruoyi/src/main/java/com/ruoyi/project/monitor/mapper/SysOperLogMapper.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.project.monitor.mapper
;
import
java.util.List
;
import
com.ruoyi.project.monitor.domain.SysOperLog
;
/**
* 操作日志 数据层
*
* @author ruoyi
*/
public
interface
SysOperLogMapper
{
/**
* 新增操作日志
*
* @param operLog 操作日志对象
*/
public
void
insertOperlog
(
SysOperLog
operLog
);
/**
* 查询系统操作日志集合
*
* @param operLog 操作日志对象
* @return 操作日志集合
*/
public
List
<
SysOperLog
>
selectOperLogList
(
SysOperLog
operLog
);
/**
* 批量删除系统操作日志
*
* @param ids 需要删除的数据
* @return 结果
*/
public
int
deleteOperLogByIds
(
String
[]
ids
);
/**
* 查询操作日志详细
*
* @param operId 操作ID
* @return 操作日志对象
*/
public
SysOperLog
selectOperLogById
(
Long
operId
);
/**
* 清空操作日志
*/
public
void
cleanOperLog
();
}
ruoyi/src/main/java/com/ruoyi/project/monitor/service/ISysLogininforService.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.project.monitor.service
;
import
java.util.List
;
import
com.ruoyi.project.monitor.domain.SysLogininfor
;
/**
* 系统访问日志情况信息 服务层
*
* @author ruoyi
*/
public
interface
ISysLogininforService
{
/**
* 新增系统登录日志
*
* @param logininfor 访问日志对象
*/
public
void
insertLogininfor
(
SysLogininfor
logininfor
);
/**
* 查询系统登录日志集合
*
* @param logininfor 访问日志对象
* @return 登录记录集合
*/
public
List
<
SysLogininfor
>
selectLogininforList
(
SysLogininfor
logininfor
);
/**
* 批量删除系统登录日志
*
* @param ids 需要删除的数据
* @return
*/
public
int
deleteLogininforByIds
(
String
ids
);
/**
* 清空系统登录日志
*/
public
void
cleanLogininfor
();
}
ruoyi/src/main/java/com/ruoyi/project/monitor/service/ISysOperLogService.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.project.monitor.service
;
import
java.util.List
;
import
com.ruoyi.project.monitor.domain.SysOperLog
;
/**
* 操作日志 服务层
*
* @author ruoyi
*/
public
interface
ISysOperLogService
{
/**
* 新增操作日志
*
* @param operLog 操作日志对象
*/
public
void
insertOperlog
(
SysOperLog
operLog
);
/**
* 查询系统操作日志集合
*
* @param operLog 操作日志对象
* @return 操作日志集合
*/
public
List
<
SysOperLog
>
selectOperLogList
(
SysOperLog
operLog
);
/**
* 批量删除系统操作日志
*
* @param ids 需要删除的数据
* @return 结果
*/
public
int
deleteOperLogByIds
(
String
ids
);
/**
* 查询操作日志详细
*
* @param operId 操作ID
* @return 操作日志对象
*/
public
SysOperLog
selectOperLogById
(
Long
operId
);
/**
* 清空操作日志
*/
public
void
cleanOperLog
();
}
ruoyi/src/main/java/com/ruoyi/project/monitor/service/impl/SysLogininforServiceImpl.java
0 → 100644
View file @
46444bd0
package
com.ruoyi.project.monitor.service.impl
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.ruoyi.common.core.text.Convert
;
import
com.ruoyi.project.monitor.domain.SysLogininfor
;
import
com.ruoyi.project.monitor.mapper.SysLogininforMapper
;
import
com.ruoyi.project.monitor.service.ISysLogininforService
;
/**
* 系统访问日志情况信息 服务层处理
*
* @author ruoyi
*/
@Service
public
class
SysLogininforServiceImpl
implements
ISysLogininforService
{
@Autowired
private
SysLogininforMapper
logininforMapper
;
/**
* 新增系统登录日志
*
* @param logininfor 访问日志对象
*/
@Override
public
void
insertLogininfor
(
SysLogininfor
logininfor
)
{
logininforMapper
.
insertLogininfor
(
logininfor
);
}
/**
* 查询系统登录日志集合
*
* @param logininfor 访问日志对象
* @return 登录记录集合
*/
@Override
public
List
<
SysLogininfor
>
selectLogininforList
(
SysLogininfor
logininfor
)
{
return
logininforMapper
.
selectLogininforList
(
logininfor
);
}
/**
* 批量删除系统登录日志
*
* @param ids 需要删除的数据
* @return
*/
@Override
public
int
deleteLogininforByIds
(
String
ids
)
{
return
logininforMapper
.
deleteLogininforByIds
(
Convert
.
toStrArray
(
ids
));
}
/**
* 清空系统登录日志
*/
@Override
public
void
cleanLogininfor
()
{
logininforMapper
.
cleanLogininfor
();
}
}
Prev
1
…
12
13
14
15
16
17
18
19
20
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment