完成参数配置
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package cn.iocoder.dashboard.modules.system.dal.mysql.dao.config;
|
||||
|
||||
import cn.iocoder.dashboard.common.pojo.PageResult;
|
||||
import cn.iocoder.dashboard.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX;
|
||||
import cn.iocoder.dashboard.modules.system.controller.config.vo.SysConfigExportReqVO;
|
||||
import cn.iocoder.dashboard.modules.system.controller.config.vo.SysConfigPageReqVO;
|
||||
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.config.SysConfigDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SysConfigMapper extends BaseMapperX<SysConfigDO> {
|
||||
|
||||
default PageResult<SysConfigDO> selectPage(SysConfigPageReqVO reqVO) {
|
||||
return selectPage(reqVO,
|
||||
new QueryWrapperX<SysConfigDO>().likeIfPresent("name", reqVO.getName())
|
||||
.likeIfPresent("`key`", reqVO.getKey())
|
||||
.eqIfPresent("`type`", reqVO.getType())
|
||||
.betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime()));
|
||||
}
|
||||
|
||||
default SysConfigDO selectByKey(String key) {
|
||||
return selectOne(new QueryWrapper<SysConfigDO>().eq("`key`", key));
|
||||
}
|
||||
|
||||
default List<SysConfigDO> selectList(SysConfigExportReqVO reqVO) {
|
||||
return selectList(new QueryWrapperX<SysConfigDO>().likeIfPresent("name", reqVO.getName())
|
||||
.likeIfPresent("`key`", reqVO.getKey())
|
||||
.eqIfPresent("`type`", reqVO.getType())
|
||||
.betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,11 @@ package cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.config;
|
||||
|
||||
import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.dashboard.modules.system.enums.config.SysConfigTypeEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 参数配置表
|
||||
@@ -10,6 +14,9 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
* @author ruoyi
|
||||
*/
|
||||
@TableName("sys_config")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class SysConfigDO extends BaseDO {
|
||||
|
||||
/**
|
||||
@@ -19,6 +26,7 @@ public class SysConfigDO extends BaseDO {
|
||||
/**
|
||||
* 参数分组
|
||||
*/
|
||||
@TableField("`group`")
|
||||
private String group;
|
||||
/**
|
||||
* 参数名称
|
||||
@@ -27,6 +35,7 @@ public class SysConfigDO extends BaseDO {
|
||||
/**
|
||||
* 参数键名
|
||||
*/
|
||||
@TableField("`key`")
|
||||
private String key;
|
||||
/**
|
||||
* 参数键值
|
||||
@@ -37,12 +46,14 @@ public class SysConfigDO extends BaseDO {
|
||||
*
|
||||
* 枚举 {@link SysConfigTypeEnum}
|
||||
*/
|
||||
private String type;
|
||||
@TableField("`type`")
|
||||
private Integer type;
|
||||
/**
|
||||
* 是否敏感
|
||||
*
|
||||
* 对于敏感配置,需要管理权限才能查看
|
||||
*/
|
||||
@TableField("`sensitive`")
|
||||
private Boolean sensitive;
|
||||
/**
|
||||
* 备注
|
||||
|
||||
Reference in New Issue
Block a user