selectLogininforList(Logininfor logininfor);
27 |
28 | /**
29 | * 批量删除系统登录日志
30 | *
31 | * @param ids 需要删除的数据
32 | * @return
33 | */
34 | public int deleteLogininforByIds(String[] ids);
35 | }
36 |
--------------------------------------------------------------------------------
/src/test/java/com/jetfire/common/utils/AddressUtilsTest.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.common.utils;
2 |
3 | import org.junit.After;
4 | import org.junit.Before;
5 | import org.junit.Test;
6 |
7 | /**
8 | * AddressUtils Tester.
9 | *
10 | * @author Leonhardt
11 | * @version 1.0
12 | * @since 07/22/2018
13 | */
14 |
15 | public class AddressUtilsTest
16 | {
17 |
18 | @Before
19 | public void before() throws Exception
20 | {
21 | }
22 |
23 | @After
24 | public void after() throws Exception
25 | {
26 | }
27 |
28 | /**
29 | * Method: getRealAddressByIP(String ip)
30 | *
31 | */
32 | @Test
33 | public void testGetRealAddressByIP() throws Exception
34 | {
35 | // TODO: Test goes here...
36 | String ipAddress = AddressUtils.getRealAddressByIP("121.8.250.1");
37 | System.out.println(ipAddress);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/monitor/logininfor/service/ILogininforService.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.monitor.logininfor.service;
2 |
3 | import java.util.List;
4 | import com.jetfire.project.monitor.logininfor.domain.Logininfor;
5 |
6 | /**
7 | * 系统访问日志情况信息 服务层
8 | *
9 | * @author jetfire
10 | */
11 | public interface ILogininforService
12 | {
13 |
14 | /**
15 | * 新增系统登录日志
16 | *
17 | * @param logininfor 访问日志对象
18 | */
19 | public void insertLogininfor(Logininfor logininfor);
20 |
21 | /**
22 | * 查询系统登录日志集合
23 | *
24 | * @param logininfor 访问日志对象
25 | * @return 登录记录集合
26 | */
27 | public List selectLogininforList(Logininfor logininfor);
28 |
29 | /**
30 | * 批量删除系统登录日志
31 | *
32 | * @param ids 需要删除的数据
33 | * @return
34 | */
35 | public int deleteLogininforByIds(String ids);
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/framework/aspectj/lang/annotation/Excel.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.framework.aspectj.lang.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * 自定义注解
10 | *
11 | * @author jetfire
12 | */
13 | @Retention(RetentionPolicy.RUNTIME)
14 | @Target(ElementType.FIELD)
15 | public @interface Excel
16 | {
17 | /**
18 | * 导出到Excel中的名字.
19 | */
20 | public abstract String name();
21 |
22 | /**
23 | * 提示信息
24 | */
25 | public abstract String prompt() default "";
26 |
27 | /**
28 | * 设置只能选择不能输入的列内容.
29 | */
30 | public abstract String[] combo() default {};
31 |
32 | /**
33 | * 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
34 | */
35 | public abstract boolean isExport() default true;
36 | }
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/framework/aspectj/lang/annotation/Log.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.framework.aspectj.lang.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import com.jetfire.framework.aspectj.lang.constant.OperatorType;
9 |
10 | /**
11 | * 自定义操作日志记录注解
12 | *
13 | * @author jetfire
14 | *
15 | */
16 | @Target({ ElementType.PARAMETER, ElementType.METHOD })
17 | @Retention(RetentionPolicy.RUNTIME)
18 | @Documented
19 | public @interface Log
20 | {
21 | /** 模块 */
22 | String title() default "";
23 |
24 | /** 功能 */
25 | String action() default "";
26 |
27 | /** 渠道 */
28 | String channel() default OperatorType.MANAGE;
29 |
30 | /** 是否保存请求的参数 */
31 | boolean isSaveRequestData() default true;
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/tool/gen/mapper/GenMapper.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.tool.gen.mapper;
2 |
3 | import java.util.List;
4 | import com.jetfire.project.tool.gen.domain.ColumnInfo;
5 | import com.jetfire.project.tool.gen.domain.TableInfo;
6 |
7 | /**
8 | * 代码生成 数据层
9 | *
10 | * @author jetfire
11 | */
12 | public interface GenMapper
13 | {
14 | /**
15 | * 查询ry数据库表信息
16 | *
17 | * @param tableInfo 表信息
18 | * @return 数据库表列表
19 | */
20 | public List selectTableList(TableInfo tableInfo);
21 |
22 | /**
23 | * 根据表名称查询信息
24 | *
25 | * @param tableName 表名称
26 | * @return 表信息
27 | */
28 | public TableInfo selectTableByName(String tableName);
29 |
30 | /**
31 | * 根据表名称查询列信息
32 | *
33 | * @param tableName 表名称
34 | * @return 列信息
35 | */
36 | public List selectTableColumnsByName(String tableName);
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/resources/templates/error/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Jetfire - 500
7 |
8 |
9 |
10 |
11 |
12 |
13 |
500
14 |
内部服务器错误!
15 |
16 |
17 | 服务器遇到意外事件,不允许完成请求。我们抱歉。您可以返回主页面。
18 |
主页
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/framework/web/page/TableSupport.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.framework.web.page;
2 |
3 | import com.jetfire.common.utils.ServletUtils;
4 | import com.jetfire.common.constant.Constants;
5 |
6 | /**
7 | * 表格数据处理
8 | *
9 | * @author jetfire
10 | */
11 | public class TableSupport
12 | {
13 | /**
14 | * 封装分页对象
15 | */
16 | public static PageDomain getPageDomain()
17 | {
18 | PageDomain pageDomain = new PageDomain();
19 | pageDomain.setPageNum(ServletUtils.getParameterToInt(Constants.PAGENUM));
20 | pageDomain.setPageSize(ServletUtils.getParameterToInt(Constants.PAGESIZE));
21 | pageDomain.setOrderByColumn(ServletUtils.getParameter(Constants.ORDERBYCOLUMN));
22 | pageDomain.setIsAsc(ServletUtils.getParameter(Constants.ISASC));
23 | return pageDomain;
24 | }
25 |
26 | public static PageDomain buildPageRequest()
27 | {
28 | return getPageDomain();
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/resources/templates/error/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Jetfire - 404
7 |
8 |
9 |
10 |
11 |
12 |
13 |
404
14 |
找不到网页!
15 |
16 | 对不起,您正在寻找的页面已经找到。尝试检查URL的错误,然后按浏览器上的刷新按钮或尝试在我们的应用程序中找到其他内容。
17 |
主页
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/main/resources/templates/error/unauth.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Jetfire - 403
7 |
8 |
9 |
10 |
11 |
12 |
13 |
403
14 |
您没有访问权限!
15 |
16 |
17 | 对不起,您正在寻找的页面已经找到。尝试检查URL的错误,然后按浏览器上的刷新按钮或尝试在我们的应用程序中找到其他内容。
18 |
主页
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/monitor/operlog/service/IOperLogService.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.monitor.operlog.service;
2 |
3 | import java.util.List;
4 | import com.jetfire.project.monitor.operlog.domain.OperLog;
5 |
6 | /**
7 | * 操作日志 服务层
8 | *
9 | * @author jetfire
10 | */
11 | public interface IOperLogService
12 | {
13 | /**
14 | * 新增操作日志
15 | *
16 | * @param operLog 操作日志对象
17 | */
18 | public void insertOperlog(OperLog operLog);
19 |
20 | /**
21 | * 查询系统操作日志集合
22 | *
23 | * @param operLog 操作日志对象
24 | * @return 操作日志集合
25 | */
26 | public List selectOperLogList(OperLog operLog);
27 |
28 | /**
29 | * 批量删除系统操作日志
30 | *
31 | * @param ids 需要删除的数据
32 | * @return 结果
33 | */
34 | public int deleteOperLogByIds(String ids);
35 |
36 | /**
37 | * 查询操作日志详细
38 | *
39 | * @param operId 操作ID
40 | * @return 操作日志对象
41 | */
42 | public OperLog selectOperLogById(Long operId);
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/monitor/operlog/mapper/OperLogMapper.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.monitor.operlog.mapper;
2 |
3 | import java.util.List;
4 | import com.jetfire.project.monitor.operlog.domain.OperLog;
5 |
6 | /**
7 | * 操作日志 数据层
8 | *
9 | * @author jetfire
10 | */
11 | public interface OperLogMapper
12 | {
13 | /**
14 | * 新增操作日志
15 | *
16 | * @param operLog 操作日志对象
17 | */
18 | public void insertOperlog(OperLog operLog);
19 |
20 | /**
21 | * 查询系统操作日志集合
22 | *
23 | * @param operLog 操作日志对象
24 | * @return 操作日志集合
25 | */
26 | public List selectOperLogList(OperLog operLog);
27 |
28 | /**
29 | * 批量删除系统操作日志
30 | *
31 | * @param ids 需要删除的数据
32 | * @return 结果
33 | */
34 | public int deleteOperLogByIds(String[] ids);
35 |
36 | /**
37 | * 查询操作日志详细
38 | *
39 | * @param operId 操作ID
40 | * @return 操作日志对象
41 | */
42 | public OperLog selectOperLogById(Long operId);
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/resources/templates/vm/java/domain.java.vm:
--------------------------------------------------------------------------------
1 | package ${package}.domain;
2 |
3 | import com.jetfire.framework.web.domain.BaseEntity;
4 | #foreach ($column in $columns)
5 | #if($column.attrType == 'Date')
6 | import java.util.Date;
7 | #break
8 | #end
9 | #end
10 |
11 | /**
12 | * ${tableComment}表 ${tableName}
13 | *
14 | * @author ${author}
15 | * @date ${datetime}
16 | */
17 | public class ${className} extends BaseEntity
18 | {
19 | private static final long serialVersionUID = 1L;
20 |
21 | #foreach ($column in $columns)
22 | /** $column.columnComment */
23 | private $column.attrType $column.attrname;
24 | #end
25 |
26 | #foreach ($column in $columns)
27 | /**
28 | * 设置:${column.columnComment}
29 | */
30 | public void set${column.attrName}($column.attrType $column.attrname)
31 | {
32 | this.$column.attrname = $column.attrname;
33 | }
34 |
35 | /**
36 | * 获取:${column.columnComment}
37 | */
38 | public $column.attrType get${column.attrName}()
39 | {
40 | return $column.attrname;
41 | }
42 |
43 | #end
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/system/user/mapper/UserRoleMapper.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.system.user.mapper;
2 |
3 | import java.util.List;
4 | import com.jetfire.project.system.user.domain.UserRole;
5 |
6 | /**
7 | * 用户表 数据层
8 | *
9 | * @author jetfire
10 | */
11 | public interface UserRoleMapper
12 | {
13 |
14 | /**
15 | * 通过用户ID删除用户和角色关联
16 | *
17 | * @param userId 用户ID
18 | * @return 结果
19 | */
20 | public int deleteUserRoleByUserId(Long userId);
21 |
22 | /**
23 | * 批量删除用户和角色关联
24 | *
25 | * @param ids 需要删除的数据ID
26 | * @return 结果
27 | */
28 | public int deleteUserRole(Long[] ids);
29 |
30 | /**
31 | * 通过角色ID查询角色使用数量
32 | *
33 | * @param roleId 角色ID
34 | * @return 结果
35 | */
36 | public int countUserRoleByRoleId(Long roleId);
37 |
38 | /**
39 | * 批量新增用户角色信息
40 | *
41 | * @param userRoleList 用户角色列表
42 | * @return 结果
43 | */
44 | public int batchUserRole(List userRoleList);
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/system/user/mapper/UserPostMapper.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.system.user.mapper;
2 |
3 | import java.util.List;
4 | import com.jetfire.project.system.user.domain.UserPost;
5 |
6 | /**
7 | * 用户与岗位 表 数据层
8 | *
9 | * @author jetfire
10 | */
11 | public interface UserPostMapper
12 | {
13 |
14 | /**
15 | * 通过用户ID删除用户和岗位关联
16 | *
17 | * @param userId 用户ID
18 | * @return 结果
19 | */
20 | public int deleteUserPostByUserId(Long userId);
21 |
22 | /**
23 | * 通过岗位ID查询岗位使用数量
24 | *
25 | * @param postId 岗位ID
26 | * @return 结果
27 | */
28 | public int countUserPostById(Long postId);
29 |
30 | /**
31 | * 批量删除用户和岗位关联
32 | *
33 | * @param ids 需要删除的数据ID
34 | * @return 结果
35 | */
36 | public int deleteUserPost(Long[] ids);
37 |
38 | /**
39 | * 批量新增用户岗位信息
40 | *
41 | * @param userPostList 用户角色列表
42 | * @return 结果
43 | */
44 | public int batchUserPost(List userPostList);
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/system/role/mapper/RoleMenuMapper.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.system.role.mapper;
2 |
3 | import java.util.List;
4 | import com.jetfire.project.system.role.domain.RoleMenu;
5 |
6 | /**
7 | * 角色与菜单关联表 数据层
8 | *
9 | * @author jetfire
10 | */
11 | public interface RoleMenuMapper
12 | {
13 |
14 | /**
15 | * 通过角色ID删除角色和菜单关联
16 | *
17 | * @param roleId 角色ID
18 | * @return 结果
19 | */
20 | public int deleteRoleMenuByRoleId(Long roleId);
21 |
22 | /**
23 | * 批量删除角色菜单关联信息
24 | *
25 | * @param ids 需要删除的数据ID
26 | * @return 结果
27 | */
28 | public int deleteRoleMenu(Long[] ids);
29 |
30 | /**
31 | * 查询菜单使用数量
32 | *
33 | * @param menuId 菜单ID
34 | * @return 结果
35 | */
36 | public int selectCountRoleMenuByMenuId(Long menuId);
37 |
38 | /**
39 | * 批量新增角色菜单信息
40 | *
41 | * @param roleMenuList 角色菜单列表
42 | * @return 结果
43 | */
44 | public int batchRoleMenu(List roleMenuList);
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/tool/gen/util/VelocityInitializer.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.tool.gen.util;
2 |
3 | import java.util.Properties;
4 | import org.apache.velocity.app.Velocity;
5 |
6 | import com.jetfire.common.constant.Constants;
7 |
8 | /**
9 | * VelocityEngine工厂
10 | *
11 | * @author jetfire
12 | */
13 | public class VelocityInitializer
14 | {
15 | /**
16 | * 初始化vm方法
17 | */
18 | public static void initVelocity()
19 | {
20 | Properties p = new Properties();
21 | try
22 | {
23 | // 加载classpath目录下的vm文件
24 | p.setProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
25 | // 定义字符集
26 | p.setProperty(Velocity.ENCODING_DEFAULT, Constants.UTF8);
27 | p.setProperty(Velocity.OUTPUT_ENCODING, Constants.UTF8);
28 | // 初始化Velocity引擎,指定配置Properties
29 | Velocity.init(p);
30 | }
31 | catch (Exception e)
32 | {
33 | throw new RuntimeException(e);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 Jetfire
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/common/exception/file/FileNameLengthLimitExceededException.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.common.exception.file;
2 |
3 | import org.apache.commons.fileupload.FileUploadException;
4 |
5 | /**
6 | * 文件名超长 误异常类
7 | *
8 | * @author jetfire
9 | */
10 | public class FileNameLengthLimitExceededException extends FileUploadException
11 | {
12 |
13 | private static final long serialVersionUID = 1L;
14 | private int length;
15 | private int maxLength;
16 | private String filename;
17 |
18 | public FileNameLengthLimitExceededException(String filename, int length, int maxLength)
19 | {
20 | super("file name : [" + filename + "], length : [" + length + "], max length : [" + maxLength + "]");
21 | this.length = length;
22 | this.maxLength = maxLength;
23 | this.filename = filename;
24 | }
25 |
26 | public String getFilename()
27 | {
28 | return filename;
29 | }
30 |
31 | public int getLength()
32 | {
33 | return length;
34 | }
35 |
36 | public int getMaxLength()
37 | {
38 | return maxLength;
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/system/notice/mapper/NoticeMapper.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.system.notice.mapper;
2 |
3 | import com.jetfire.project.system.notice.domain.Notice;
4 | import java.util.List;
5 |
6 | /**
7 | * 公告 数据层
8 | *
9 | * @author jetfire
10 | */
11 | public interface NoticeMapper
12 | {
13 | /**
14 | * 查询公告信息
15 | *
16 | * @param noticeId 公告ID
17 | * @return 公告信息
18 | */
19 | public Notice selectNoticeById(Long noticeId);
20 |
21 | /**
22 | * 查询公告列表
23 | *
24 | * @param notice 公告信息
25 | * @return 公告集合
26 | */
27 | public List selectNoticeList(Notice notice);
28 |
29 | /**
30 | * 新增公告
31 | *
32 | * @param notice 公告信息
33 | * @return 结果
34 | */
35 | public int insertNotice(Notice notice);
36 |
37 | /**
38 | * 修改公告
39 | *
40 | * @param notice 公告信息
41 | * @return 结果
42 | */
43 | public int updateNotice(Notice notice);
44 |
45 | /**
46 | * 批量删除公告
47 | *
48 | * @param noticeIds 需要删除的数据ID
49 | * @return 结果
50 | */
51 | public int deleteNoticeByIds(String[] noticeIds);
52 |
53 | }
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/system/notice/service/INoticeService.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.system.notice.service;
2 |
3 | import com.jetfire.project.system.notice.domain.Notice;
4 | import java.util.List;
5 |
6 | /**
7 | * 公告 服务层
8 | *
9 | * @author jetfire
10 | */
11 | public interface INoticeService
12 | {
13 | /**
14 | * 查询公告信息
15 | *
16 | * @param noticeId 公告ID
17 | * @return 公告信息
18 | */
19 | public Notice selectNoticeById(Long noticeId);
20 |
21 | /**
22 | * 查询公告列表
23 | *
24 | * @param notice 公告信息
25 | * @return 公告集合
26 | */
27 | public List selectNoticeList(Notice notice);
28 |
29 | /**
30 | * 新增公告
31 | *
32 | * @param notice 公告信息
33 | * @return 结果
34 | */
35 | public int insertNotice(Notice notice);
36 |
37 | /**
38 | * 修改公告
39 | *
40 | * @param notice 公告信息
41 | * @return 结果
42 | */
43 | public int updateNotice(Notice notice);
44 |
45 | /**
46 | * 删除公告信息
47 | *
48 | * @param ids 需要删除的数据ID
49 | * @return 结果
50 | */
51 | public int deleteNoticeByIds(String ids);
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/framework/web/page/TableDataInfo.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.framework.web.page;
2 |
3 | import java.io.Serializable;
4 | import java.util.List;
5 |
6 | /**
7 | * 表格分页数据对象
8 | *
9 | * @author jetfire
10 | */
11 | public class TableDataInfo implements Serializable
12 | {
13 | private static final long serialVersionUID = 1L;
14 | /** 总记录数 */
15 | private long total;
16 | /** 列表数据 */
17 | private List> rows;
18 |
19 | /**
20 | * 表格数据对象
21 | */
22 | public TableDataInfo()
23 | {
24 | }
25 |
26 | /**
27 | * 分页
28 | *
29 | * @param list 列表数据
30 | * @param total 总记录数
31 | */
32 | public TableDataInfo(List> list, int total)
33 | {
34 | this.rows = list;
35 | this.total = total;
36 | }
37 |
38 | public long getTotal()
39 | {
40 | return total;
41 | }
42 |
43 | public void setTotal(long total)
44 | {
45 | this.total = total;
46 | }
47 |
48 | public List> getRows()
49 | {
50 | return rows;
51 | }
52 |
53 | public void setRows(List> rows)
54 | {
55 | this.rows = rows;
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/resources/application-druid.yml:
--------------------------------------------------------------------------------
1 | #dubbo配置
2 | spring:
3 | datasource:
4 | type: com.alibaba.druid.pool.DruidDataSource
5 | driverClassName: com.mysql.jdbc.Driver
6 | url: jdbc:mysql://127.0.0.1:3306/jetfire?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
7 | username: root
8 | password: 123456
9 | # 初始化大小,最小,最大
10 | initialSize: 1
11 | minIdle: 3
12 | maxActive: 20
13 | # 配置获取连接等待超时的时间
14 | maxWait: 60000
15 | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
16 | timeBetweenEvictionRunsMillis: 60000
17 | # 配置一个连接在池中最小生存的时间,单位是毫秒
18 | minEvictableIdleTimeMillis: 30000
19 | validationQuery: select 'x'
20 | testWhileIdle: true
21 | testOnBorrow: false
22 | testOnReturn: false
23 | # 打开PSCache,并且指定每个连接上PSCache的大小
24 | poolPreparedStatements: true
25 | maxPoolPreparedStatementPerConnectionSize: 20
26 | # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
27 | filters: stat,wall,slf4j
28 | # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
29 | connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
30 | # 合并多个DruidDataSource的监控数据
31 | #useGlobalDataSourceStat: true
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/framework/web/service/DictService.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.framework.web.service;
2 |
3 | import java.util.List;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.stereotype.Service;
6 | import com.jetfire.project.system.dict.domain.DictData;
7 | import com.jetfire.project.system.dict.service.IDictDataService;
8 |
9 | /**
10 | * RuoYi首创 html调用 thymeleaf 实现字典读取
11 | *
12 | * @author jetfire
13 | */
14 | @Service("dict")
15 | public class DictService
16 | {
17 | @Autowired
18 | private IDictDataService dictDataService;
19 |
20 | /**
21 | * 根据字典类型查询字典数据信息
22 | *
23 | * @param dictType 字典类型
24 | * @return 参数键值
25 | */
26 | public List getType(String dictType)
27 | {
28 | return dictDataService.selectDictDataByType(dictType);
29 | }
30 |
31 | /**
32 | * 根据字典类型和字典键值查询字典数据信息
33 | *
34 | * @param dictType 字典类型
35 | * @param dictValue 字典键值
36 | * @return 字典标签
37 | */
38 | public String getLabel(String dictType, String dictValue)
39 | {
40 | return dictDataService.selectDictLabel(dictType, dictValue);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/monitor/job/service/IJobLogService.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.monitor.job.service;
2 |
3 | import java.util.List;
4 | import com.jetfire.project.monitor.job.domain.JobLog;
5 |
6 | /**
7 | * 定时任务调度日志信息信息 服务层
8 | *
9 | * @author jetfire
10 | */
11 | public interface IJobLogService
12 | {
13 |
14 | /**
15 | * 获取quartz调度器日志的计划任务
16 | *
17 | * @param jobLog 调度日志信息
18 | * @return 调度任务日志集合
19 | */
20 | public List selectJobLogList(JobLog jobLog);
21 |
22 | /**
23 | * 通过调度任务日志ID查询调度信息
24 | *
25 | * @param jobLogId 调度任务日志ID
26 | * @return 调度任务日志对象信息
27 | */
28 | public JobLog selectJobLogById(Long jobLogId);
29 |
30 | /**
31 | * 新增任务日志
32 | *
33 | * @param jobLog 调度日志信息
34 | */
35 | public void addJobLog(JobLog jobLog);
36 |
37 | /**
38 | * 批量删除调度日志信息
39 | *
40 | * @param ids 需要删除的数据ID
41 | * @return 结果
42 | */
43 | public int deleteJobLogByIds(String ids);
44 |
45 | /**
46 | * 删除任务日志
47 | *
48 | * @param jobId 调度日志ID
49 | * @return 结果
50 | */
51 | public int deleteJobLogById(Long jobId);
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/common/constant/ScheduleConstants.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.common.constant;
2 |
3 | /**
4 | * 任务调度通用常量
5 | *
6 | * @author jetfire
7 | */
8 | public interface ScheduleConstants
9 | {
10 |
11 | public static final String TASK_CLASS_NAME = "__TASK_CLASS_NAME__";
12 |
13 | public static final String TASK_PROPERTIES = "__TASK_PROPERTIES__";
14 |
15 | /** 默认 */
16 | public static final String MISFIRE_DEFAULT = "0";
17 |
18 | /** 立即触发执行 */
19 | public static final String MISFIRE_IGNORE_MISFIRES = "1";
20 |
21 | /** 触发一次执行 */
22 | public static final String MISFIRE_FIRE_AND_PROCEED = "2";
23 |
24 | /** 不触发立即执行 */
25 | public static final String MISFIRE_DO_NOTHING = "3";
26 |
27 | public enum Status
28 | {
29 | /**
30 | * 正常
31 | */
32 | NORMAL("0"),
33 | /**
34 | * 暂停
35 | */
36 | PAUSE("1");
37 |
38 | private String value;
39 |
40 | private Status(String value)
41 | {
42 | this.value = value;
43 | }
44 |
45 | public String getValue()
46 | {
47 | return value;
48 | }
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/monitor/job/mapper/JobLogMapper.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.monitor.job.mapper;
2 |
3 | import java.util.List;
4 | import com.jetfire.project.monitor.job.domain.JobLog;
5 |
6 | /**
7 | * 调度任务日志信息 数据层
8 | *
9 | * @author jetfire
10 | */
11 | public interface JobLogMapper
12 | {
13 |
14 | /**
15 | * 获取quartz调度器日志的计划任务
16 | *
17 | * @param jobLog 调度日志信息
18 | * @return 调度任务日志集合
19 | */
20 | public List selectJobLogList(JobLog jobLog);
21 |
22 | /**
23 | * 通过调度任务日志ID查询调度信息
24 | *
25 | * @param jobLogId 调度任务日志ID
26 | * @return 调度任务日志对象信息
27 | */
28 | public JobLog selectJobLogById(Long jobLogId);
29 |
30 | /**
31 | * 新增任务日志
32 | *
33 | * @param jobLog 调度日志信息
34 | * @return 结果
35 | */
36 | public int insertJobLog(JobLog jobLog);
37 |
38 | /**
39 | * 批量删除调度日志信息
40 | *
41 | * @param ids 需要删除的数据ID
42 | * @return 结果
43 | */
44 | public int deleteJobLogByIds(String[] ids);
45 |
46 | /**
47 | * 删除任务日志
48 | *
49 | * @param jobId 调度日志ID
50 | * @return 结果
51 | */
52 | public int deleteJobLogById(Long jobId);
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/src/main/resources/static/ajax/libs/jqTreeGrid/jquery.treegrid.css:
--------------------------------------------------------------------------------
1 | .treegrid-indent {width:16px; height: 16px; display: inline-block; position: relative;}
2 |
3 | .treegrid-expander {width:16px; height: 16px; display: inline-block; position: relative; cursor: pointer;}
4 |
5 | .treegrid-expander-expanded{background-image: url(img/collapse.png); }
6 | .treegrid-expander-collapsed{background-image: url(img/expand.png);}
7 | .treegrid-selected{background: #f5f5f5 !important;}
8 | .treegrid-table{border:0 !important;margin-bottom:0}
9 | .treegrid-table tbody {display:block;height:auto;overflow-y:auto;}
10 | .treegrid-table thead, .treegrid-table tbody tr {display:table;width:100%;table-layout:fixed;}
11 | .treegrid-thead th{line-height:40px;border: 0 !important;background:#f3f3f4 !important;border-radius: 4px;border-left:0px solid #e7eaec !important;border-bottom:2px solid #e7eaec !important;text-align: center;}
12 | .treegrid-thead tr :first-child{border-left:0 !important}
13 | .treegrid-tbody td{border: 0 !important;border-left:0px solid #e7eaec !important;border-bottom:1px solid #e7eaec !important;overflow: hidden;
14 | white-space: nowrap;
15 | text-overflow: ellipsis;}
16 | .treegrid-tbody tr :first-child{border-left:0 !important}
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/common/utils/AddressUtils.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.common.utils;
2 |
3 | import com.alibaba.fastjson.JSONObject;
4 | import com.jetfire.common.utils.http.HttpUtils;
5 | import org.slf4j.Logger;
6 | import org.slf4j.LoggerFactory;
7 |
8 | /**
9 | * 获取地址类
10 | *
11 | * @author jetfire
12 | */
13 | public class AddressUtils
14 | {
15 | private static final Logger log = LoggerFactory.getLogger(AddressUtils.class);
16 |
17 | public static final String IP_URL = "http://ip.taobao.com/service/getIpInfo.php";
18 |
19 | public static String getRealAddressByIP(String ip)
20 | {
21 | String address = "";
22 | try
23 | {
24 | address = HttpUtils.sendPost(IP_URL, "ip=" + ip);
25 | JSONObject json = JSONObject.parseObject(address);
26 | JSONObject object = json.getObject("data", JSONObject.class);
27 | String region = object.getString("region");
28 | String city = object.getString("city");
29 | address = region + " " + city;
30 | }
31 | catch (Exception e)
32 | {
33 | log.error("根据IP获取所在位置----------错误消息:" + e.getMessage());
34 | }
35 | return address;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/common/xss/XssHttpServletRequestWrapper.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.common.xss;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletRequestWrapper;
5 | import org.jsoup.Jsoup;
6 | import org.jsoup.safety.Whitelist;
7 |
8 | /**
9 | * XSS过滤处理
10 | *
11 | * @author jetfire
12 | */
13 | public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
14 | {
15 |
16 | /**
17 | * @param request
18 | */
19 | public XssHttpServletRequestWrapper(HttpServletRequest request)
20 | {
21 | super(request);
22 | }
23 |
24 | @Override
25 | public String[] getParameterValues(String name)
26 | {
27 | String[] values = super.getParameterValues(name);
28 | if (values != null)
29 | {
30 | int length = values.length;
31 | String[] escapseValues = new String[length];
32 | for (int i = 0; i < length; i++)
33 | {
34 | // 防xss攻击和过滤前后空格
35 | escapseValues[i] = Jsoup.clean(values[i], Whitelist.relaxed()).trim();
36 | }
37 | return escapseValues;
38 | }
39 | return super.getParameterValues(name);
40 | }
41 | }
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/monitor/online/mapper/UserOnlineMapper.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.monitor.online.mapper;
2 |
3 | import java.util.List;
4 | import com.jetfire.project.monitor.online.domain.UserOnline;
5 |
6 | /**
7 | * 在线用户 数据层
8 | *
9 | * @author jetfire
10 | */
11 | public interface UserOnlineMapper
12 | {
13 | /**
14 | * 通过会话序号查询信息
15 | *
16 | * @param sessionId 会话ID
17 | * @return 在线用户信息
18 | */
19 | public UserOnline selectOnlineById(String sessionId);
20 |
21 | /**
22 | * 通过会话序号删除信息
23 | *
24 | * @param sessionId 会话ID
25 | * @return 在线用户信息
26 | */
27 | public int deleteOnlineById(String sessionId);
28 |
29 | /**
30 | * 保存会话信息
31 | *
32 | * @param online 会话信息
33 | * @return 结果
34 | */
35 | public int saveOnline(UserOnline online);
36 |
37 | /**
38 | * 查询会话集合
39 | *
40 | * @param userOnline 会话参数
41 | * @return 会话集合
42 | */
43 | public List selectUserOnlineList(UserOnline userOnline);
44 |
45 | /**
46 | * 查询过期会话集合
47 | *
48 | * @param lastAccessTime 过期时间
49 | * @return 会话集合
50 | */
51 | public List selectOnlineByExpired(String lastAccessTime);
52 | }
53 |
--------------------------------------------------------------------------------
/src/main/resources/mybatis/system/UserPostMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | delete from sys_user_post where user_id=#{userId}
14 |
15 |
16 |
19 |
20 |
21 | delete from sys_user_post where user_id in
22 |
23 | #{userId}
24 |
25 |
26 |
27 |
28 | insert into sys_user_post(user_id, post_id) values
29 |
30 | (#{item.userId},#{item.postId})
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/main/resources/mybatis/system/UserRoleMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | delete from sys_user_role where user_id=#{userId}
14 |
15 |
16 |
19 |
20 |
21 | delete from sys_user_role where user_id in
22 |
23 | #{userId}
24 |
25 |
26 |
27 |
28 | insert into sys_user_role(user_id, role_id) values
29 |
30 | (#{item.userId},#{item.roleId})
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/main/resources/mybatis/system/RoleMenuMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
11 |
12 |
15 |
16 |
19 |
20 |
26 |
27 |
33 |
34 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/framework/config/FilterConfig.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.framework.config;
2 |
3 | import java.util.Map;
4 | import javax.servlet.DispatcherType;
5 | import org.springframework.boot.web.servlet.FilterRegistrationBean;
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.context.annotation.Configuration;
8 | import com.google.common.collect.Maps;
9 | import com.jetfire.common.xss.XssFilter;
10 |
11 | /**
12 | * Filter配置
13 | *
14 | * @author jetfire
15 | */
16 | @Configuration
17 | public class FilterConfig
18 | {
19 | @SuppressWarnings({ "rawtypes", "unchecked" })
20 | @Bean
21 | public FilterRegistrationBean xssFilterRegistration()
22 | {
23 | FilterRegistrationBean registration = new FilterRegistrationBean();
24 | registration.setDispatcherTypes(DispatcherType.REQUEST);
25 | registration.setFilter(new XssFilter());
26 | registration.addUrlPatterns("/*");
27 | registration.setName("xssFilter");
28 | registration.setOrder(Integer.MAX_VALUE);
29 | Map initParameters = Maps.newHashMap();
30 | initParameters.put("excludes", "/system/notice/*");
31 | registration.setInitParameters(initParameters);
32 | return registration;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/resources/static/ajax/libs/validate/messages_zh.min.js:
--------------------------------------------------------------------------------
1 | /*! jQuery Validation Plugin - v1.13.1 - 10/14/2014
2 | * http://jqueryvalidation.org/
3 | * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */
4 | ! function (a) {
5 | "function" == typeof define && define.amd ? define(["jquery", "jquery.validate.min"], a) : a(jQuery)
6 | }(function (a) {
7 | var icon = " ";
8 | a.extend(a.validator.messages, {
9 | required: icon + "必填",
10 | remote: icon + "请修正此栏位",
11 | email: icon + "请输入有效的电子邮件",
12 | url: icon + "请输入有效的网址",
13 | date: icon + "请输入有效的日期",
14 | dateISO: icon + "请输入有效的日期 (YYYY-MM-DD)",
15 | number: icon + "请输入正确的数字",
16 | digits: icon + "只能输入数字",
17 | creditcard: icon + "请输入有效的信用卡号码",
18 | equalTo: icon + "你的输入不相同",
19 | extension: icon + "请输入有效的后缀",
20 | maxlength: a.validator.format(icon + "最多 {0} 个字"),
21 | minlength: a.validator.format(icon + "最少 {0} 个字"),
22 | rangelength: a.validator.format(icon + "请输入长度为 {0} 至 {1} 之间的字串"),
23 | range: a.validator.format(icon + "请输入 {0} 至 {1} 之间的数值"),
24 | max: a.validator.format(icon + "请输入不大于 {0} 的数值"),
25 | min: a.validator.format(icon + "请输入不小于 {0} 的数值")
26 | })
27 | });
28 |
--------------------------------------------------------------------------------
/src/main/resources/i18n/messages.properties:
--------------------------------------------------------------------------------
1 | #错误消息
2 | not.null=* 必须填写
3 | user.jcaptcha.error=验证码错误
4 | user.not.exists=用户不存在/密码错误
5 | user.password.not.match=用户不存在/密码错误
6 | user.password.retry.limit.count=密码输入错误{0}次,{1}
7 | user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟
8 | user.blocked=用户已封禁,原因:{0}
9 | role.blocked=角色已封禁,原因:{0}
10 | user.logout.success=退出成功
11 |
12 | length.not.valid=长度必须在{min}到{max}个字符之间
13 |
14 | user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
15 | user.password.not.valid=* 5-50个字符
16 |
17 | user.email.not.valid=邮箱格式错误
18 | user.mobile.phone.number.not.valid=手机号格式错误
19 | user.login.success=登录成功
20 | user.notfound=请重新登录
21 | user.forcelogout=管理员强制退出,请重新登录
22 | user.unknown.error=未知错误,请重新登录
23 |
24 | #批量插入用户错误信息
25 | user.import.excel.null=Excel数据为空,请按照导入模板填写数据
26 | user.import.excel.data.null=Excel数据为空,只有标题行,请按照导入模板填写数据
27 | user.import.excel.filetype.error=文件不是Excel文件
28 | user.import.excel.file.error=文件名为空,文件为空
29 | user.import.excel.fileinput.error=获取Excel2003流错误
30 | user.import.excel.fileinputx.error=获取Excel2007流错误
31 | ##权限
32 | no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
33 | no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
34 | no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
35 | no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
36 | no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
37 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/common/constant/Constants.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.common.constant;
2 |
3 | /**
4 | * 通用常量信息
5 | *
6 | * @author jetfire
7 | */
8 | public class Constants
9 | {
10 | /**
11 | * UTF-8 字符集
12 | */
13 | public static final String UTF8 = "UTF-8";
14 |
15 | /**
16 | * 通用成功标识
17 | */
18 | public static final String SUCCESS = "0";
19 |
20 | /**
21 | * 通用失败标识
22 | */
23 | public static final String FAIL = "1";
24 |
25 | /**
26 | * 登录成功
27 | */
28 | public static final String LOGIN_SUCCESS = "Success";
29 |
30 | /**
31 | * 注销
32 | */
33 | public static final String LOGOUT = "Logout";
34 |
35 | /**
36 | * 登录失败
37 | */
38 | public static final String LOGIN_FAIL = "Error";
39 |
40 | /**
41 | * 自动去除表前缀
42 | */
43 | public static String AUTO_REOMVE_PRE = "true";
44 |
45 | /**
46 | * 当前记录起始索引
47 | */
48 | public static String PAGENUM = "pageNum";
49 |
50 | /**
51 | * 每页显示记录数
52 | */
53 | public static String PAGESIZE = "pageSize";
54 |
55 | /**
56 | * 排序列
57 | */
58 | public static String ORDERBYCOLUMN = "orderByColumn";
59 |
60 | /**
61 | * 排序的方向 "desc" 或者 "asc".
62 | */
63 | public static String ISASC = "isAsc";
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/system/config/mapper/ConfigMapper.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.system.config.mapper;
2 |
3 | import com.jetfire.project.system.config.domain.Config;
4 | import java.util.List;
5 |
6 | /**
7 | * 参数配置 数据层
8 | *
9 | * @author jetfire
10 | */
11 | public interface ConfigMapper
12 | {
13 | /**
14 | * 查询参数配置信息
15 | *
16 | * @param configId 参数配置信息
17 | * @return 参数配置信息
18 | */
19 | public Config selectConfig(Config config);
20 |
21 | /**
22 | * 查询参数配置列表
23 | *
24 | * @param config 参数配置信息
25 | * @return 参数配置集合
26 | */
27 | public List selectConfigList(Config config);
28 |
29 | /**
30 | * 根据键名查询参数配置信息
31 | *
32 | * @param configKey 参数键名
33 | * @return 参数配置信息
34 | */
35 | public Config checkConfigKeyUnique(String configKey);
36 |
37 | /**
38 | * 新增参数配置
39 | *
40 | * @param config 参数配置信息
41 | * @return 结果
42 | */
43 | public int insertConfig(Config config);
44 |
45 | /**
46 | * 修改参数配置
47 | *
48 | * @param config 参数配置信息
49 | * @return 结果
50 | */
51 | public int updateConfig(Config config);
52 |
53 | /**
54 | * 批量删除参数配置
55 | *
56 | * @param configIds 需要删除的数据ID
57 | * @return 结果
58 | */
59 | public int deleteConfigByIds(String[] configIds);
60 |
61 | }
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/common/utils/IpUtils.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.common.utils;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 |
5 | /**
6 | * 获取IP方法
7 | *
8 | * @author jetfire
9 | */
10 | public class IpUtils
11 | {
12 | public static String getIpAddr(HttpServletRequest request)
13 | {
14 | if (request == null)
15 | {
16 | return "unknown";
17 | }
18 | String ip = request.getHeader("x-forwarded-for");
19 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
20 | {
21 | ip = request.getHeader("Proxy-Client-IP");
22 | }
23 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
24 | {
25 | ip = request.getHeader("X-Forwarded-For");
26 | }
27 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
28 | {
29 | ip = request.getHeader("WL-Proxy-Client-IP");
30 | }
31 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
32 | {
33 | ip = request.getHeader("X-Real-IP");
34 | }
35 |
36 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
37 | {
38 | ip = request.getRemoteAddr();
39 | }
40 |
41 | return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/resources/static/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.js:
--------------------------------------------------------------------------------
1 | (function ($) {
2 | 'use strict';
3 |
4 | $.fn.bootstrapTable.locales['zh-CN'] = {
5 | formatLoadingMessage: function () {
6 | return '正在努力地加载数据中,请稍候……';
7 | },
8 | formatRecordsPerPage: function (pageNumber) {
9 | return pageNumber + ' 条记录每页';
10 | },
11 | formatShowingRows: function (pageFrom, pageTo, totalRows) {
12 | return '第 ' + pageFrom + ' 到 ' + pageTo + ' 条,共 ' + totalRows + ' 条记录。';
13 | },
14 | formatSearch: function () {
15 | return '搜索';
16 | },
17 | formatNoMatches: function () {
18 | return '没有找到匹配的记录';
19 | },
20 | formatPaginationSwitch: function () {
21 | return '隐藏/显示分页';
22 | },
23 | formatRefresh: function () {
24 | return '刷新';
25 | },
26 | formatToggle: function () {
27 | return '切换';
28 | },
29 | formatColumns: function () {
30 | return '列';
31 | },
32 | formatExport: function () {
33 | return '导出数据';
34 | },
35 | formatClearFilters: function () {
36 | return '清空过滤';
37 | }
38 | };
39 |
40 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']);
41 |
42 | })(jQuery);
43 |
--------------------------------------------------------------------------------
/src/main/resources/templates/vm/java/Service.java.vm:
--------------------------------------------------------------------------------
1 | package ${package}.service;
2 |
3 | import ${package}.domain.${className};
4 | import java.util.List;
5 |
6 | /**
7 | * ${tableComment} 服务层
8 | *
9 | * @author ${author}
10 | * @date ${datetime}
11 | */
12 | public interface I${className}Service
13 | {
14 | /**
15 | * 查询${tableComment}信息
16 | *
17 | * @param ${primaryKey.attrname} ${tableComment}ID
18 | * @return ${tableComment}信息
19 | */
20 | public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname});
21 |
22 | /**
23 | * 查询${tableComment}列表
24 | *
25 | * @param ${classname} ${tableComment}信息
26 | * @return ${tableComment}集合
27 | */
28 | public List<${className}> select${className}List(${className} ${classname});
29 |
30 | /**
31 | * 新增${tableComment}
32 | *
33 | * @param ${classname} ${tableComment}信息
34 | * @return 结果
35 | */
36 | public int insert${className}(${className} ${classname});
37 |
38 | /**
39 | * 修改${tableComment}
40 | *
41 | * @param ${classname} ${tableComment}信息
42 | * @return 结果
43 | */
44 | public int update${className}(${className} ${classname});
45 |
46 | /**
47 | * 删除${tableComment}信息
48 | *
49 | * @param ids 需要删除的数据ID
50 | * @return 结果
51 | */
52 | public int delete${className}ByIds(String ids);
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/common/constant/ShiroConstants.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.common.constant;
2 |
3 | /**
4 | * Shiro通用常量
5 | *
6 | * @author jetfire
7 | */
8 | public interface ShiroConstants
9 | {
10 | /**
11 | * 当前登录的用户
12 | */
13 | public static final String CURRENT_USER = "currentUser";
14 |
15 | /**
16 | * 用户名
17 | */
18 | public static final String CURRENT_USERNAME = "username";
19 |
20 | /**
21 | * 消息key
22 | */
23 | public static String MESSAGE = "message";
24 |
25 | /**
26 | * 错误key
27 | */
28 | public static String ERROR = "errorMsg";
29 |
30 | /**
31 | * 编码格式
32 | */
33 | public static String ENCODING = "UTF-8";
34 |
35 | /**
36 | * 当前在线会话
37 | */
38 | public String ONLINE_SESSION = "online_session";
39 |
40 | /**
41 | * 验证码key
42 | */
43 | public static final String CURRENT_CAPTCHA = "captcha";
44 |
45 | /**
46 | * 验证码开关
47 | */
48 | public static final String CURRENT_EBABLED = "captchaEbabled";
49 |
50 | /**
51 | * 验证码开关
52 | */
53 | public static final String CURRENT_TYPE = "captchaType";
54 |
55 | /**
56 | * 验证码
57 | */
58 | public static final String CURRENT_VALIDATECODE = "validateCode";
59 |
60 | /**
61 | * 验证码错误
62 | */
63 | public static final String CAPTCHA_ERROR = "captchaError";
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## 前世今生
2 |
3 | Jetfire《天火》介绍:
4 | 变形模式:太空穿梭机。G1玩具为VF-1S。SR-71“黑鸟”侦察机 (真人电影版)
5 | 性格:胆大心细,性格温和,秉持坚守和平的信念,重视友谊
6 | 身世:在大战前塞伯坦的“黄金时代”,天火是一位科学家,致力于对于科学研究。
7 | 格言:“在众多科学奥妙中,有如何取得胜利的钥匙。”
8 |
9 | ## 平台简介
10 |
11 | 天火系统基于SpringBoot与shiro实现基于数据库的细粒度动态权限管理系统实例,
12 | 项目代码简洁,注释丰富,上手容易, 包含许多基础模块(用户管理,角色管理,部门管理,字典管理等10个模块),
13 | 可直接作为一个后台管理系统的脚手架。
14 |
15 | ## 技术选型
16 |
17 | 技术|说明|版本
18 | ---|:--:|---:
19 | Spring Boot|核心框架|2.0.3
20 | Apache Shiro|安全框架|1.4.0
21 | Thymeleaf|模板引擎|2.0.0
22 | MyBatis|持久层框架|3.4.6
23 | Quartz|定时任务|2.3.0
24 | Druid|数据库连接池|1.1.10
25 | Swagger2|接口文档|2.7.0
26 |
27 |
28 | ## 内置功能
29 |
30 | 1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
31 | 2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现。
32 | 3. 岗位管理:配置系统用户所属担任职务。
33 | 4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
34 | 5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
35 | 6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
36 | 7. 参数管理:对系统动态配置常用参数。
37 | 8. 通知公告:系统通知公告信息发布维护。
38 | 9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
39 | 10. 登录日志:系统登录日志记录查询包含登录异常。
40 | 11. 在线用户:当前系统中活跃用户状态监控。
41 | 12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
42 | 13. 代码生成:前后端代码的生成(java、html、xml、sql)支持CRUD下载 。
43 | 14. 系统接口:根据业务代码自动生成相关的api接口文档。
44 | 15. 在线构建器:拖动表单元素生成相应的HTML代码。
45 | 16. 连接池监视:监视当期系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
46 |
47 | ## 演示步骤
48 |
49 | - 1.开启MySQL服务
50 | - 2.执行sql/jetfire.sql脚本
51 | - 3.修改application-druid.yml中spring.datasource.url、username、password
52 | - 4.启动JetfireApplication
53 | - 5.登陆界面地址:http://localhost:808 (账号/密码:admin/admin123)
54 |
55 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/monitor/job/mapper/JobMapper.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.monitor.job.mapper;
2 |
3 | import java.util.List;
4 | import com.jetfire.project.monitor.job.domain.Job;
5 |
6 | /**
7 | * 调度任务信息 数据层
8 | *
9 | * @author jetfire
10 | */
11 | public interface JobMapper
12 | {
13 |
14 | /**
15 | * 查询调度任务日志集合
16 | *
17 | * @param job 调度信息
18 | * @return 操作日志集合
19 | */
20 | public List selectJobList(Job job);
21 |
22 | /**
23 | * 查询所有调度任务
24 | *
25 | * @return 调度任务列表
26 | */
27 | public List selectJobAll();
28 |
29 | /**
30 | * 通过调度ID查询调度任务信息
31 | *
32 | * @param jobId 调度ID
33 | * @return 角色对象信息
34 | */
35 | public Job selectJobById(Long jobId);
36 |
37 | /**
38 | * 通过调度ID删除调度任务信息
39 | *
40 | * @param jobId 调度ID
41 | * @return 结果
42 | */
43 | public int deleteJobById(Job job);
44 |
45 | /**
46 | * 批量删除调度任务信息
47 | *
48 | * @param ids 需要删除的数据ID
49 | * @return 结果
50 | */
51 | public int deleteJobLogByIds(Long[] ids);
52 |
53 | /**
54 | * 修改调度任务信息
55 | *
56 | * @param job 调度任务信息
57 | * @return 结果
58 | */
59 | public int updateJob(Job job);
60 |
61 | /**
62 | * 新增调度任务信息
63 | *
64 | * @param job 调度任务信息
65 | * @return 结果
66 | */
67 | public int insertJob(Job job);
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/system/post/mapper/PostMapper.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.system.post.mapper;
2 |
3 | import java.util.List;
4 | import com.jetfire.project.system.post.domain.Post;
5 |
6 | /**
7 | * 岗位信息 数据层
8 | *
9 | * @author jetfire
10 | */
11 | public interface PostMapper
12 | {
13 |
14 | /**
15 | * 查询岗位数据集合
16 | *
17 | * @param post 岗位信息
18 | * @return 岗位数据集合
19 | */
20 | public List selectPostList(Post post);
21 |
22 | /**
23 | * 查询所有岗位
24 | *
25 | * @return 岗位列表
26 | */
27 | public List selectPostAll();
28 |
29 | /**
30 | * 根据用户ID查询岗位
31 | *
32 | * @param userId 用户ID
33 | * @return 岗位列表
34 | */
35 | public List selectPostsByUserId(Long userId);
36 |
37 | /**
38 | * 通过岗位ID查询岗位信息
39 | *
40 | * @param postId 岗位ID
41 | * @return 角色对象信息
42 | */
43 | public Post selectPostById(Long postId);
44 |
45 | /**
46 | * 批量删除岗位信息
47 | *
48 | * @param ids 需要删除的数据ID
49 | * @return 结果
50 | */
51 | public int deletePostByIds(Long[] ids);
52 |
53 | /**
54 | * 修改岗位信息
55 | *
56 | * @param post 岗位信息
57 | * @return 结果
58 | */
59 | public int updatePost(Post post);
60 |
61 | /**
62 | * 新增岗位信息
63 | *
64 | * @param post 岗位信息
65 | * @return 结果
66 | */
67 | public int insertPost(Post post);
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/framework/config/I18nConfig.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.framework.config;
2 |
3 | import java.util.Locale;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.web.servlet.LocaleResolver;
7 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
9 | import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
10 | import org.springframework.web.servlet.i18n.SessionLocaleResolver;
11 |
12 | /**
13 | * 资源文件配置加载
14 | *
15 | * @author jetfire
16 | */
17 | @Configuration
18 | public class I18nConfig implements WebMvcConfigurer
19 | {
20 |
21 | @Bean
22 | public LocaleResolver localeResolver()
23 | {
24 | SessionLocaleResolver slr = new SessionLocaleResolver();
25 | // 默认语言
26 | slr.setDefaultLocale(Locale.SIMPLIFIED_CHINESE);
27 | return slr;
28 | }
29 |
30 | @Bean
31 | public LocaleChangeInterceptor localeChangeInterceptor()
32 | {
33 | LocaleChangeInterceptor lci = new LocaleChangeInterceptor();
34 | // 参数名
35 | lci.setParamName("lang");
36 | return lci;
37 | }
38 |
39 | @Override
40 | public void addInterceptors(InterceptorRegistry registry)
41 | {
42 | registry.addInterceptor(localeChangeInterceptor());
43 | }
44 | }
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/framework/config/RuoYiConfig.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.framework.config;
2 |
3 | import org.springframework.boot.context.properties.ConfigurationProperties;
4 | import org.springframework.stereotype.Component;
5 |
6 | /**
7 | * 读取项目相关配置
8 | *
9 | * @author jetfire
10 | */
11 | @Component
12 | @ConfigurationProperties(prefix = "jetfire")
13 | public class RuoYiConfig
14 | {
15 | /** 项目名称 */
16 | private String name;
17 | /** 版本 */
18 | private String version;
19 | /** 版权年份 */
20 | private String copyrightYear;
21 | /** 上传路径 */
22 | private static String profile;
23 |
24 | public String getName()
25 | {
26 | return name;
27 | }
28 |
29 | public void setName(String name)
30 | {
31 | this.name = name;
32 | }
33 |
34 | public String getVersion()
35 | {
36 | return version;
37 | }
38 |
39 | public void setVersion(String version)
40 | {
41 | this.version = version;
42 | }
43 |
44 | public String getCopyrightYear()
45 | {
46 | return copyrightYear;
47 | }
48 |
49 | public void setCopyrightYear(String copyrightYear)
50 | {
51 | this.copyrightYear = copyrightYear;
52 | }
53 |
54 | public static String getProfile()
55 | {
56 | return profile;
57 | }
58 |
59 | public void setProfile(String profile)
60 | {
61 | RuoYiConfig.profile = profile;
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/src/main/resources/templates/main.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Jetfire介绍
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/main/resources/templates/vm/html/add.html.vm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
26 |
27 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/framework/shiro/web/filter/sync/SyncOnlineSessionFilter.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.framework.shiro.web.filter.sync;
2 |
3 | import javax.servlet.ServletRequest;
4 | import javax.servlet.ServletResponse;
5 | import org.apache.shiro.web.filter.PathMatchingFilter;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 |
8 | import com.jetfire.common.constant.ShiroConstants;
9 | import com.jetfire.framework.shiro.session.OnlineSessionDAO;
10 | import com.jetfire.project.monitor.online.domain.OnlineSession;
11 |
12 | /**
13 | * 同步Session数据到Db
14 | *
15 | * @author jetfire
16 | */
17 | public class SyncOnlineSessionFilter extends PathMatchingFilter
18 | {
19 | @Autowired
20 | private OnlineSessionDAO onlineSessionDAO;
21 |
22 | /**
23 | * 同步会话数据到DB 一次请求最多同步一次 防止过多处理 需要放到Shiro过滤器之前
24 | *
25 | * @param request
26 | * @param response
27 | * @return
28 | * @throws Exception
29 | */
30 | @Override
31 | protected boolean preHandle(ServletRequest request, ServletResponse response) throws Exception
32 | {
33 | OnlineSession session = (OnlineSession) request.getAttribute(ShiroConstants.ONLINE_SESSION);
34 | // 如果session stop了 也不同步
35 | // session停止时间,如果stopTimestamp不为null,则代表已停止
36 | if (session != null && session.getUserId() != null && session.getStopTimestamp() == null)
37 | {
38 | onlineSessionDAO.syncToDb(session);
39 | }
40 | return true;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/framework/config/ResourcesConfig.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.framework.config;
2 |
3 | import org.springframework.beans.factory.annotation.Value;
4 | import org.springframework.context.annotation.Configuration;
5 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
6 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
8 |
9 | /**
10 | * 通用配置
11 | *
12 | * @author jetfire
13 | */
14 | @Configuration
15 | public class ResourcesConfig implements WebMvcConfigurer
16 | {
17 | /**
18 | * 首页地址
19 | */
20 | @Value("${shiro.user.indexUrl}")
21 | private String indexUrl;
22 |
23 | /**
24 | * 默认首页的设置,当输入域名是可以自动跳转到默认指定的网页
25 | */
26 | @Override
27 | public void addViewControllers(ViewControllerRegistry registry)
28 | {
29 | registry.addViewController("/").setViewName("forward:" + indexUrl);
30 | }
31 |
32 | @Override
33 | public void addResourceHandlers(ResourceHandlerRegistry registry)
34 | {
35 | /** 头像上传路径 */
36 | registry.addResourceHandler("/profile/**").addResourceLocations("file:" + RuoYiConfig.getProfile());
37 |
38 | /** swagger配置 */
39 | registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
40 | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
41 | }
42 | }
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/common/constant/CommonMap.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.common.constant;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | /**
7 | * 通用Map数据
8 | *
9 | * @author jetfire
10 | */
11 | public class CommonMap
12 | {
13 | /** 状态编码转换 */
14 | public static Map javaTypeMap = new HashMap();
15 |
16 | static
17 | {
18 | initJavaTypeMap();
19 | }
20 |
21 | /**
22 | * 返回状态映射
23 | */
24 | public static void initJavaTypeMap()
25 | {
26 | javaTypeMap.put("tinyint", "Integer");
27 | javaTypeMap.put("smallint", "Integer");
28 | javaTypeMap.put("mediumint", "Integer");
29 | javaTypeMap.put("int", "Integer");
30 | javaTypeMap.put("integer", "integer");
31 | javaTypeMap.put("bigint", "Long");
32 | javaTypeMap.put("float", "Float");
33 | javaTypeMap.put("double", "Double");
34 | javaTypeMap.put("decimal", "BigDecimal");
35 | javaTypeMap.put("bit", "Boolean");
36 | javaTypeMap.put("char", "String");
37 | javaTypeMap.put("varchar", "String");
38 | javaTypeMap.put("tinytext", "String");
39 | javaTypeMap.put("text", "String");
40 | javaTypeMap.put("mediumtext", "String");
41 | javaTypeMap.put("longtext", "String");
42 | javaTypeMap.put("time", "Date");
43 | javaTypeMap.put("date", "Date");
44 | javaTypeMap.put("datetime", "Date");
45 | javaTypeMap.put("timestamp", "Date");
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/system/config/service/IConfigService.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.system.config.service;
2 |
3 | import com.jetfire.project.system.config.domain.Config;
4 | import java.util.List;
5 |
6 | /**
7 | * 参数配置 服务层
8 | *
9 | * @author jetfire
10 | */
11 | public interface IConfigService
12 | {
13 |
14 | /**
15 | * 查询参数配置信息
16 | *
17 | * @param configId 参数配置ID
18 | * @return 参数配置信息
19 | */
20 | public Config selectConfigById(Long configId);
21 |
22 | /**
23 | * 根据键名查询参数配置信息
24 | *
25 | * @param configKey 参数键名
26 | * @return 参数键值
27 | */
28 | public String selectConfigByKey(String configKey);
29 |
30 | /**
31 | * 查询参数配置列表
32 | *
33 | * @param config 参数配置信息
34 | * @return 参数配置集合
35 | */
36 | public List selectConfigList(Config config);
37 |
38 | /**
39 | * 新增参数配置
40 | *
41 | * @param config 参数配置信息
42 | * @return 结果
43 | */
44 | public int insertConfig(Config config);
45 |
46 | /**
47 | * 修改参数配置
48 | *
49 | * @param config 参数配置信息
50 | * @return 结果
51 | */
52 | public int updateConfig(Config config);
53 |
54 | /**
55 | * 批量删除参数配置信息
56 | *
57 | * @param ids 需要删除的数据ID
58 | * @return 结果
59 | */
60 | public int deleteConfigByIds(String ids);
61 |
62 | /**
63 | * 校验参数键名是否唯一
64 | *
65 | * @param config 参数信息
66 | * @return 结果
67 | */
68 | public String checkConfigKeyUnique(Config config);
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/framework/web/page/PageDomain.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.framework.web.page;
2 |
3 | import com.jetfire.common.utils.StringUtils;
4 |
5 | /**
6 | * 分页数据
7 | *
8 | * @author jetfire
9 | */
10 | public class PageDomain
11 | {
12 | /** 当前记录起始索引 */
13 | private Integer pageNum;
14 | /** 每页显示记录数 */
15 | private Integer pageSize;
16 | /** 排序列 */
17 | private String orderByColumn;
18 | /** 排序的方向 "desc" 或者 "asc". */
19 | private String isAsc;
20 |
21 | public String getOrderBy()
22 | {
23 | if (StringUtils.isEmpty(orderByColumn))
24 | {
25 | return "";
26 | }
27 | return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
28 | }
29 |
30 | public Integer getPageNum()
31 | {
32 | return pageNum;
33 | }
34 |
35 | public void setPageNum(Integer pageNum)
36 | {
37 | this.pageNum = pageNum;
38 | }
39 |
40 | public Integer getPageSize()
41 | {
42 | return pageSize;
43 | }
44 |
45 | public void setPageSize(Integer pageSize)
46 | {
47 | this.pageSize = pageSize;
48 | }
49 |
50 | public String getOrderByColumn()
51 | {
52 | return orderByColumn;
53 | }
54 |
55 | public void setOrderByColumn(String orderByColumn)
56 | {
57 | this.orderByColumn = orderByColumn;
58 | }
59 |
60 | public String getIsAsc()
61 | {
62 | return isAsc;
63 | }
64 |
65 | public void setIsAsc(String isAsc)
66 | {
67 | this.isAsc = isAsc;
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/monitor/logininfor/service/LogininforServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.monitor.logininfor.service;
2 |
3 | import java.util.List;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.stereotype.Service;
6 | import com.jetfire.common.support.Convert;
7 | import com.jetfire.project.monitor.logininfor.domain.Logininfor;
8 | import com.jetfire.project.monitor.logininfor.mapper.LogininforMapper;
9 |
10 | /**
11 | * 系统访问日志情况信息 服务层处理
12 | *
13 | * @author jetfire
14 | */
15 | @Service
16 | public class LogininforServiceImpl implements ILogininforService
17 | {
18 |
19 | @Autowired
20 | private LogininforMapper logininforMapper;
21 |
22 | /**
23 | * 新增系统登录日志
24 | *
25 | * @param logininfor 访问日志对象
26 | */
27 | @Override
28 | public void insertLogininfor(Logininfor logininfor)
29 | {
30 | logininforMapper.insertLogininfor(logininfor);
31 | }
32 |
33 | /**
34 | * 查询系统登录日志集合
35 | *
36 | * @param logininfor 访问日志对象
37 | * @return 登录记录集合
38 | */
39 | @Override
40 | public List selectLogininforList(Logininfor logininfor)
41 | {
42 | return logininforMapper.selectLogininforList(logininfor);
43 | }
44 |
45 | /**
46 | * 批量删除系统登录日志
47 | *
48 | * @param ids 需要删除的数据
49 | * @return
50 | */
51 | @Override
52 | public int deleteLogininforByIds(String ids)
53 | {
54 | return logininforMapper.deleteLogininforByIds(Convert.toStrArray(ids));
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/monitor/online/service/IUserOnlineService.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.monitor.online.service;
2 |
3 | import java.util.Date;
4 | import java.util.List;
5 | import com.jetfire.project.monitor.online.domain.UserOnline;
6 |
7 | /**
8 | * 在线用户 服务层
9 | *
10 | * @author jetfire
11 | */
12 | public interface IUserOnlineService
13 | {
14 | /**
15 | * 通过会话序号查询信息
16 | *
17 | * @param sessionId 会话ID
18 | * @return 在线用户信息
19 | */
20 | public UserOnline selectOnlineById(String sessionId);
21 |
22 | /**
23 | * 通过会话序号删除信息
24 | *
25 | * @param sessionId 会话ID
26 | * @return 在线用户信息
27 | */
28 | public void deleteOnlineById(String sessionId);
29 |
30 | /**
31 | * 通过会话序号删除信息
32 | *
33 | * @param sessions 会话ID集合
34 | * @return 在线用户信息
35 | */
36 | public void batchDeleteOnline(List sessions);
37 |
38 | /**
39 | * 保存会话信息
40 | *
41 | * @param online 会话信息
42 | */
43 | public void saveOnline(UserOnline online);
44 |
45 | /**
46 | * 查询会话集合
47 | *
48 | * @param userOnline 分页参数
49 | * @return 会话集合
50 | */
51 | public List selectUserOnlineList(UserOnline userOnline);
52 |
53 | /**
54 | * 强退用户
55 | *
56 | * @param sessionId 会话ID
57 | */
58 | public void forceLogout(String sessionId);
59 |
60 | /**
61 | * 查询会话集合
62 | *
63 | * @param expiredDate 有效期
64 | * @return 会话集合
65 | */
66 | public List selectOnlineByExpired(Date expiredDate);
67 | }
68 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/system/post/service/IPostService.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.system.post.service;
2 |
3 | import java.util.List;
4 | import com.jetfire.project.system.post.domain.Post;
5 |
6 | /**
7 | * 岗位信息 服务层
8 | *
9 | * @author jetfire
10 | */
11 | public interface IPostService
12 | {
13 | /**
14 | * 查询岗位信息集合
15 | *
16 | * @param post 岗位信息
17 | * @return 岗位信息集合
18 | */
19 | public List selectPostList(Post post);
20 |
21 | /**
22 | * 查询所有岗位
23 | *
24 | * @return 岗位列表
25 | */
26 | public List selectPostAll();
27 |
28 | /**
29 | * 根据用户ID查询岗位
30 | *
31 | * @param userId 用户ID
32 | * @return 岗位列表
33 | */
34 | public List selectPostsByUserId(Long userId);
35 |
36 | /**
37 | * 通过岗位ID查询岗位信息
38 | *
39 | * @param postId 岗位ID
40 | * @return 角色对象信息
41 | */
42 | public Post selectPostById(Long postId);
43 |
44 | /**
45 | * 批量删除岗位信息
46 | *
47 | * @param ids 需要删除的数据ID
48 | */
49 | public int deletePostByIds(String ids) throws Exception;
50 |
51 | /**
52 | * 新增保存岗位信息
53 | *
54 | * @param post 岗位信息
55 | * @return 结果
56 | */
57 | public int insertPost(Post post);
58 |
59 | /**
60 | * 修改保存岗位信息
61 | *
62 | * @param post 岗位信息
63 | * @return 结果
64 | */
65 | public int updatePost(Post post);
66 |
67 | /**
68 | * 通过岗位ID查询岗位使用数量
69 | *
70 | * @param postId 岗位ID
71 | * @return 结果
72 | */
73 | public int countUserPostById(Long postId);
74 | }
75 |
--------------------------------------------------------------------------------
/src/main/java/com/jetfire/project/system/user/controller/IndexController.java:
--------------------------------------------------------------------------------
1 | package com.jetfire.project.system.user.controller;
2 |
3 | import java.util.List;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.stereotype.Controller;
6 | import org.springframework.ui.ModelMap;
7 | import org.springframework.web.bind.annotation.GetMapping;
8 | import com.jetfire.framework.config.RuoYiConfig;
9 | import com.jetfire.framework.web.controller.BaseController;
10 | import com.jetfire.project.system.menu.domain.Menu;
11 | import com.jetfire.project.system.menu.service.IMenuService;
12 | import com.jetfire.project.system.user.domain.User;
13 |
14 | /**
15 | * 首页 业务处理
16 | *
17 | * @author jetfire
18 | */
19 | @Controller
20 | public class IndexController extends BaseController
21 | {
22 | @Autowired
23 | private IMenuService menuService;
24 |
25 | @Autowired
26 | private RuoYiConfig ruoYiConfig;
27 |
28 | // 系统首页
29 | @GetMapping("/index")
30 | public String index(ModelMap mmap)
31 | {
32 | // 取身份信息
33 | User user = getUser();
34 | // 根据用户id取出菜单
35 | List