Commit cc591770 by fengshuonan

整理包结构

parent 0524c159
......@@ -16,8 +16,8 @@
package cn.stylefeng.guns.config.web;
import cn.stylefeng.guns.config.properties.GunsProperties;
import cn.stylefeng.guns.core.interceptor.GunsUserFilter;
import cn.stylefeng.guns.core.shiro.ShiroDbRealm;
import cn.stylefeng.guns.core.intercept.GunsUserFilter;
import org.apache.shiro.cache.CacheManager;
import org.apache.shiro.cache.ehcache.EhCacheManager;
import org.apache.shiro.codec.Base64;
......
......@@ -16,8 +16,8 @@
package cn.stylefeng.guns.config.web;
import cn.stylefeng.guns.config.properties.GunsProperties;
import cn.stylefeng.guns.core.controller.GunsErrorView;
import cn.stylefeng.guns.core.intercept.RestApiInteceptor;
import cn.stylefeng.guns.core.common.controller.GunsErrorView;
import cn.stylefeng.guns.core.interceptor.RestApiInteceptor;
import cn.stylefeng.guns.core.listener.ConfigListener;
import cn.stylefeng.roses.core.xss.XssFilter;
import com.alibaba.druid.pool.DruidDataSource;
......
/**
* Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.core.cache;
/**
* 缓存工厂基类
*/
public abstract class BaseCacheFactory implements ICache {
@SuppressWarnings("unchecked")
public <T> T get(String cacheName, Object key, ILoader iLoader) {
Object data = get(cacheName, key);
if (data == null) {
data = iLoader.load();
put(cacheName, key, data);
}
return (T) data;
}
@SuppressWarnings("unchecked")
public <T> T get(String cacheName, Object key, Class<? extends ILoader> iLoaderClass) {
Object data = get(cacheName, key);
if (data == null) {
try {
ILoader dataLoader = iLoaderClass.newInstance();
data = dataLoader.load();
put(cacheName, key, data);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
return (T) data;
}
}
/**
* Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.core.cache;
import java.util.List;
/**
* 缓存工具类
*/
public class CacheKit {
private static ICache defaultCacheFactory = new EhcacheFactory();
public static void put(String cacheName, Object key, Object value) {
defaultCacheFactory.put(cacheName, key, value);
}
public static <T> T get(String cacheName, Object key) {
return defaultCacheFactory.get(cacheName, key);
}
@SuppressWarnings("rawtypes")
public static List getKeys(String cacheName) {
return defaultCacheFactory.getKeys(cacheName);
}
public static void remove(String cacheName, Object key) {
defaultCacheFactory.remove(cacheName, key);
}
public static void removeAll(String cacheName) {
defaultCacheFactory.removeAll(cacheName);
}
public static <T> T get(String cacheName, Object key, ILoader iLoader) {
return defaultCacheFactory.get(cacheName, key, iLoader);
}
public static <T> T get(String cacheName, Object key, Class<? extends ILoader> iLoaderClass) {
return defaultCacheFactory.get(cacheName, key, iLoaderClass);
}
}
/**
* Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.core.cache;
import java.util.List;
/**
* 通用缓存接口
*/
public interface ICache {
void put(String cacheName, Object key, Object value);
<T> T get(String cacheName, Object key);
@SuppressWarnings("rawtypes")
List getKeys(String cacheName);
void remove(String cacheName, Object key);
void removeAll(String cacheName);
<T> T get(String cacheName, Object key, ILoader iLoader);
<T> T get(String cacheName, Object key, Class<? extends ILoader> iLoaderClass);
}
/**
* Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.core.cache;
/**
* 数据重载
*/
public interface ILoader {
Object load();
}
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.core.controller;
package cn.stylefeng.guns.core.common.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.core.controller;
package cn.stylefeng.guns.core.common.controller;
import org.springframework.web.servlet.View;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.core.node;
package cn.stylefeng.guns.core.common.node;
import cn.stylefeng.roses.kernel.model.enums.YesOrNotEnum;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.core.node;
package cn.stylefeng.guns.core.common.node;
/**
* jquery ztree 插件的节点
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.core.page;
package cn.stylefeng.guns.core.common.page;
import com.baomidou.mybatisplus.plugins.Page;
......
......@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package cn.stylefeng.guns.core.intercept;
package cn.stylefeng.guns.core.interceptor;
import cn.stylefeng.guns.core.shiro.ShiroKit;
import org.apache.shiro.subject.Subject;
......
......@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.core.intercept;
package cn.stylefeng.guns.core.interceptor;
import cn.stylefeng.guns.core.common.constant.JwtConstants;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.util.JwtTokenUtil;
import cn.stylefeng.roses.core.reqres.response.ErrorResponseData;
import cn.stylefeng.roses.core.util.RenderUtil;
import cn.stylefeng.guns.core.common.constant.JwtConstants;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import io.jsonwebtoken.JwtException;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.core.intercept;
package cn.stylefeng.guns.core.interceptor;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.util.HttpSessionContext;
......
......@@ -15,10 +15,10 @@
*/
package cn.stylefeng.guns.core.util;
import cn.stylefeng.roses.core.util.SpringContextHolder;
import cn.stylefeng.guns.config.properties.GunsProperties;
import cn.stylefeng.guns.core.common.constant.Const;
import cn.stylefeng.guns.core.node.MenuNode;
import cn.stylefeng.guns.core.common.node.MenuNode;
import cn.stylefeng.roses.core.util.SpringContextHolder;
import java.util.ArrayList;
import java.util.List;
......
/**
* Copyright (c) 2011-2016, James Zhan 詹波 (jfinal@126.com).
*
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.stylefeng.guns.core.cache;
package cn.stylefeng.guns.core.util;
import cn.stylefeng.roses.core.util.SpringContextHolder;
import lombok.extern.slf4j.Slf4j;
import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
/**
* Ehcache缓存工厂
* 缓存工具类
*/
public class EhcacheFactory extends BaseCacheFactory {
private static CacheManager cacheManager;
private static volatile Object locker = new Object();
private static final Logger log = LoggerFactory.getLogger(EhcacheFactory.class);
private static CacheManager getCacheManager() {
if (cacheManager == null) {
synchronized (EhcacheFactory.class) {
if (cacheManager == null) {
cacheManager = CacheManager.create();
}
}
}
return cacheManager;
}
static Cache getOrAddCache(String cacheName) {
CacheManager cacheManager = getCacheManager();
Cache cache = cacheManager.getCache(cacheName);
if (cache == null) {
synchronized(locker) {
cache = cacheManager.getCache(cacheName);
if (cache == null) {
log.warn("无法找到缓存 [" + cacheName + "]的配置, 使用默认配置.");
cacheManager.addCacheIfAbsent(cacheName);
cache = cacheManager.getCache(cacheName);
log.debug("缓存 [" + cacheName + "] 启动.");
}
}
}
return cache;
}
public void put(String cacheName, Object key, Object value) {
getOrAddCache(cacheName).put(new Element(key, value));
}
@SuppressWarnings("unchecked")
public <T> T get(String cacheName, Object key) {
Element element = getOrAddCache(cacheName).get(key);
return element != null ? (T)element.getObjectValue() : null;
}
@SuppressWarnings("rawtypes")
public List getKeys(String cacheName) {
return getOrAddCache(cacheName).getKeys();
}
public void remove(String cacheName, Object key) {
getOrAddCache(cacheName).remove(key);
}
public void removeAll(String cacheName) {
getOrAddCache(cacheName).removeAll();
}
@Slf4j
public class CacheUtil {
private static final Object LOCKER = new Object();
public static void put(String cacheName, Object key, Object value) {
getOrAddCache(cacheName).put(new Element(key, value));
}
@SuppressWarnings("all")
public static <T> T get(String cacheName, Object key) {
Element element = getOrAddCache(cacheName).get(key);
if (element == null) {
return null;
} else {
Object objectValue = element.getObjectValue();
return (T) objectValue;
}
}
public static List getKeys(String cacheName) {
return getOrAddCache(cacheName).getKeys();
}
public static void remove(String cacheName, Object key) {
getOrAddCache(cacheName).remove(key);
}
public static void removeAll(String cacheName) {
getOrAddCache(cacheName).removeAll();
}
private static Cache getOrAddCache(String cacheName) {
CacheManager cacheManager = SpringContextHolder.getBean(CacheManager.class);
Cache cache = cacheManager.getCache(cacheName);
if (cache == null) {
synchronized (LOCKER) {
cache = cacheManager.getCache(cacheName);
if (cache == null) {
cacheManager.addCacheIfAbsent(cacheName);
cache = cacheManager.getCache(cacheName);
}
}
}
return cache;
}
}
......@@ -17,17 +17,17 @@ package cn.stylefeng.guns.modular.system.controller;
import cn.stylefeng.guns.core.common.annotion.BussinessLog;
import cn.stylefeng.guns.core.common.annotion.Permission;
import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.core.node.ZTreeNode;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.util.ToolUtil;
import cn.stylefeng.roses.kernel.model.exception.ServiceException;
import cn.stylefeng.guns.core.common.constant.dictmap.DeptDict;
import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.modular.system.model.Dept;
import cn.stylefeng.guns.modular.system.service.IDeptService;
import cn.stylefeng.guns.modular.system.warpper.DeptWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.util.ToolUtil;
import cn.stylefeng.roses.kernel.model.exception.ServiceException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
......
......@@ -18,16 +18,16 @@ package cn.stylefeng.guns.modular.system.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.stylefeng.guns.core.common.annotion.BussinessLog;
import cn.stylefeng.guns.core.common.annotion.Permission;
import cn.stylefeng.guns.core.page.PageInfoBT;
import cn.stylefeng.roses.core.base.controller.BaseController;
import com.baomidou.mybatisplus.mapper.SqlRunner;
import com.baomidou.mybatisplus.plugins.Page;
import cn.stylefeng.guns.core.common.constant.Const;
import cn.stylefeng.guns.core.common.constant.factory.PageFactory;
import cn.stylefeng.guns.core.common.constant.state.BizLogType;
import cn.stylefeng.guns.core.common.page.PageInfoBT;
import cn.stylefeng.guns.modular.system.model.OperationLog;
import cn.stylefeng.guns.modular.system.service.IOperationLogService;
import cn.stylefeng.guns.modular.system.warpper.LogWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController;
import com.baomidou.mybatisplus.mapper.SqlRunner;
import com.baomidou.mybatisplus.plugins.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
......
......@@ -15,20 +15,20 @@
*/
package cn.stylefeng.guns.modular.system.controller;
import cn.stylefeng.guns.core.common.exception.InvalidKaptchaException;
import cn.stylefeng.guns.core.common.node.MenuNode;
import cn.stylefeng.guns.core.log.LogManager;
import cn.stylefeng.guns.core.log.factory.LogTaskFactory;
import cn.stylefeng.guns.core.node.MenuNode;
import cn.stylefeng.guns.core.shiro.ShiroKit;
import cn.stylefeng.guns.core.shiro.ShiroUser;
import cn.stylefeng.guns.core.util.ApiMenuFilter;
import cn.stylefeng.guns.core.util.KaptchaUtil;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.util.ToolUtil;
import com.google.code.kaptcha.Constants;
import cn.stylefeng.guns.core.common.exception.InvalidKaptchaException;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.guns.modular.system.service.IMenuService;
import cn.stylefeng.guns.modular.system.service.IUserService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.util.ToolUtil;
import com.google.code.kaptcha.Constants;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
......
......@@ -17,15 +17,15 @@ package cn.stylefeng.guns.modular.system.controller;
import cn.stylefeng.guns.core.common.annotion.BussinessLog;
import cn.stylefeng.guns.core.common.annotion.Permission;
import cn.stylefeng.guns.core.page.PageInfoBT;
import cn.stylefeng.roses.core.base.controller.BaseController;
import com.baomidou.mybatisplus.mapper.SqlRunner;
import com.baomidou.mybatisplus.plugins.Page;
import cn.stylefeng.guns.core.common.constant.Const;
import cn.stylefeng.guns.core.common.constant.factory.PageFactory;
import cn.stylefeng.guns.core.common.page.PageInfoBT;
import cn.stylefeng.guns.modular.system.model.LoginLog;
import cn.stylefeng.guns.modular.system.service.ILoginLogService;
import cn.stylefeng.guns.modular.system.warpper.LogWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController;
import com.baomidou.mybatisplus.mapper.SqlRunner;
import com.baomidou.mybatisplus.plugins.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
......
......@@ -18,21 +18,21 @@ package cn.stylefeng.guns.modular.system.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.stylefeng.guns.core.common.annotion.BussinessLog;
import cn.stylefeng.guns.core.common.annotion.Permission;
import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.core.node.ZTreeNode;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import cn.stylefeng.roses.core.util.ToolUtil;
import cn.stylefeng.roses.kernel.model.exception.ServiceException;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import cn.stylefeng.guns.core.common.constant.Const;
import cn.stylefeng.guns.core.common.constant.dictmap.MenuDict;
import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import cn.stylefeng.guns.core.common.constant.state.MenuStatus;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.modular.system.model.Menu;
import cn.stylefeng.guns.modular.system.service.IMenuService;
import cn.stylefeng.guns.modular.system.warpper.MenuWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import cn.stylefeng.roses.core.util.ToolUtil;
import cn.stylefeng.roses.kernel.model.exception.ServiceException;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
......
......@@ -15,25 +15,25 @@
*/
package cn.stylefeng.guns.modular.system.controller;
import cn.stylefeng.guns.core.cache.CacheKit;
import cn.stylefeng.guns.core.common.annotion.BussinessLog;
import cn.stylefeng.guns.core.common.annotion.Permission;
import cn.stylefeng.guns.core.common.constant.cache.Cache;
import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.core.node.ZTreeNode;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import cn.stylefeng.roses.core.util.ToolUtil;
import cn.stylefeng.roses.kernel.model.exception.ServiceException;
import cn.stylefeng.guns.core.common.constant.Const;
import cn.stylefeng.guns.core.common.constant.cache.Cache;
import cn.stylefeng.guns.core.common.constant.dictmap.RoleDict;
import cn.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import cn.stylefeng.guns.core.common.exception.BizExceptionEnum;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.core.log.LogObjectHolder;
import cn.stylefeng.guns.core.util.CacheUtil;
import cn.stylefeng.guns.modular.system.model.Role;
import cn.stylefeng.guns.modular.system.model.User;
import cn.stylefeng.guns.modular.system.service.IRoleService;
import cn.stylefeng.guns.modular.system.service.IUserService;
import cn.stylefeng.guns.modular.system.warpper.RoleWarpper;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import cn.stylefeng.roses.core.util.ToolUtil;
import cn.stylefeng.roses.kernel.model.exception.ServiceException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
......@@ -153,7 +153,7 @@ public class RoleController extends BaseController {
this.roleService.updateById(role);
//删除缓存
CacheKit.removeAll(Cache.CONSTANT);
CacheUtil.removeAll(Cache.CONSTANT);
return SUCCESS_TIP;
}
......@@ -180,7 +180,7 @@ public class RoleController extends BaseController {
this.roleService.delRoleById(roleId);
//删除缓存
CacheKit.removeAll(Cache.CONSTANT);
CacheUtil.removeAll(Cache.CONSTANT);
return SUCCESS_TIP;
}
......
......@@ -15,7 +15,7 @@
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.core.node.ZTreeNode;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Dept;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
......
......@@ -15,8 +15,8 @@
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.core.node.MenuNode;
import cn.stylefeng.guns.core.node.ZTreeNode;
import cn.stylefeng.guns.core.common.node.MenuNode;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Menu;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
......
......@@ -15,7 +15,7 @@
*/
package cn.stylefeng.guns.modular.system.dao;
import cn.stylefeng.guns.core.node.ZTreeNode;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Role;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
......
......@@ -14,7 +14,7 @@
<result column="version" property="version"/>
</resultMap>
<select id="tree" resultType="cn.stylefeng.guns.core.node.ZTreeNode">
<select id="tree" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
select id,pid as pId,simplename as name,
(
CASE
......
......@@ -42,7 +42,7 @@
sys_relation where roleid = #{roleId}
</select>
<select id="menuTreeList" resultType="cn.stylefeng.guns.core.node.ZTreeNode">
<select id="menuTreeList" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
SELECT
m1.id AS id,
(
......@@ -70,7 +70,7 @@
m1.id ASC
</select>
<select id="menuTreeListByMenuIds" resultType="cn.stylefeng.guns.core.node.ZTreeNode">
<select id="menuTreeListByMenuIds" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
SELECT
m1.id AS id,
(
......@@ -132,7 +132,7 @@
where rel.roleid = #{roleId}
</select>
<select id="getMenusByRoleIds" resultType="cn.stylefeng.guns.core.node.MenuNode">
<select id="getMenusByRoleIds" resultType="cn.stylefeng.guns.core.common.node.MenuNode">
SELECT
m1.id AS id,
m1.icon AS icon,
......
......@@ -30,13 +30,13 @@
delete from sys_relation where roleid = #{roleId}
</delete>
<select id="roleTreeList" resultType="cn.stylefeng.guns.core.node.ZTreeNode">
<select id="roleTreeList" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
select id "id",pId
"pId",name as "name",(case when (pId=0 or pId is null) then 'true'
else 'false' end) "open" from sys_role
</select>
<select id="roleTreeListByRoleId" resultType="cn.stylefeng.guns.core.node.ZTreeNode">
<select id="roleTreeListByRoleId" resultType="cn.stylefeng.guns.core.common.node.ZTreeNode">
SELECT
r.id "id",
pId "pId",
......
......@@ -15,9 +15,9 @@
*/
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.core.node.ZTreeNode;
import com.baomidou.mybatisplus.service.IService;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Dept;
import com.baomidou.mybatisplus.service.IService;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......
......@@ -15,10 +15,10 @@
*/
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.core.node.MenuNode;
import cn.stylefeng.guns.core.node.ZTreeNode;
import com.baomidou.mybatisplus.service.IService;
import cn.stylefeng.guns.core.common.node.MenuNode;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Menu;
import com.baomidou.mybatisplus.service.IService;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......
......@@ -15,9 +15,9 @@
*/
package cn.stylefeng.guns.modular.system.service;
import cn.stylefeng.guns.core.node.ZTreeNode;
import com.baomidou.mybatisplus.service.IService;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.model.Role;
import com.baomidou.mybatisplus.service.IService;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......
......@@ -15,13 +15,13 @@
*/
package cn.stylefeng.guns.modular.system.service.impl;
import cn.stylefeng.guns.core.node.ZTreeNode;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.dao.DeptMapper;
import cn.stylefeng.guns.modular.system.model.Dept;
import cn.stylefeng.guns.modular.system.service.IDeptService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import cn.stylefeng.guns.modular.system.dao.DeptMapper;
import cn.stylefeng.guns.modular.system.model.Dept;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......
......@@ -15,14 +15,14 @@
*/
package cn.stylefeng.guns.modular.system.service.impl;
import cn.stylefeng.guns.core.node.MenuNode;
import cn.stylefeng.guns.core.node.ZTreeNode;
import cn.stylefeng.guns.core.common.node.MenuNode;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.dao.MenuMapper;
import cn.stylefeng.guns.modular.system.model.Menu;
import cn.stylefeng.guns.modular.system.service.IMenuService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import cn.stylefeng.guns.modular.system.dao.MenuMapper;
import cn.stylefeng.guns.modular.system.model.Menu;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......
......@@ -16,13 +16,13 @@
package cn.stylefeng.guns.modular.system.service.impl;
import cn.hutool.core.convert.Convert;
import cn.stylefeng.guns.core.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.service.IRoleService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import cn.stylefeng.guns.core.common.node.ZTreeNode;
import cn.stylefeng.guns.modular.system.dao.RelationMapper;
import cn.stylefeng.guns.modular.system.dao.RoleMapper;
import cn.stylefeng.guns.modular.system.model.Relation;
import cn.stylefeng.guns.modular.system.model.Role;
import cn.stylefeng.guns.modular.system.service.IRoleService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment