🎨 移动系统配置到sys模块下
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package com.hccake.ballcat.admin.modules.conf.controller;
|
||||
package com.hccake.ballcat.admin.modules.sys.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@@ -7,8 +7,8 @@ import com.hccake.ballcat.commom.log.operation.annotation.CreateOperationLogging
|
||||
import com.hccake.ballcat.commom.log.operation.annotation.DeleteOperationLogging;
|
||||
import com.hccake.ballcat.commom.log.operation.annotation.UpdateOperationLogging;
|
||||
import com.hccake.ballcat.common.core.result.R;
|
||||
import com.hccake.ballcat.common.modules.config.model.entity.BaseConfig;
|
||||
import com.hccake.ballcat.common.modules.config.service.BaseConfigService;
|
||||
import com.hccake.ballcat.admin.modules.sys.model.entity.SysConfig;
|
||||
import com.hccake.ballcat.admin.modules.sys.service.SysConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -24,24 +24,24 @@ import org.springframework.web.bind.annotation.*;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("config/baseconfig")
|
||||
@Api(value = "config/baseconfig", tags = "系统配置")
|
||||
public class BaseConfigController {
|
||||
private final BaseConfigService baseConfigService;
|
||||
@RequestMapping("sys/config")
|
||||
@Api(value = "sys/config", tags = "系统配置")
|
||||
public class SysConfigController {
|
||||
private final SysConfigService sysConfigService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param baseConfig 系统配置表
|
||||
* @param sysConfig 系统配置表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@per.hasPermission('config:baseconfig:read')")
|
||||
public R<IPage<BaseConfig>> getSysConfigPage(
|
||||
Page<BaseConfig> page, BaseConfig baseConfig) {
|
||||
return R.ok(baseConfigService.page(page, Wrappers.query(baseConfig)));
|
||||
@PreAuthorize("@per.hasPermission('sys:config:read')")
|
||||
public R<IPage<SysConfig>> getSysConfigPage(
|
||||
Page<SysConfig> page, SysConfig sysConfig) {
|
||||
return R.ok(sysConfigService.page(page, Wrappers.query(sysConfig)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,37 +52,37 @@ public class BaseConfigController {
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@per.hasPermission('config:baseconfig:read')")
|
||||
public R<BaseConfig> getById(@PathVariable("id") Integer id) {
|
||||
return R.ok(baseConfigService.getById(id));
|
||||
@PreAuthorize("@per.hasPermission('sys:config:read')")
|
||||
public R<SysConfig> getById(@PathVariable("id") Integer id) {
|
||||
return R.ok(sysConfigService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增系统配置表
|
||||
*
|
||||
* @param baseConfig 系统配置表
|
||||
* @param sysConfig 系统配置表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增系统配置表", notes = "新增系统配置表")
|
||||
@CreateOperationLogging(msg = "新增系统配置表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@per.hasPermission('config:baseconfig:add')")
|
||||
public R save(@RequestBody BaseConfig baseConfig) {
|
||||
return R.ok(baseConfigService.save(baseConfig));
|
||||
@PreAuthorize("@per.hasPermission('sys:config:add')")
|
||||
public R save(@RequestBody SysConfig sysConfig) {
|
||||
return R.ok(sysConfigService.save(sysConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改系统配置表
|
||||
*
|
||||
* @param baseConfig 系统配置表
|
||||
* @param sysConfig 系统配置表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改系统配置表", notes = "修改系统配置表")
|
||||
@UpdateOperationLogging(msg = "修改系统配置表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@per.hasPermission('config:baseconfig:edit')")
|
||||
public R updateById(@RequestBody BaseConfig baseConfig) {
|
||||
return R.ok(baseConfigService.updateById(baseConfig));
|
||||
@PreAuthorize("@per.hasPermission('sys:config:edit')")
|
||||
public R updateById(@RequestBody SysConfig sysConfig) {
|
||||
return R.ok(sysConfigService.updateById(sysConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,9 +94,9 @@ public class BaseConfigController {
|
||||
@ApiOperation(value = "通过id删除系统配置表", notes = "通过id删除系统配置表")
|
||||
@DeleteOperationLogging(msg = "通过id删除系统配置表")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@per.hasPermission('config:baseconfig:del')")
|
||||
@PreAuthorize("@per.hasPermission('sys:config:del')")
|
||||
public R removeById(@PathVariable Integer id) {
|
||||
return R.ok(baseConfigService.removeById(id));
|
||||
return R.ok(sysConfigService.removeById(id));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.hccake.ballcat.admin.modules.sys.mapper;
|
||||
|
||||
import com.hccake.ballcat.admin.modules.sys.model.entity.SysConfig;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 系统配置表
|
||||
*
|
||||
* @author ballcat code generator
|
||||
* @date 2019-10-14 17:42:23
|
||||
*/
|
||||
public interface SysConfigMapper extends BaseMapper<SysConfig> {
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.hccake.ballcat.common.modules.config.model.entity;
|
||||
package com.hccake.ballcat.admin.modules.sys.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
@@ -22,7 +22,7 @@ import java.time.LocalDateTime;
|
||||
@TableName("tbl_base_config")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "基础配置")
|
||||
public class BaseConfig extends Model<BaseConfig> {
|
||||
public class SysConfig extends Model<SysConfig> {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.hccake.ballcat.common.modules.config.service;
|
||||
package com.hccake.ballcat.admin.modules.sys.service;
|
||||
|
||||
import com.hccake.ballcat.common.modules.config.model.entity.BaseConfig;
|
||||
import com.hccake.ballcat.admin.modules.sys.model.entity.SysConfig;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
* @author ballcat code generator
|
||||
* @date 2019-10-14 17:42:23
|
||||
*/
|
||||
public interface BaseConfigService extends IService<BaseConfig> {
|
||||
public interface SysConfigService extends IService<SysConfig> {
|
||||
|
||||
/**
|
||||
* 根据配置key获取对应value
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.hccake.ballcat.admin.modules.sys.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.hccake.ballcat.admin.modules.sys.model.entity.SysConfig;
|
||||
import com.hccake.ballcat.admin.modules.sys.service.SysConfigService;
|
||||
import com.hccake.ballcat.admin.modules.sys.mapper.SysConfigMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 系统配置表
|
||||
*
|
||||
* @author ballcat code generator
|
||||
* @date 2019-10-14 17:42:23
|
||||
*/
|
||||
@Service
|
||||
public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements SysConfigService {
|
||||
|
||||
/**
|
||||
* 根据配置key获取对应value
|
||||
*
|
||||
* @param confKey 缓存对应key
|
||||
* @return confValue
|
||||
*/
|
||||
@Override
|
||||
public String getConfValueByKey(String confKey) {
|
||||
SysConfig sysConfig = baseMapper.selectOne(Wrappers.<SysConfig>lambdaQuery().eq(SysConfig::getConfKey, confKey));
|
||||
return sysConfig == null ? "": sysConfig.getConfValue();
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.hccake.ballcat.common.modules.config.mapper;
|
||||
|
||||
import com.hccake.ballcat.common.modules.config.model.entity.BaseConfig;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 系统配置表
|
||||
*
|
||||
* @author ballcat code generator
|
||||
* @date 2019-10-14 17:42:23
|
||||
*/
|
||||
public interface BaseConfigMapper extends BaseMapper<BaseConfig> {
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.hccake.ballcat.common.modules.config.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.hccake.ballcat.common.modules.config.mapper.BaseConfigMapper;
|
||||
import com.hccake.ballcat.common.modules.config.model.entity.BaseConfig;
|
||||
import com.hccake.ballcat.common.modules.config.service.BaseConfigService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 系统配置表
|
||||
*
|
||||
* @author ballcat code generator
|
||||
* @date 2019-10-14 17:42:23
|
||||
*/
|
||||
@Service
|
||||
public class BaseConfigServiceImpl extends ServiceImpl<BaseConfigMapper, BaseConfig> implements BaseConfigService {
|
||||
|
||||
/**
|
||||
* 根据配置key获取对应value
|
||||
*
|
||||
* @param confKey 缓存对应key
|
||||
* @return confValue
|
||||
*/
|
||||
@Override
|
||||
public String getConfValueByKey(String confKey) {
|
||||
BaseConfig baseConfig = baseMapper.selectOne(Wrappers.<BaseConfig>lambdaQuery().eq(BaseConfig::getConfKey, confKey));
|
||||
return baseConfig == null ? "": baseConfig.getConfValue();
|
||||
}
|
||||
}
|
||||
@@ -221,11 +221,11 @@ INSERT INTO `sys_permission` VALUES (100301, '权限查询', 'sys:syspermission:
|
||||
INSERT INTO `sys_permission` VALUES (100302, '权限新增', 'sys:syspermission:add', NULL, NULL, NULL, NULL, NULL, 100300, NULL, 1, 0, 0, 2, 0, '2019-10-13 22:00:24', NULL);
|
||||
INSERT INTO `sys_permission` VALUES (100303, '权限修改', 'sys:syspermission:edit', NULL, NULL, NULL, NULL, NULL, 100300, NULL, 2, 0, 0, 2, 0, '2019-10-13 22:00:24', NULL);
|
||||
INSERT INTO `sys_permission` VALUES (100304, '权限删除', 'sys:syspermission:del', NULL, NULL, NULL, NULL, NULL, 100300, NULL, 3, 0, 0, 2, 0, '2019-10-13 22:00:24', NULL);
|
||||
INSERT INTO `sys_permission` VALUES (100400, '配置信息', NULL, '/config/baseconfig', 'baseconfig', 'config/baseconfig/BaseConfigPage', NULL, NULL, 100000, NULL, 5, 0, 0, 1, 0, NULL, '2019-10-15 14:13:49');
|
||||
INSERT INTO `sys_permission` VALUES (100401, '配置查询', 'config:baseconfig:read', NULL, NULL, NULL, NULL, NULL, 100400, NULL, 0, 0, 0, 2, 0, '2019-10-13 22:00:24', '2019-10-15 14:14:03');
|
||||
INSERT INTO `sys_permission` VALUES (100402, '配置新增', 'config:baseconfig:add', NULL, NULL, NULL, NULL, NULL, 100400, NULL, 1, 0, 0, 2, 0, '2019-10-13 22:00:24', '2019-10-15 14:14:03');
|
||||
INSERT INTO `sys_permission` VALUES (100403, '配置修改', 'config:baseconfig:edit', NULL, NULL, NULL, NULL, NULL, 100400, NULL, 2, 0, 0, 2, 0, '2019-10-13 22:00:24', '2019-10-15 14:14:10');
|
||||
INSERT INTO `sys_permission` VALUES (100404, '配置删除', 'config:baseconfig:del', NULL, NULL, NULL, NULL, NULL, 100400, NULL, 3, 0, 0, 2, 0, '2019-10-13 22:00:24', '2019-10-15 14:14:29');
|
||||
INSERT INTO `sys_permission` VALUES (100400, '配置信息', NULL, '/sys/config', 'config', 'sys/config/SysConfigPage', NULL, NULL, 100000, NULL, 5, 0, 0, 1, 0, NULL, '2019-10-15 14:13:49');
|
||||
INSERT INTO `sys_permission` VALUES (100401, '配置查询', 'sys:config:read', NULL, NULL, NULL, NULL, NULL, 100400, NULL, 0, 0, 0, 2, 0, '2019-10-13 22:00:24', '2019-10-15 14:14:03');
|
||||
INSERT INTO `sys_permission` VALUES (100402, '配置新增', 'sys:config:add', NULL, NULL, NULL, NULL, NULL, 100400, NULL, 1, 0, 0, 2, 0, '2019-10-13 22:00:24', '2019-10-15 14:14:03');
|
||||
INSERT INTO `sys_permission` VALUES (100403, '配置修改', 'sys:config:edit', NULL, NULL, NULL, NULL, NULL, 100400, NULL, 2, 0, 0, 2, 0, '2019-10-13 22:00:24', '2019-10-15 14:14:10');
|
||||
INSERT INTO `sys_permission` VALUES (100404, '配置删除', 'sys:config:del', NULL, NULL, NULL, NULL, NULL, 100400, NULL, 3, 0, 0, 2, 0, '2019-10-13 22:00:24', '2019-10-15 14:14:29');
|
||||
INSERT INTO `sys_permission` VALUES (100500, '字典管理', NULL, '/sys/dict', 'sysDict', 'sys/dict/SysDictPage', NULL, NULL, 100000, NULL, 4, 0, 0, 1, 0, NULL, '2019-10-13 22:00:24');
|
||||
INSERT INTO `sys_permission` VALUES (100501, '字典查询', 'sys:dict:read', NULL, NULL, NULL, NULL, NULL, 100500, NULL, 0, 0, 0, 2, 0, '2019-10-13 22:00:24', NULL);
|
||||
INSERT INTO `sys_permission` VALUES (100502, '字典新增', 'sys:dict:add', NULL, NULL, NULL, NULL, NULL, 100500, NULL, 1, 0, 0, 2, 0, '2019-10-13 22:00:24', NULL);
|
||||
|
||||
Reference in New Issue
Block a user