Commit 35a01cbf293b8d9bce5880abc544cf203d499848
1 parent
c95f5402
迁移登陆日志完成
开始迁移参数配置
Showing
38 changed files
with
389 additions
and
571 deletions
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
| 1 | 1 | package com.ruoyi.web.controller.system; |
| 2 | 2 | |
| 3 | 3 | import java.util.List; |
| 4 | + | |
| 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 5 | 6 | import org.springframework.security.access.prepost.PreAuthorize; |
| 6 | 7 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -26,13 +27,13 @@ import com.ruoyi.system.service.ISysConfigService; |
| 26 | 27 | |
| 27 | 28 | /** |
| 28 | 29 | * 参数配置 信息操作处理 |
| 29 | - * | |
| 30 | + * | |
| 30 | 31 | * @author ruoyi |
| 31 | 32 | */ |
| 32 | 33 | @RestController |
| 33 | 34 | @RequestMapping("/system/config") |
| 34 | -public class SysConfigController extends BaseController | |
| 35 | -{ | |
| 35 | +public class SysConfigController extends BaseController { | |
| 36 | + | |
| 36 | 37 | @Autowired |
| 37 | 38 | private ISysConfigService configService; |
| 38 | 39 | |
| ... | ... | @@ -41,8 +42,7 @@ public class SysConfigController extends BaseController |
| 41 | 42 | */ |
| 42 | 43 | @PreAuthorize("@ss.hasPermi('system:config:list')") |
| 43 | 44 | @GetMapping("/list") |
| 44 | - public TableDataInfo list(SysConfig config) | |
| 45 | - { | |
| 45 | + public TableDataInfo list(SysConfig config) { | |
| 46 | 46 | startPage(); |
| 47 | 47 | List<SysConfig> list = configService.selectConfigList(config); |
| 48 | 48 | return getDataTable(list); |
| ... | ... | @@ -51,8 +51,7 @@ public class SysConfigController extends BaseController |
| 51 | 51 | @Log(title = "参数管理", businessType = BusinessType.EXPORT) |
| 52 | 52 | @PreAuthorize("@ss.hasPermi('system:config:export')") |
| 53 | 53 | @GetMapping("/export") |
| 54 | - public AjaxResult export(SysConfig config) | |
| 55 | - { | |
| 54 | + public AjaxResult export(SysConfig config) { | |
| 56 | 55 | List<SysConfig> list = configService.selectConfigList(config); |
| 57 | 56 | ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class); |
| 58 | 57 | return util.exportExcel(list, "参数数据"); |
| ... | ... | @@ -63,8 +62,7 @@ public class SysConfigController extends BaseController |
| 63 | 62 | */ |
| 64 | 63 | @PreAuthorize("@ss.hasPermi('system:config:query')") |
| 65 | 64 | @GetMapping(value = "/{configId}") |
| 66 | - public AjaxResult getInfo(@PathVariable Long configId) | |
| 67 | - { | |
| 65 | + public AjaxResult getInfo(@PathVariable Long configId) { | |
| 68 | 66 | return AjaxResult.success(configService.selectConfigById(configId)); |
| 69 | 67 | } |
| 70 | 68 | |
| ... | ... | @@ -72,8 +70,7 @@ public class SysConfigController extends BaseController |
| 72 | 70 | * 根据参数键名查询参数值 |
| 73 | 71 | */ |
| 74 | 72 | @GetMapping(value = "/configKey/{configKey}") |
| 75 | - public AjaxResult getConfigKey(@PathVariable String configKey) | |
| 76 | - { | |
| 73 | + public AjaxResult getConfigKey(@PathVariable String configKey) { | |
| 77 | 74 | return AjaxResult.success(configService.selectConfigByKey(configKey)); |
| 78 | 75 | } |
| 79 | 76 | |
| ... | ... | @@ -84,10 +81,8 @@ public class SysConfigController extends BaseController |
| 84 | 81 | @Log(title = "参数管理", businessType = BusinessType.INSERT) |
| 85 | 82 | @PostMapping |
| 86 | 83 | @RepeatSubmit |
| 87 | - public AjaxResult add(@Validated @RequestBody SysConfig config) | |
| 88 | - { | |
| 89 | - if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) | |
| 90 | - { | |
| 84 | + public AjaxResult add(@Validated @RequestBody SysConfig config) { | |
| 85 | + if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { | |
| 91 | 86 | return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
| 92 | 87 | } |
| 93 | 88 | config.setCreateBy(SecurityUtils.getUsername()); |
| ... | ... | @@ -100,10 +95,8 @@ public class SysConfigController extends BaseController |
| 100 | 95 | @PreAuthorize("@ss.hasPermi('system:config:edit')") |
| 101 | 96 | @Log(title = "参数管理", businessType = BusinessType.UPDATE) |
| 102 | 97 | @PutMapping |
| 103 | - public AjaxResult edit(@Validated @RequestBody SysConfig config) | |
| 104 | - { | |
| 105 | - if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) | |
| 106 | - { | |
| 98 | + public AjaxResult edit(@Validated @RequestBody SysConfig config) { | |
| 99 | + if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { | |
| 107 | 100 | return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
| 108 | 101 | } |
| 109 | 102 | config.setUpdateBy(SecurityUtils.getUsername()); |
| ... | ... | @@ -116,20 +109,8 @@ public class SysConfigController extends BaseController |
| 116 | 109 | @PreAuthorize("@ss.hasPermi('system:config:remove')") |
| 117 | 110 | @Log(title = "参数管理", businessType = BusinessType.DELETE) |
| 118 | 111 | @DeleteMapping("/{configIds}") |
| 119 | - public AjaxResult remove(@PathVariable Long[] configIds) | |
| 120 | - { | |
| 112 | + public AjaxResult remove(@PathVariable Long[] configIds) { | |
| 121 | 113 | return toAjax(configService.deleteConfigByIds(configIds)); |
| 122 | 114 | } |
| 123 | 115 | |
| 124 | - /** | |
| 125 | - * 清空缓存 | |
| 126 | - */ | |
| 127 | - @PreAuthorize("@ss.hasPermi('system:config:remove')") | |
| 128 | - @Log(title = "参数管理", businessType = BusinessType.CLEAN) | |
| 129 | - @DeleteMapping("/clearCache") | |
| 130 | - public AjaxResult clearCache() | |
| 131 | - { | |
| 132 | - configService.clearCache(); | |
| 133 | - return AjaxResult.success(); | |
| 134 | - } | |
| 135 | 116 | } | ... | ... |
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java deleted
| 1 | -package com.ruoyi.system.domain; | |
| 2 | - | |
| 3 | -import javax.validation.constraints.NotBlank; | |
| 4 | -import javax.validation.constraints.Size; | |
| 5 | -import org.apache.commons.lang3.builder.ToStringBuilder; | |
| 6 | -import org.apache.commons.lang3.builder.ToStringStyle; | |
| 7 | -import com.ruoyi.common.annotation.Excel; | |
| 8 | -import com.ruoyi.common.annotation.Excel.ColumnType; | |
| 9 | -import com.ruoyi.common.core.domain.BaseEntity; | |
| 10 | - | |
| 11 | -/** | |
| 12 | - * 参数配置表 sys_config | |
| 13 | - * | |
| 14 | - * @author ruoyi | |
| 15 | - */ | |
| 16 | -public class SysConfig extends BaseEntity | |
| 17 | -{ | |
| 18 | - private static final long serialVersionUID = 1L; | |
| 19 | - | |
| 20 | - /** 参数主键 */ | |
| 21 | - @Excel(name = "参数主键", cellType = ColumnType.NUMERIC) | |
| 22 | - private Long configId; | |
| 23 | - | |
| 24 | - /** 参数名称 */ | |
| 25 | - @Excel(name = "参数名称") | |
| 26 | - private String configName; | |
| 27 | - | |
| 28 | - /** 参数键名 */ | |
| 29 | - @Excel(name = "参数键名") | |
| 30 | - private String configKey; | |
| 31 | - | |
| 32 | - /** 参数键值 */ | |
| 33 | - @Excel(name = "参数键值") | |
| 34 | - private String configValue; | |
| 35 | - | |
| 36 | - /** 系统内置(Y是 N否) */ | |
| 37 | - @Excel(name = "系统内置", readConverterExp = "Y=是,N=否") | |
| 38 | - private String configType; | |
| 39 | - | |
| 40 | - @NotBlank(message = "参数名称不能为空") | |
| 41 | - @Size(min = 0, max = 100, message = "参数名称不能超过100个字符") | |
| 42 | - public String getConfigName() | |
| 43 | - { | |
| 44 | - return configName; | |
| 45 | - } | |
| 46 | - | |
| 47 | - @NotBlank(message = "参数键名长度不能为空") | |
| 48 | - @Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符") | |
| 49 | - public String getConfigKey() | |
| 50 | - { | |
| 51 | - return configKey; | |
| 52 | - } | |
| 53 | - | |
| 54 | - @NotBlank(message = "参数键值不能为空") | |
| 55 | - @Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符") | |
| 56 | - public String getConfigValue() | |
| 57 | - { | |
| 58 | - return configValue; | |
| 59 | - } | |
| 60 | - | |
| 61 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java deleted
| 1 | -package com.ruoyi.system.service; | |
| 2 | - | |
| 3 | -import java.util.List; | |
| 4 | -import com.ruoyi.system.domain.SysConfig; | |
| 5 | - | |
| 6 | -/** | |
| 7 | - * 参数配置 服务层 | |
| 8 | - * | |
| 9 | - * @author ruoyi | |
| 10 | - */ | |
| 11 | -public interface ISysConfigService | |
| 12 | -{ | |
| 13 | - /** | |
| 14 | - * 查询参数配置信息 | |
| 15 | - * | |
| 16 | - * @param configId 参数配置ID | |
| 17 | - * @return 参数配置信息 | |
| 18 | - */ | |
| 19 | - public SysConfig selectConfigById(Long configId); | |
| 20 | - | |
| 21 | - /** | |
| 22 | - * 根据键名查询参数配置信息 | |
| 23 | - * | |
| 24 | - * @param configKey 参数键名 | |
| 25 | - * @return 参数键值 | |
| 26 | - */ | |
| 27 | - public String selectConfigByKey(String configKey); | |
| 28 | - | |
| 29 | - /** | |
| 30 | - * 查询参数配置列表 | |
| 31 | - * | |
| 32 | - * @param config 参数配置信息 | |
| 33 | - * @return 参数配置集合 | |
| 34 | - */ | |
| 35 | - public List<SysConfig> selectConfigList(SysConfig config); | |
| 36 | - | |
| 37 | - /** | |
| 38 | - * 新增参数配置 | |
| 39 | - * | |
| 40 | - * @param config 参数配置信息 | |
| 41 | - * @return 结果 | |
| 42 | - */ | |
| 43 | - public int insertConfig(SysConfig config); | |
| 44 | - | |
| 45 | - /** | |
| 46 | - * 修改参数配置 | |
| 47 | - * | |
| 48 | - * @param config 参数配置信息 | |
| 49 | - * @return 结果 | |
| 50 | - */ | |
| 51 | - public int updateConfig(SysConfig config); | |
| 52 | - | |
| 53 | - /** | |
| 54 | - * 批量删除参数信息 | |
| 55 | - * | |
| 56 | - * @param configIds 需要删除的参数ID | |
| 57 | - * @return 结果 | |
| 58 | - */ | |
| 59 | - public int deleteConfigByIds(Long[] configIds); | |
| 60 | - | |
| 61 | - /** | |
| 62 | - * 清空缓存数据 | |
| 63 | - */ | |
| 64 | - public void clearCache(); | |
| 65 | - | |
| 66 | - /** | |
| 67 | - * 校验参数键名是否唯一 | |
| 68 | - * | |
| 69 | - * @param config 参数信息 | |
| 70 | - * @return 结果 | |
| 71 | - */ | |
| 72 | - public String checkConfigKeyUnique(SysConfig config); | |
| 73 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java deleted
| 1 | -package com.ruoyi.system.service; | |
| 2 | - | |
| 3 | -import java.util.List; | |
| 4 | -import com.ruoyi.system.domain.SysLogininfor; | |
| 5 | - | |
| 6 | -/** | |
| 7 | - * 系统访问日志情况信息 服务层 | |
| 8 | - * | |
| 9 | - * @author ruoyi | |
| 10 | - */ | |
| 11 | -public interface ISysLogininforService | |
| 12 | -{ | |
| 13 | - /** | |
| 14 | - * 新增系统登录日志 | |
| 15 | - * | |
| 16 | - * @param logininfor 访问日志对象 | |
| 17 | - */ | |
| 18 | - public void insertLogininfor(SysLogininfor logininfor); | |
| 19 | - | |
| 20 | - /** | |
| 21 | - * 查询系统登录日志集合 | |
| 22 | - * | |
| 23 | - * @param logininfor 访问日志对象 | |
| 24 | - * @return 登录记录集合 | |
| 25 | - */ | |
| 26 | - public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor); | |
| 27 | - | |
| 28 | - /** | |
| 29 | - * 批量删除系统登录日志 | |
| 30 | - * | |
| 31 | - * @param infoIds 需要删除的登录日志ID | |
| 32 | - * @return | |
| 33 | - */ | |
| 34 | - public int deleteLogininforByIds(Long[] infoIds); | |
| 35 | - | |
| 36 | - /** | |
| 37 | - * 清空系统登录日志 | |
| 38 | - */ | |
| 39 | - public void cleanLogininfor(); | |
| 40 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java deleted
| 1 | -package com.ruoyi.system.service.impl; | |
| 2 | - | |
| 3 | -import java.util.List; | |
| 4 | - | |
| 5 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 6 | -import org.springframework.stereotype.Service; | |
| 7 | -import com.ruoyi.system.domain.SysLogininfor; | |
| 8 | -import com.ruoyi.system.mapper.SysLogininforMapper; | |
| 9 | -import com.ruoyi.system.service.ISysLogininforService; | |
| 10 | - | |
| 11 | -/** | |
| 12 | - * 系统访问日志情况信息 服务层处理 | |
| 13 | - * | |
| 14 | - * @author ruoyi | |
| 15 | - */ | |
| 16 | -@Service | |
| 17 | -public class SysLogininforServiceImpl implements ISysLogininforService { | |
| 18 | - | |
| 19 | - @Autowired | |
| 20 | - private SysLogininforMapper logininforMapper; | |
| 21 | - | |
| 22 | - /** | |
| 23 | - * 新增系统登录日志 | |
| 24 | - * | |
| 25 | - * @param logininfor 访问日志对象 | |
| 26 | - */ | |
| 27 | - @Override | |
| 28 | - public void insertLogininfor(SysLogininfor logininfor) { | |
| 29 | - logininforMapper.insertLogininfor(logininfor); | |
| 30 | - } | |
| 31 | - | |
| 32 | - /** | |
| 33 | - * 查询系统登录日志集合 | |
| 34 | - * | |
| 35 | - * @param logininfor 访问日志对象 | |
| 36 | - * @return 登录记录集合 | |
| 37 | - */ | |
| 38 | - @Override | |
| 39 | - public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) { | |
| 40 | - return logininforMapper.selectLogininforList(logininfor); | |
| 41 | - } | |
| 42 | - | |
| 43 | - /** | |
| 44 | - * 批量删除系统登录日志 | |
| 45 | - * | |
| 46 | - * @param infoIds 需要删除的登录日志ID | |
| 47 | - * @return | |
| 48 | - */ | |
| 49 | - @Override | |
| 50 | - public int deleteLogininforByIds(Long[] infoIds) { | |
| 51 | - return logininforMapper.deleteLogininforByIds(infoIds); | |
| 52 | - } | |
| 53 | - | |
| 54 | - /** | |
| 55 | - * 清空系统登录日志 | |
| 56 | - */ | |
| 57 | - @Override | |
| 58 | - public void cleanLogininfor() { | |
| 59 | - logininforMapper.cleanLogininfor(); | |
| 60 | - } | |
| 61 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java deleted
| 1 | -package com.ruoyi.system.service.impl; | |
| 2 | - | |
| 3 | -import java.util.List; | |
| 4 | - | |
| 5 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 6 | -import org.springframework.stereotype.Service; | |
| 7 | -import com.ruoyi.system.domain.SysOperLog; | |
| 8 | -import com.ruoyi.system.mapper.SysOperLogMapper; | |
| 9 | -import com.ruoyi.system.service.ISysOperLogService; | |
| 10 | - | |
| 11 | -/** | |
| 12 | - * 操作日志 服务层处理 | |
| 13 | - * | |
| 14 | - * @author ruoyi | |
| 15 | - */ | |
| 16 | -@Service | |
| 17 | -public class SysOperLogServiceImpl implements ISysOperLogService { | |
| 18 | - @Autowired | |
| 19 | - private SysOperLogMapper operLogMapper; | |
| 20 | - | |
| 21 | - /** | |
| 22 | - * 新增操作日志 | |
| 23 | - * | |
| 24 | - * @param operLog 操作日志对象 | |
| 25 | - */ | |
| 26 | - @Override | |
| 27 | - public void insertOperlog(SysOperLog operLog) { | |
| 28 | - operLogMapper.insertOperlog(operLog); | |
| 29 | - } | |
| 30 | - | |
| 31 | - /** | |
| 32 | - * 查询系统操作日志集合 | |
| 33 | - * | |
| 34 | - * @param operLog 操作日志对象 | |
| 35 | - * @return 操作日志集合 | |
| 36 | - */ | |
| 37 | - @Override | |
| 38 | - public List<SysOperLog> selectOperLogList(SysOperLog operLog) { | |
| 39 | - return operLogMapper.selectOperLogList(operLog); | |
| 40 | - } | |
| 41 | - | |
| 42 | - | |
| 43 | - /** | |
| 44 | - * 查询操作日志详细 | |
| 45 | - * | |
| 46 | - * @param operId 操作ID | |
| 47 | - * @return 操作日志对象 | |
| 48 | - */ | |
| 49 | - @Override | |
| 50 | - public SysOperLog selectOperLogById(Long operId) { | |
| 51 | - return operLogMapper.selectOperLogById(operId); | |
| 52 | - } | |
| 53 | - | |
| 54 | -} |
ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | |
| 2 | -<!DOCTYPE mapper | |
| 3 | -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.SysConfigMapper"> | |
| 6 | - | |
| 7 | - <resultMap type="SysConfig" id="SysConfigResult"> | |
| 8 | - <id property="configId" column="config_id" /> | |
| 9 | - <result property="configName" column="config_name" /> | |
| 10 | - <result property="configKey" column="config_key" /> | |
| 11 | - <result property="configValue" column="config_value" /> | |
| 12 | - <result property="configType" column="config_type" /> | |
| 13 | - <result property="createBy" column="create_by" /> | |
| 14 | - <result property="createTime" column="create_time" /> | |
| 15 | - <result property="updateBy" column="update_by" /> | |
| 16 | - <result property="updateTime" column="update_time" /> | |
| 17 | - </resultMap> | |
| 18 | - | |
| 19 | - <sql id="selectConfigVo"> | |
| 20 | - select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark | |
| 21 | - from sys_config | |
| 22 | - </sql> | |
| 23 | - | |
| 24 | - <!-- 查询条件 --> | |
| 25 | - <sql id="sqlwhereSearch"> | |
| 26 | - <where> | |
| 27 | - <if test="configId !=null"> | |
| 28 | - and config_id = #{configId} | |
| 29 | - </if> | |
| 30 | - <if test="configKey !=null and configKey != ''"> | |
| 31 | - and config_key = #{configKey} | |
| 32 | - </if> | |
| 33 | - </where> | |
| 34 | - </sql> | |
| 35 | - | |
| 36 | - <select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult"> | |
| 37 | - <include refid="selectConfigVo"/> | |
| 38 | - <include refid="sqlwhereSearch"/> | |
| 39 | - </select> | |
| 40 | - | |
| 41 | - <select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult"> | |
| 42 | - <include refid="selectConfigVo"/> | |
| 43 | - <where> | |
| 44 | - <if test="configName != null and configName != ''"> | |
| 45 | - AND config_name like concat('%', #{configName}, '%') | |
| 46 | - </if> | |
| 47 | - <if test="configType != null and configType != ''"> | |
| 48 | - AND config_type = #{configType} | |
| 49 | - </if> | |
| 50 | - <if test="configKey != null and configKey != ''"> | |
| 51 | - AND config_key like concat('%', #{configKey}, '%') | |
| 52 | - </if> | |
| 53 | - <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> | |
| 54 | - and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') | |
| 55 | - </if> | |
| 56 | - <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> | |
| 57 | - and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') | |
| 58 | - </if> | |
| 59 | - </where> | |
| 60 | - </select> | |
| 61 | - | |
| 62 | - <select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult"> | |
| 63 | - <include refid="selectConfigVo"/> | |
| 64 | - where config_key = #{configKey} limit 1 | |
| 65 | - </select> | |
| 66 | - | |
| 67 | - <insert id="insertConfig" parameterType="SysConfig"> | |
| 68 | - insert into sys_config ( | |
| 69 | - <if test="configName != null and configName != '' ">config_name,</if> | |
| 70 | - <if test="configKey != null and configKey != '' ">config_key,</if> | |
| 71 | - <if test="configValue != null and configValue != '' ">config_value,</if> | |
| 72 | - <if test="configType != null and configType != '' ">config_type,</if> | |
| 73 | - <if test="createBy != null and createBy != ''">create_by,</if> | |
| 74 | - <if test="remark != null and remark != ''">remark,</if> | |
| 75 | - create_time | |
| 76 | - )values( | |
| 77 | - <if test="configName != null and configName != ''">#{configName},</if> | |
| 78 | - <if test="configKey != null and configKey != ''">#{configKey},</if> | |
| 79 | - <if test="configValue != null and configValue != ''">#{configValue},</if> | |
| 80 | - <if test="configType != null and configType != ''">#{configType},</if> | |
| 81 | - <if test="createBy != null and createBy != ''">#{createBy},</if> | |
| 82 | - <if test="remark != null and remark != ''">#{remark},</if> | |
| 83 | - sysdate() | |
| 84 | - ) | |
| 85 | - </insert> | |
| 86 | - | |
| 87 | - <update id="updateConfig" parameterType="SysConfig"> | |
| 88 | - update sys_config | |
| 89 | - <set> | |
| 90 | - <if test="configName != null and configName != ''">config_name = #{configName},</if> | |
| 91 | - <if test="configKey != null and configKey != ''">config_key = #{configKey},</if> | |
| 92 | - <if test="configValue != null and configValue != ''">config_value = #{configValue},</if> | |
| 93 | - <if test="configType != null and configType != ''">config_type = #{configType},</if> | |
| 94 | - <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> | |
| 95 | - <if test="remark != null">remark = #{remark},</if> | |
| 96 | - update_time = sysdate() | |
| 97 | - </set> | |
| 98 | - where config_id = #{configId} | |
| 99 | - </update> | |
| 100 | - | |
| 101 | - <delete id="deleteConfigById" parameterType="Long"> | |
| 102 | - delete from sys_config where config_id = #{configId} | |
| 103 | - </delete> | |
| 104 | - | |
| 105 | - <delete id="deleteConfigByIds" parameterType="Long"> | |
| 106 | - delete from sys_config where config_id in | |
| 107 | - <foreach item="configId" collection="array" open="(" separator="," close=")"> | |
| 108 | - #{configId} | |
| 109 | - </foreach> | |
| 110 | - </delete> | |
| 111 | - | |
| 112 | -</mapper> | |
| 113 | 0 | \ No newline at end of file |
ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | |
| 2 | -<!DOCTYPE mapper | |
| 3 | -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.SysLogininforMapper"> | |
| 6 | - | |
| 7 | - <resultMap type="SysLogininfor" id="SysLogininforResult"> | |
| 8 | - <id property="infoId" column="info_id" /> | |
| 9 | - <result property="userName" column="user_name" /> | |
| 10 | - <result property="status" column="status" /> | |
| 11 | - <result property="ipaddr" column="ipaddr" /> | |
| 12 | - <result property="loginLocation" column="login_location" /> | |
| 13 | - <result property="browser" column="browser" /> | |
| 14 | - <result property="os" column="os" /> | |
| 15 | - <result property="msg" column="msg" /> | |
| 16 | - <result property="loginTime" column="login_time" /> | |
| 17 | - </resultMap> | |
| 18 | - | |
| 19 | - <insert id="insertLogininfor" parameterType="SysLogininfor"> | |
| 20 | - insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) | |
| 21 | - values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate()) | |
| 22 | - </insert> | |
| 23 | - | |
| 24 | - <select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult"> | |
| 25 | - select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor | |
| 26 | - <where> | |
| 27 | - <if test="ipaddr != null and ipaddr != ''"> | |
| 28 | - AND ipaddr like concat('%', #{ipaddr}, '%') | |
| 29 | - </if> | |
| 30 | - <if test="status != null and status != ''"> | |
| 31 | - AND status = #{status} | |
| 32 | - </if> | |
| 33 | - <if test="userName != null and userName != ''"> | |
| 34 | - AND user_name like concat('%', #{userName}, '%') | |
| 35 | - </if> | |
| 36 | - <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> | |
| 37 | - and date_format(login_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') | |
| 38 | - </if> | |
| 39 | - <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> | |
| 40 | - and date_format(login_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') | |
| 41 | - </if> | |
| 42 | - </where> | |
| 43 | - order by info_id desc | |
| 44 | - </select> | |
| 45 | - | |
| 46 | - <delete id="deleteLogininforByIds" parameterType="Long"> | |
| 47 | - delete from sys_logininfor where info_id in | |
| 48 | - <foreach collection="array" item="infoId" open="(" separator="," close=")"> | |
| 49 | - #{infoId} | |
| 50 | - </foreach> | |
| 51 | - </delete> | |
| 52 | - | |
| 53 | - <update id="cleanLogininfor"> | |
| 54 | - truncate table sys_logininfor | |
| 55 | - </update> | |
| 56 | - | |
| 57 | -</mapper> | |
| 58 | 0 | \ No newline at end of file |
ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | |
| 2 | -<!DOCTYPE mapper | |
| 3 | -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | -<mapper namespace="com.ruoyi.system.mapper.SysOperLogMapper"> | |
| 6 | - | |
| 7 | - <select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult"> | |
| 8 | - <include refid="selectOperLogVo"/> | |
| 9 | - <where> | |
| 10 | - <if test="title != null and title != ''"> | |
| 11 | - AND title like concat('%', #{title}, '%') | |
| 12 | - </if> | |
| 13 | - <if test="businessType != null and businessType != ''"> | |
| 14 | - AND business_type = #{businessType} | |
| 15 | - </if> | |
| 16 | - <if test="businessTypes != null and businessTypes.length > 0"> | |
| 17 | - AND business_type in | |
| 18 | - <foreach collection="businessTypes" item="businessType" open="(" separator="," close=")"> | |
| 19 | - #{businessType} | |
| 20 | - </foreach> | |
| 21 | - </if> | |
| 22 | - <if test="status != null"> | |
| 23 | - AND status = #{status} | |
| 24 | - </if> | |
| 25 | - <if test="operName != null and operName != ''"> | |
| 26 | - AND oper_name like concat('%', #{operName}, '%') | |
| 27 | - </if> | |
| 28 | - <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> | |
| 29 | - and date_format(oper_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') | |
| 30 | - </if> | |
| 31 | - <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> | |
| 32 | - and date_format(oper_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') | |
| 33 | - </if> | |
| 34 | - </where> | |
| 35 | - order by oper_id desc | |
| 36 | - </select> | |
| 37 | - | |
| 38 | - | |
| 39 | -</mapper> |
src/main/java/cn/iocoder/dashboard/framework/excel/core/annotations/DictFormat.java
| 1 | 1 | package cn.iocoder.dashboard.framework.excel.core.annotations; |
| 2 | 2 | |
| 3 | -import cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum; | |
| 3 | +import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; | |
| 4 | 4 | |
| 5 | 5 | import java.lang.annotation.*; |
| 6 | 6 | |
| ... | ... | @@ -14,6 +14,6 @@ import java.lang.annotation.*; |
| 14 | 14 | @Inherited |
| 15 | 15 | public @interface DictFormat { |
| 16 | 16 | |
| 17 | - DictTypeEnum value(); | |
| 17 | + SysDictTypeEnum value(); | |
| 18 | 18 | |
| 19 | 19 | } | ... | ... |
src/main/java/cn/iocoder/dashboard/framework/excel/core/convert/DictConvert.java
| ... | ... | @@ -5,7 +5,7 @@ import cn.hutool.core.convert.Convert; |
| 5 | 5 | import cn.iocoder.dashboard.framework.dict.core.util.DictUtils; |
| 6 | 6 | import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; |
| 7 | 7 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; |
| 8 | -import cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum; | |
| 8 | +import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; | |
| 9 | 9 | import com.alibaba.excel.converters.Converter; |
| 10 | 10 | import com.alibaba.excel.enums.CellDataTypeEnum; |
| 11 | 11 | import com.alibaba.excel.metadata.CellData; |
| ... | ... | @@ -30,7 +30,7 @@ public class DictConvert implements Converter<Object> { |
| 30 | 30 | public Object convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, |
| 31 | 31 | GlobalConfiguration globalConfiguration) { |
| 32 | 32 | // 使用字典解析 |
| 33 | - DictTypeEnum type = getType(contentProperty); | |
| 33 | + SysDictTypeEnum type = getType(contentProperty); | |
| 34 | 34 | String label = cellData.getStringValue(); |
| 35 | 35 | SysDictDataDO dictData = DictUtils.parseDictDataFromCache(type.getValue(), label); |
| 36 | 36 | if (dictData == null) { |
| ... | ... | @@ -46,7 +46,7 @@ public class DictConvert implements Converter<Object> { |
| 46 | 46 | public CellData<String> convertToExcelData(Object object, ExcelContentProperty contentProperty, |
| 47 | 47 | GlobalConfiguration globalConfiguration) { |
| 48 | 48 | // 使用字典格式化 |
| 49 | - DictTypeEnum type = getType(contentProperty); | |
| 49 | + SysDictTypeEnum type = getType(contentProperty); | |
| 50 | 50 | String value = String.valueOf(object); |
| 51 | 51 | SysDictDataDO dictData = DictUtils.getDictDataFromCache(type.getValue(), value); |
| 52 | 52 | if (dictData == null) { |
| ... | ... | @@ -57,7 +57,7 @@ public class DictConvert implements Converter<Object> { |
| 57 | 57 | return new CellData<>(dictData.getLabel()); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - private static DictTypeEnum getType(ExcelContentProperty contentProperty) { | |
| 60 | + private static SysDictTypeEnum getType(ExcelContentProperty contentProperty) { | |
| 61 | 61 | return contentProperty.getField().getAnnotation(DictFormat.class).value(); |
| 62 | 62 | } |
| 63 | 63 | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/config/SysConfigController.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.config; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.Api; | |
| 4 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 5 | +import org.springframework.web.bind.annotation.RestController; | |
| 6 | + | |
| 7 | +@Api(tags = "参数配置") | |
| 8 | +@RestController | |
| 9 | +@RequestMapping("/system/config") | |
| 10 | +public class SysConfigController { | |
| 11 | + | |
| 12 | +// private SpringValueRegistry | |
| 13 | +// | |
| 14 | +// @Value("demo.test") | |
| 15 | +// private String demo; | |
| 16 | +// | |
| 17 | +// @GetMapping("/demo") | |
| 18 | +// public String demo() { | |
| 19 | +// return demo; | |
| 20 | +// } | |
| 21 | +// | |
| 22 | +// @PostMapping("/demo") | |
| 23 | +// public void setDemo() { | |
| 24 | +// | |
| 25 | +// } | |
| 26 | + | |
| 27 | +} | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/config/vo/SysConfigBaseVO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.config.vo; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModelProperty; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import javax.validation.constraints.NotBlank; | |
| 7 | +import javax.validation.constraints.NotEmpty; | |
| 8 | +import javax.validation.constraints.Size; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 参数配置 Base VO,提供给添加、修改、详细的子 VO 使用 | |
| 12 | + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | |
| 13 | + */ | |
| 14 | +@Data | |
| 15 | +public class SysConfigBaseVO { | |
| 16 | + | |
| 17 | + @ApiModelProperty(value = "参数分组", required = true, example = "biz") | |
| 18 | + @NotEmpty(message = "参数分组不能为空") | |
| 19 | + @Size(max = 100, message = "参数名称不能超过50个字符") | |
| 20 | + private String group; | |
| 21 | + | |
| 22 | + @ApiModelProperty(value = "参数名称", required = true, example = "数据库名") | |
| 23 | + @NotBlank(message = "参数名称不能为空") | |
| 24 | + @Size(max = 100, message = "参数名称不能超过100个字符") | |
| 25 | + private String name; | |
| 26 | + | |
| 27 | + @ApiModelProperty(value = "参数键值", required = true, example = "1024") | |
| 28 | + @NotBlank(message = "参数键值不能为空") | |
| 29 | + @Size(max = 500, message = "参数键值长度不能超过500个字符") | |
| 30 | + private String value; | |
| 31 | + | |
| 32 | + @ApiModelProperty(value = "参数类型", required = true, example = "1", notes = "参见 SysConfigTypeEnum 枚举") | |
| 33 | + private String type; | |
| 34 | + | |
| 35 | + @ApiModelProperty(value = "是否敏感", required = true, example = "true") | |
| 36 | + @NotBlank(message = "是否敏感不能为空") | |
| 37 | + private Boolean sensitive; | |
| 38 | + | |
| 39 | + @ApiModelProperty(value = "备注", example = "备注一下很帅气!") | |
| 40 | + private String remark; | |
| 41 | + | |
| 42 | +} | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/config/vo/SysConfigCreateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.config.vo; | |
| 2 | + | |
| 3 | +import cn.iocoder.dashboard.modules.system.controller.dept.vo.dept.SysDeptBaseVO; | |
| 4 | +import io.swagger.annotations.ApiModel; | |
| 5 | +import io.swagger.annotations.ApiModelProperty; | |
| 6 | +import lombok.Data; | |
| 7 | +import lombok.EqualsAndHashCode; | |
| 8 | + | |
| 9 | +import javax.validation.constraints.NotBlank; | |
| 10 | +import javax.validation.constraints.Size; | |
| 11 | + | |
| 12 | +@ApiModel("参数配置创建 Request VO") | |
| 13 | +@Data | |
| 14 | +@EqualsAndHashCode(callSuper = true) | |
| 15 | +public class SysConfigCreateReqVO extends SysDeptBaseVO { | |
| 16 | + | |
| 17 | + @ApiModelProperty(value = "参数键名", required = true, example = "yunai.db.username") | |
| 18 | + @NotBlank(message = "参数键名长度不能为空") | |
| 19 | + @Size(max = 100, message = "参数键名长度不能超过100个字符") | |
| 20 | + private String key; | |
| 21 | + | |
| 22 | +} | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/config/vo/SysConfigExcelVO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.config.vo; | |
| 2 | + | |
| 3 | +import com.alibaba.excel.annotation.ExcelProperty; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import java.util.Date; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * 参数配置 Excel 导出响应 VO | |
| 10 | + */ | |
| 11 | +@Data | |
| 12 | +public class SysConfigExcelVO { | |
| 13 | + | |
| 14 | + @ExcelProperty("参数配置序号") | |
| 15 | + private Long id; | |
| 16 | + | |
| 17 | + @ExcelProperty("参数键名") | |
| 18 | + private String key; | |
| 19 | + | |
| 20 | + @ExcelProperty("参数分组") | |
| 21 | + private String group; | |
| 22 | + | |
| 23 | + @ExcelProperty("参数名称") | |
| 24 | + private String name; | |
| 25 | + | |
| 26 | + @ExcelProperty("参数键值") | |
| 27 | + private String value; | |
| 28 | + | |
| 29 | + @ExcelProperty("参数类型") | |
| 30 | + private String type; | |
| 31 | + | |
| 32 | + @ExcelProperty("是否敏感") | |
| 33 | + private Boolean sensitive; | |
| 34 | + | |
| 35 | + @ExcelProperty("备注") | |
| 36 | + private String remark; | |
| 37 | + | |
| 38 | + @ExcelProperty("创建时间") | |
| 39 | + private Date createTime; | |
| 40 | + | |
| 41 | +} | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/config/vo/SysConfigRespVO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.config.vo; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | +import lombok.EqualsAndHashCode; | |
| 7 | + | |
| 8 | +import javax.validation.constraints.NotBlank; | |
| 9 | +import javax.validation.constraints.Size; | |
| 10 | +import java.util.Date; | |
| 11 | + | |
| 12 | +@ApiModel("参数配置信息 Response VO") | |
| 13 | +@Data | |
| 14 | +@EqualsAndHashCode(callSuper = true) | |
| 15 | +public class SysConfigRespVO extends SysConfigBaseVO { | |
| 16 | + | |
| 17 | + @ApiModelProperty(value = "参数配置序号", required = true, example = "1024") | |
| 18 | + private Long id; | |
| 19 | + | |
| 20 | + @ApiModelProperty(value = "参数键名", required = true, example = "yunai.db.username") | |
| 21 | + @NotBlank(message = "参数键名长度不能为空") | |
| 22 | + @Size(max = 100, message = "参数键名长度不能超过100个字符") | |
| 23 | + private String key; | |
| 24 | + | |
| 25 | + @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") | |
| 26 | + private Date createTime; | |
| 27 | + | |
| 28 | +} | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/config/vo/SysConfigUpdateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.config.vo; | |
| 2 | + | |
| 3 | +import cn.iocoder.dashboard.modules.system.controller.dept.vo.dept.SysDeptBaseVO; | |
| 4 | +import io.swagger.annotations.ApiModel; | |
| 5 | +import io.swagger.annotations.ApiModelProperty; | |
| 6 | +import lombok.Data; | |
| 7 | +import lombok.EqualsAndHashCode; | |
| 8 | + | |
| 9 | +import javax.validation.constraints.NotNull; | |
| 10 | + | |
| 11 | +@ApiModel("参数配置创建 Request VO") | |
| 12 | +@Data | |
| 13 | +@EqualsAndHashCode(callSuper = true) | |
| 14 | +public class SysConfigUpdateReqVO extends SysDeptBaseVO { | |
| 15 | + | |
| 16 | + @ApiModelProperty(value = "参数配置序号", required = true, example = "1024") | |
| 17 | + @NotNull(message = "参数配置编号不能为空") | |
| 18 | + private Long id; | |
| 19 | + | |
| 20 | +} | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostExcelVO.java
| 1 | 1 | package cn.iocoder.dashboard.modules.system.controller.dept.vo.post; |
| 2 | 2 | |
| 3 | +import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; | |
| 4 | +import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; | |
| 3 | 5 | import com.alibaba.excel.annotation.ExcelProperty; |
| 4 | 6 | import lombok.Data; |
| 5 | 7 | |
| 8 | +import static cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum.SYS_COMMON_STATUS; | |
| 9 | + | |
| 6 | 10 | /** |
| 7 | 11 | * 岗位 Excel 导出响应 VO |
| 8 | 12 | */ |
| ... | ... | @@ -21,9 +25,8 @@ public class SysPostExcelVO { |
| 21 | 25 | @ExcelProperty("岗位排序") |
| 22 | 26 | private String sort; |
| 23 | 27 | |
| 24 | -// @ExcelProperty(value = "状态", converter = DictConvert.class) | |
| 25 | -// @DictFormat(SYS_COMMON_STATUS) | |
| 26 | - @ExcelProperty(value = "状态") | |
| 28 | + @ExcelProperty(value = "状态", converter = DictConvert.class) | |
| 29 | + @DictFormat(SYS_COMMON_STATUS) | |
| 27 | 30 | private String status; |
| 28 | 31 | |
| 29 | 32 | } | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/data/SysDictDataExcelVO.java
| ... | ... | @@ -5,7 +5,7 @@ import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; |
| 5 | 5 | import com.alibaba.excel.annotation.ExcelProperty; |
| 6 | 6 | import lombok.Data; |
| 7 | 7 | |
| 8 | -import static cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum.SYS_COMMON_STATUS; | |
| 8 | +import static cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum.SYS_COMMON_STATUS; | |
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * 字典数据 Excel 导出响应 VO | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeExcelVO.java
| ... | ... | @@ -5,7 +5,7 @@ import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; |
| 5 | 5 | import com.alibaba.excel.annotation.ExcelProperty; |
| 6 | 6 | import lombok.Data; |
| 7 | 7 | |
| 8 | -import static cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum.SYS_COMMON_STATUS; | |
| 8 | +import static cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum.SYS_COMMON_STATUS; | |
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * 字典类型 Excel 导出响应 VO | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/logger/SysLoginLogController.java
| ... | ... | @@ -2,6 +2,9 @@ package cn.iocoder.dashboard.modules.system.controller.logger; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.dashboard.common.pojo.CommonResult; |
| 4 | 4 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 5 | +import cn.iocoder.dashboard.framework.excel.core.util.ExcelUtils; | |
| 6 | +import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogExcelVO; | |
| 7 | +import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogExportReqVO; | |
| 5 | 8 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO; |
| 6 | 9 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogRespVO; |
| 7 | 10 | import cn.iocoder.dashboard.modules.system.convert.logger.SysLoginLogConvert; |
| ... | ... | @@ -15,6 +18,9 @@ import org.springframework.web.bind.annotation.RequestMapping; |
| 15 | 18 | import org.springframework.web.bind.annotation.RestController; |
| 16 | 19 | |
| 17 | 20 | import javax.annotation.Resource; |
| 21 | +import javax.servlet.http.HttpServletResponse; | |
| 22 | +import java.io.IOException; | |
| 23 | +import java.util.List; | |
| 18 | 24 | |
| 19 | 25 | @Api(tags = "登陆日志 API") |
| 20 | 26 | @RestController |
| ... | ... | @@ -32,13 +38,17 @@ public class SysLoginLogController { |
| 32 | 38 | return CommonResult.success(SysLoginLogConvert.INSTANCE.convertPage(page)); |
| 33 | 39 | } |
| 34 | 40 | |
| 35 | -// @GetMapping("/export") | |
| 36 | -//// @Log(title = "登录日志", businessType = BusinessType.EXPORT) | |
| 37 | -//// @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") | |
| 38 | -// public void exportLoginLog(SysLogininfor logininfor) { | |
| 39 | -// List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); | |
| 40 | -// ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class); | |
| 41 | -// return util.exportExcel(list, "登录日志"); | |
| 42 | -// } | |
| 41 | + @ApiOperation("导出登陆日志 Excel") | |
| 42 | + @GetMapping("/export") | |
| 43 | +// @Log(title = "登录日志", businessType = BusinessType.EXPORT) | |
| 44 | +// @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") | |
| 45 | + public void exportLoginLog(HttpServletResponse response, @Validated SysLoginLogExportReqVO reqVO) throws IOException { | |
| 46 | + List<SysLoginLogDO> list = loginLogService.getLoginLogList(reqVO); | |
| 47 | + // 拼接数据 | |
| 48 | + List<SysLoginLogExcelVO> excelDataList = SysLoginLogConvert.INSTANCE.convertList(list); | |
| 49 | + // 输出 | |
| 50 | + ExcelUtils.write(response, "登陆日志.xls", "数据列表", | |
| 51 | + SysLoginLogExcelVO.class, excelDataList); | |
| 52 | + } | |
| 43 | 53 | |
| 44 | 54 | } | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/logger/vo/loginlog/SysLoginLogExcelVO.java
| ... | ... | @@ -2,7 +2,7 @@ package cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; |
| 5 | -import cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum; | |
| 5 | +import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; | |
| 6 | 6 | import com.alibaba.excel.annotation.ExcelProperty; |
| 7 | 7 | import lombok.Data; |
| 8 | 8 | |
| ... | ... | @@ -17,14 +17,11 @@ public class SysLoginLogExcelVO { |
| 17 | 17 | @ExcelProperty("日志主键") |
| 18 | 18 | private Long id; |
| 19 | 19 | |
| 20 | - @ExcelProperty("用户编号") | |
| 21 | - private Long userId; | |
| 22 | - | |
| 23 | 20 | @ExcelProperty("用户账号") |
| 24 | 21 | private String username; |
| 25 | 22 | |
| 26 | 23 | @ExcelProperty(value = "登陆结果", converter = DictConvert.class) |
| 27 | - @DictFormat(DictTypeEnum.SYS_LOGIN_RESULT) | |
| 24 | + @DictFormat(SysDictTypeEnum.SYS_LOGIN_RESULT) | |
| 28 | 25 | private Integer result; |
| 29 | 26 | |
| 30 | 27 | @ExcelProperty("登陆 IP") | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/logger/vo/loginlog/SysLoginLogExportReqVO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 7 | + | |
| 8 | +import java.util.Date; | |
| 9 | + | |
| 10 | +import static cn.iocoder.dashboard.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 11 | + | |
| 12 | +@ApiModel("登陆日志分页列表 Request VO") | |
| 13 | +@Data | |
| 14 | +public class SysLoginLogExportReqVO { | |
| 15 | + | |
| 16 | + @ApiModelProperty(value = "用户 IP", example = "127.0.0.1", notes = "模拟匹配") | |
| 17 | + private String userIp; | |
| 18 | + | |
| 19 | + @ApiModelProperty(value = "用户账号", example = "芋道", notes = "模拟匹配") | |
| 20 | + private String username; | |
| 21 | + | |
| 22 | + @ApiModelProperty(value = "操作状态", example = "true") | |
| 23 | + private Boolean status; | |
| 24 | + | |
| 25 | + @ApiModelProperty(value = "开始时间", example = "2020-10-24") | |
| 26 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 27 | + private Date beginTime; | |
| 28 | + | |
| 29 | + @ApiModelProperty(value = "结束时间", example = "2020-10-24") | |
| 30 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 31 | + private Date endTime; | |
| 32 | + | |
| 33 | +} | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/logger/vo/operatelog/SysOperateLogExcelVO.java
| ... | ... | @@ -2,7 +2,7 @@ package cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; |
| 5 | -import cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum; | |
| 5 | +import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; | |
| 6 | 6 | import com.alibaba.excel.annotation.ExcelProperty; |
| 7 | 7 | import lombok.Data; |
| 8 | 8 | |
| ... | ... | @@ -24,7 +24,7 @@ public class SysOperateLogExcelVO { |
| 24 | 24 | private String name; |
| 25 | 25 | |
| 26 | 26 | @ExcelProperty(value = "操作类型", converter = DictConvert.class) |
| 27 | - @DictFormat(DictTypeEnum.SYS_OPERATE_TYPE) | |
| 27 | + @DictFormat(SysDictTypeEnum.SYS_OPERATE_TYPE) | |
| 28 | 28 | private String type; |
| 29 | 29 | |
| 30 | 30 | @ExcelProperty("操作人") | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/logger/vo/operatelog/SysOperateLogPageReqVO.java
| ... | ... | @@ -4,7 +4,6 @@ import cn.iocoder.dashboard.common.pojo.PageParam; |
| 4 | 4 | import io.swagger.annotations.ApiModel; |
| 5 | 5 | import io.swagger.annotations.ApiModelProperty; |
| 6 | 6 | import lombok.Data; |
| 7 | -import lombok.EqualsAndHashCode; | |
| 8 | 7 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | 8 | |
| 10 | 9 | import java.util.Date; |
| ... | ... | @@ -13,7 +12,6 @@ import static cn.iocoder.dashboard.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOU |
| 13 | 12 | |
| 14 | 13 | @ApiModel("操作日志分页列表 Request VO") |
| 15 | 14 | @Data |
| 16 | -@EqualsAndHashCode(callSuper = true) | |
| 17 | 15 | public class SysOperateLogPageReqVO extends PageParam { |
| 18 | 16 | |
| 19 | 17 | @ApiModelProperty(value = "操作模块", example = "订单", notes = "模拟匹配") | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/permission/vo/role/SysRoleExcelVO.java
| ... | ... | @@ -2,7 +2,7 @@ package cn.iocoder.dashboard.modules.system.controller.permission.vo.role; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; |
| 5 | -import cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum; | |
| 5 | +import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; | |
| 6 | 6 | import com.alibaba.excel.annotation.ExcelProperty; |
| 7 | 7 | import lombok.Data; |
| 8 | 8 | |
| ... | ... | @@ -28,7 +28,7 @@ public class SysRoleExcelVO { |
| 28 | 28 | private Integer dataScope; |
| 29 | 29 | |
| 30 | 30 | @ExcelProperty(value = "角色状态", converter = DictConvert.class) |
| 31 | - @DictFormat(DictTypeEnum.SYS_COMMON_STATUS) | |
| 31 | + @DictFormat(SysDictTypeEnum.SYS_COMMON_STATUS) | |
| 32 | 32 | private String status; |
| 33 | 33 | |
| 34 | 34 | } | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/user/vo/user/SysUserExcelVO.java
| ... | ... | @@ -7,8 +7,8 @@ import lombok.Data; |
| 7 | 7 | |
| 8 | 8 | import java.util.Date; |
| 9 | 9 | |
| 10 | -import static cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum.SYS_COMMON_STATUS; | |
| 11 | -import static cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum.SYS_USER_SEX; | |
| 10 | +import static cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum.SYS_COMMON_STATUS; | |
| 11 | +import static cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum.SYS_USER_SEX; | |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * 用户 Excel 导出 VO | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/controller/user/vo/user/SysUserImportExcelVO.java
| ... | ... | @@ -2,7 +2,7 @@ package cn.iocoder.dashboard.modules.system.controller.user.vo.user; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; |
| 5 | -import cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum; | |
| 5 | +import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; | |
| 6 | 6 | import com.alibaba.excel.annotation.ExcelProperty; |
| 7 | 7 | import lombok.AllArgsConstructor; |
| 8 | 8 | import lombok.Builder; |
| ... | ... | @@ -34,11 +34,11 @@ public class SysUserImportExcelVO { |
| 34 | 34 | private String mobile; |
| 35 | 35 | |
| 36 | 36 | @ExcelProperty(value = "用户性别", converter = DictConvert.class) |
| 37 | - @DictFormat(DictTypeEnum.SYS_USER_SEX) | |
| 37 | + @DictFormat(SysDictTypeEnum.SYS_USER_SEX) | |
| 38 | 38 | private Integer sex; |
| 39 | 39 | |
| 40 | 40 | @ExcelProperty(value = "账号状态", converter = DictConvert.class) |
| 41 | - @DictFormat(DictTypeEnum.SYS_COMMON_STATUS) | |
| 41 | + @DictFormat(SysDictTypeEnum.SYS_COMMON_STATUS) | |
| 42 | 42 | private Integer status; |
| 43 | 43 | |
| 44 | 44 | } | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/convert/logger/SysLoginLogConvert.java
| ... | ... | @@ -2,11 +2,14 @@ package cn.iocoder.dashboard.modules.system.convert.logger; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO; |
| 5 | +import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogExcelVO; | |
| 5 | 6 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogRespVO; |
| 6 | 7 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO; |
| 7 | 8 | import org.mapstruct.Mapper; |
| 8 | 9 | import org.mapstruct.factory.Mappers; |
| 9 | 10 | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 10 | 13 | @Mapper |
| 11 | 14 | public interface SysLoginLogConvert { |
| 12 | 15 | |
| ... | ... | @@ -16,4 +19,6 @@ public interface SysLoginLogConvert { |
| 16 | 19 | |
| 17 | 20 | PageResult<SysLoginLogRespVO> convertPage(PageResult<SysLoginLogDO> page); |
| 18 | 21 | |
| 22 | + List<SysLoginLogExcelVO> convertList(List<SysLoginLogDO> list); | |
| 23 | + | |
| 19 | 24 | } | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dao/logger/SysLoginLogMapper.java
| ... | ... | @@ -3,11 +3,14 @@ package cn.iocoder.dashboard.modules.system.dal.mysql.dao.logger; |
| 3 | 3 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.dashboard.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | 5 | import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX; |
| 6 | +import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogExportReqVO; | |
| 6 | 7 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO; |
| 7 | 8 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO; |
| 8 | 9 | import cn.iocoder.dashboard.modules.system.enums.logger.SysLoginResultEnum; |
| 9 | 10 | import org.apache.ibatis.annotations.Mapper; |
| 10 | 11 | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 11 | 14 | @Mapper |
| 12 | 15 | public interface SysLoginLogMapper extends BaseMapperX<SysLoginLogDO> { |
| 13 | 16 | |
| ... | ... | @@ -25,4 +28,18 @@ public interface SysLoginLogMapper extends BaseMapperX<SysLoginLogDO> { |
| 25 | 28 | return selectPage(reqVO, query); |
| 26 | 29 | } |
| 27 | 30 | |
| 31 | + default List<SysLoginLogDO> selectList(SysLoginLogExportReqVO reqVO) { | |
| 32 | + QueryWrapperX<SysLoginLogDO> query = new QueryWrapperX<SysLoginLogDO>() | |
| 33 | + .likeIfPresent("user_ip", reqVO.getUserIp()) | |
| 34 | + .likeIfPresent("username", reqVO.getUsername()) | |
| 35 | + .betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime()); | |
| 36 | + if (Boolean.TRUE.equals(reqVO.getStatus())) { | |
| 37 | + query.eq("result", SysLoginResultEnum.SUCCESS.getResult()); | |
| 38 | + } else if (Boolean.FALSE.equals(reqVO.getStatus())) { | |
| 39 | + query.gt("result", SysLoginResultEnum.SUCCESS.getResult()); | |
| 40 | + } | |
| 41 | + query.orderByDesc("id"); // 降序 | |
| 42 | + return selectList(query); | |
| 43 | + } | |
| 44 | + | |
| 28 | 45 | } | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dataobject/config/SysConfigDO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.config; | |
| 2 | + | |
| 3 | +import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO; | |
| 4 | +import cn.iocoder.dashboard.modules.system.enums.config.SysConfigTypeEnum; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 参数配置表 | |
| 9 | + * | |
| 10 | + * @author ruoyi | |
| 11 | + */ | |
| 12 | +@TableName("sys_config") | |
| 13 | +public class SysConfigDO extends BaseDO { | |
| 14 | + | |
| 15 | + /** | |
| 16 | + * 参数主键 | |
| 17 | + */ | |
| 18 | + private Long id; | |
| 19 | + /** | |
| 20 | + * 参数分组 | |
| 21 | + */ | |
| 22 | + private String group; | |
| 23 | + /** | |
| 24 | + * 参数名称 | |
| 25 | + */ | |
| 26 | + private String name; | |
| 27 | + /** | |
| 28 | + * 参数键名 | |
| 29 | + */ | |
| 30 | + private String key; | |
| 31 | + /** | |
| 32 | + * 参数键值 | |
| 33 | + */ | |
| 34 | + private String value; | |
| 35 | + /** | |
| 36 | + * 参数类型 | |
| 37 | + * | |
| 38 | + * 枚举 {@link SysConfigTypeEnum} | |
| 39 | + */ | |
| 40 | + private String type; | |
| 41 | + /** | |
| 42 | + * 是否敏感 | |
| 43 | + * | |
| 44 | + * 对于敏感配置,需要管理权限才能查看 | |
| 45 | + */ | |
| 46 | + private Boolean sensitive; | |
| 47 | + /** | |
| 48 | + * 备注 | |
| 49 | + */ | |
| 50 | + private String remark; | |
| 51 | + | |
| 52 | +} | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dataobject/permission/SysRoleDO.java
| ... | ... | @@ -4,7 +4,7 @@ import cn.iocoder.dashboard.common.enums.CommonStatusEnum; |
| 4 | 4 | import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO; |
| 5 | 5 | import cn.iocoder.dashboard.framework.security.core.enums.DataScopeEnum; |
| 6 | 6 | import cn.iocoder.dashboard.modules.system.enums.permission.RoleCodeEnum; |
| 7 | -import cn.iocoder.dashboard.modules.system.enums.permission.RoleTypeEnum; | |
| 7 | +import cn.iocoder.dashboard.modules.system.enums.permission.SysRoleTypeEnum; | |
| 8 | 8 | import com.baomidou.mybatisplus.annotation.TableField; |
| 9 | 9 | import com.baomidou.mybatisplus.annotation.TableId; |
| 10 | 10 | import com.baomidou.mybatisplus.annotation.TableName; |
| ... | ... | @@ -52,7 +52,7 @@ public class SysRoleDO extends BaseDO { |
| 52 | 52 | /** |
| 53 | 53 | * 角色类型 |
| 54 | 54 | * |
| 55 | - * 枚举 {@link RoleTypeEnum} | |
| 55 | + * 枚举 {@link SysRoleTypeEnum} | |
| 56 | 56 | */ |
| 57 | 57 | private Integer type; |
| 58 | 58 | /** | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/enums/config/SysConfigTypeEnum.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.enums.config; | |
| 2 | + | |
| 3 | +import lombok.AllArgsConstructor; | |
| 4 | +import lombok.Getter; | |
| 5 | + | |
| 6 | +@Getter | |
| 7 | +@AllArgsConstructor | |
| 8 | +public enum SysConfigTypeEnum { | |
| 9 | + | |
| 10 | + /** | |
| 11 | + * 系统配置 | |
| 12 | + */ | |
| 13 | + SYSTEM(1), | |
| 14 | + /** | |
| 15 | + * 自定义配置 | |
| 16 | + */ | |
| 17 | + CUSTOM(2); | |
| 18 | + | |
| 19 | + private final Integer type; | |
| 20 | + | |
| 21 | +} | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/enums/dict/DictTypeEnum.java renamed to src/main/java/cn/iocoder/dashboard/modules/system/enums/dict/SysDictTypeEnum.java
src/main/java/cn/iocoder/dashboard/modules/system/enums/permission/RoleTypeEnum.java renamed to src/main/java/cn/iocoder/dashboard/modules/system/enums/permission/SysRoleTypeEnum.java
src/main/java/cn/iocoder/dashboard/modules/system/service/logger/SysLoginLogService.java
| ... | ... | @@ -2,9 +2,12 @@ package cn.iocoder.dashboard.modules.system.service.logger; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO; |
| 5 | +import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogExportReqVO; | |
| 5 | 6 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO; |
| 6 | 7 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO; |
| 7 | 8 | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 8 | 11 | /** |
| 9 | 12 | * 登陆日志 Service 接口 |
| 10 | 13 | */ |
| ... | ... | @@ -25,4 +28,12 @@ public interface SysLoginLogService { |
| 25 | 28 | */ |
| 26 | 29 | PageResult<SysLoginLogDO> getLoginLogPage(SysLoginLogPageReqVO reqVO); |
| 27 | 30 | |
| 31 | + /** | |
| 32 | + * 获得登陆日志列表 | |
| 33 | + * | |
| 34 | + * @param reqVO 列表条件 | |
| 35 | + * @return 登陆日志列表 | |
| 36 | + */ | |
| 37 | + List<SysLoginLogDO> getLoginLogList(SysLoginLogExportReqVO reqVO); | |
| 38 | + | |
| 28 | 39 | } | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/service/logger/impl/SysLoginLogServiceImpl.java
| ... | ... | @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import cn.hutool.core.util.StrUtil; |
| 5 | 5 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 6 | 6 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO; |
| 7 | +import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogExportReqVO; | |
| 7 | 8 | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO; |
| 8 | 9 | import cn.iocoder.dashboard.modules.system.convert.logger.SysLoginLogConvert; |
| 9 | 10 | import cn.iocoder.dashboard.modules.system.dal.mysql.dao.logger.SysLoginLogMapper; |
| ... | ... | @@ -15,6 +16,7 @@ import org.springframework.stereotype.Service; |
| 15 | 16 | |
| 16 | 17 | import javax.annotation.Resource; |
| 17 | 18 | import java.util.Collection; |
| 19 | +import java.util.List; | |
| 18 | 20 | |
| 19 | 21 | import static cn.iocoder.dashboard.util.collection.CollectionUtils.convertSet; |
| 20 | 22 | |
| ... | ... | @@ -41,4 +43,9 @@ public class SysLoginLogServiceImpl implements SysLoginLogService { |
| 41 | 43 | return loginLogMapper.selectPage(reqVO); |
| 42 | 44 | } |
| 43 | 45 | |
| 46 | + @Override | |
| 47 | + public List<SysLoginLogDO> getLoginLogList(SysLoginLogExportReqVO reqVO) { | |
| 48 | + return loginLogMapper.selectList(reqVO); | |
| 49 | + } | |
| 50 | + | |
| 44 | 51 | } | ... | ... |
src/main/java/cn/iocoder/dashboard/modules/system/service/permission/impl/SysRoleServiceImpl.java
| ... | ... | @@ -12,7 +12,7 @@ import cn.iocoder.dashboard.modules.system.convert.permission.SysRoleConvert; |
| 12 | 12 | import cn.iocoder.dashboard.modules.system.dal.mysql.dao.permission.SysRoleMapper; |
| 13 | 13 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysRoleDO; |
| 14 | 14 | import cn.iocoder.dashboard.modules.system.enums.permission.RoleCodeEnum; |
| 15 | -import cn.iocoder.dashboard.modules.system.enums.permission.RoleTypeEnum; | |
| 15 | +import cn.iocoder.dashboard.modules.system.enums.permission.SysRoleTypeEnum; | |
| 16 | 16 | import cn.iocoder.dashboard.modules.system.service.permission.SysPermissionService; |
| 17 | 17 | import cn.iocoder.dashboard.modules.system.service.permission.SysRoleService; |
| 18 | 18 | import com.baomidou.mybatisplus.core.metadata.IPage; |
| ... | ... | @@ -101,7 +101,7 @@ public class SysRoleServiceImpl implements SysRoleService { |
| 101 | 101 | checkDuplicateRole(reqVO.getName(), reqVO.getCode(), null); |
| 102 | 102 | // 插入到数据库 |
| 103 | 103 | SysRoleDO role = SysRoleConvert.INSTANCE.convert(reqVO); |
| 104 | - role.setType(RoleTypeEnum.CUSTOM.getType()); | |
| 104 | + role.setType(SysRoleTypeEnum.CUSTOM.getType()); | |
| 105 | 105 | role.setStatus(CommonStatusEnum.ENABLE.getStatus()); |
| 106 | 106 | roleMapper.insert(role); |
| 107 | 107 | // 返回 |
| ... | ... | @@ -207,7 +207,7 @@ public class SysRoleServiceImpl implements SysRoleService { |
| 207 | 207 | throw ServiceExceptionUtil.exception(ROLE_NOT_EXISTS); |
| 208 | 208 | } |
| 209 | 209 | // 内置角色,不允许删除 |
| 210 | - if (RoleTypeEnum.SYSTEM.getType().equals(roleDO.getType())) { | |
| 210 | + if (SysRoleTypeEnum.SYSTEM.getType().equals(roleDO.getType())) { | |
| 211 | 211 | throw ServiceExceptionUtil.exception(ROLE_CAN_NOT_UPDATE_SYSTEM_TYPE_ROLE); |
| 212 | 212 | } |
| 213 | 213 | } | ... | ... |