支持菜单、用户、角色 Service 层自定义,详见 sys.service.impl 包。
This commit is contained in:
@@ -79,7 +79,7 @@ public class ReflectUtils {
|
|||||||
Field field = getAccessibleField(obj, fieldName);
|
Field field = getAccessibleField(obj, fieldName);
|
||||||
if (field == null) {
|
if (field == null) {
|
||||||
//throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
|
//throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
|
||||||
logger.warn("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
|
logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
E result = null;
|
E result = null;
|
||||||
@@ -98,7 +98,7 @@ public class ReflectUtils {
|
|||||||
Field field = getAccessibleField(obj, fieldName);
|
Field field = getAccessibleField(obj, fieldName);
|
||||||
if (field == null) {
|
if (field == null) {
|
||||||
//throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
|
//throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
|
||||||
logger.warn("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
|
logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -122,7 +122,7 @@ public class ReflectUtils {
|
|||||||
Method method = getAccessibleMethod(obj, methodName, parameterTypes);
|
Method method = getAccessibleMethod(obj, methodName, parameterTypes);
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
//throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
|
//throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
|
||||||
logger.warn("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
|
logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -144,7 +144,7 @@ public class ReflectUtils {
|
|||||||
if (method == null) {
|
if (method == null) {
|
||||||
// 如果为空不报错,直接返回空。
|
// 如果为空不报错,直接返回空。
|
||||||
// throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
|
// throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
|
||||||
logger.warn("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
|
logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -304,19 +304,19 @@ public class ReflectUtils {
|
|||||||
Type genType = clazz.getGenericSuperclass();
|
Type genType = clazz.getGenericSuperclass();
|
||||||
|
|
||||||
if (!(genType instanceof ParameterizedType)) {
|
if (!(genType instanceof ParameterizedType)) {
|
||||||
logger.warn(clazz.getSimpleName() + "'s superclass not ParameterizedType");
|
logger.debug(clazz.getSimpleName() + "'s superclass not ParameterizedType");
|
||||||
return Object.class;
|
return Object.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
|
Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
|
||||||
|
|
||||||
if (index >= params.length || index < 0) {
|
if (index >= params.length || index < 0) {
|
||||||
logger.warn("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: "
|
logger.debug("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: "
|
||||||
+ params.length);
|
+ params.length);
|
||||||
return Object.class;
|
return Object.class;
|
||||||
}
|
}
|
||||||
if (!(params[index] instanceof Class)) {
|
if (!(params[index] instanceof Class)) {
|
||||||
logger.warn(clazz.getSimpleName() + " not set the actual class on superclass generic parameter");
|
logger.debug(clazz.getSimpleName() + " not set the actual class on superclass generic parameter");
|
||||||
return Object.class;
|
return Object.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
///**
|
||||||
|
// * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||||
|
// */
|
||||||
|
//package com.jeesite.modules.sys.service.impl;
|
||||||
|
//
|
||||||
|
//import javax.servlet.http.HttpServletRequest;
|
||||||
|
//import javax.servlet.http.HttpServletResponse;
|
||||||
|
//
|
||||||
|
//import org.springframework.stereotype.Service;
|
||||||
|
//
|
||||||
|
//import com.jeesite.modules.file.entity.FileEntity;
|
||||||
|
//import com.jeesite.modules.file.entity.FileUpload;
|
||||||
|
//import com.jeesite.modules.file.service.FileUploadServiceExtendSupport;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * 文件上传扩展实现类
|
||||||
|
// * @author ThinkGem
|
||||||
|
// * @version 2018年10月13日
|
||||||
|
// */
|
||||||
|
//@Service
|
||||||
|
//public class FileUploadServiceExtendImpl extends FileUploadServiceExtendSupport {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public boolean fileExists(FileEntity fileEntity) {
|
||||||
|
// System.out.println("============= fileupload fileExists ");
|
||||||
|
// return super.fileExists(fileEntity);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void uploadFile(FileEntity fileEntity) {
|
||||||
|
// System.out.println("============= fileupload uploadFile ");
|
||||||
|
// super.uploadFile(fileEntity);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void saveUploadFile(FileUpload fileUpload) {
|
||||||
|
// System.out.println("============= fileupload saveUploadFile ");
|
||||||
|
// super.saveUploadFile(fileUpload);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public String getFileUrl(FileUpload fileUpload) {
|
||||||
|
// System.out.println("============= fileupload getFileUrl ");
|
||||||
|
// return super.getFileUrl(fileUpload);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public String downFile(FileUpload fileUpload, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
// System.out.println("============= fileupload downFile ");
|
||||||
|
// return super.downFile(fileUpload, request, response);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
///**
|
||||||
|
// * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||||
|
// */
|
||||||
|
//package com.jeesite.modules.sys.service.impl;
|
||||||
|
//
|
||||||
|
//import java.util.List;
|
||||||
|
//
|
||||||
|
//import org.springframework.stereotype.Service;
|
||||||
|
//
|
||||||
|
//import com.jeesite.modules.sys.entity.Menu;
|
||||||
|
//import com.jeesite.modules.sys.service.MenuServiceSupport;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * 菜单服务扩展实现类
|
||||||
|
// * @author ThinkGem
|
||||||
|
// * @version 2018年10月13日
|
||||||
|
// */
|
||||||
|
//@Service
|
||||||
|
//public class MenuServiceExtendImpl extends MenuServiceSupport {
|
||||||
|
//
|
||||||
|
// public MenuServiceExtendImpl() {
|
||||||
|
// this.entityClass = Menu.class;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public Menu get(Menu menu) {
|
||||||
|
// System.out.println("============= menu get ");
|
||||||
|
// return super.get(menu);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public List<Menu> findList(Menu menu) {
|
||||||
|
// System.out.println("============= menu findList ");
|
||||||
|
// return super.findList(menu);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public List<Menu> findByRoleCode(Menu menu) {
|
||||||
|
// System.out.println("============= menu findByRoleCode ");
|
||||||
|
// return super.findByRoleCode(menu);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public List<Menu> findByUserCode(Menu menu) {
|
||||||
|
// System.out.println("============= menu findByUserCode ");
|
||||||
|
// return super.findByUserCode(menu);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
///**
|
||||||
|
// * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||||
|
// */
|
||||||
|
//package com.jeesite.modules.sys.service.impl;
|
||||||
|
//
|
||||||
|
//import java.util.List;
|
||||||
|
//
|
||||||
|
//import org.springframework.stereotype.Service;
|
||||||
|
//
|
||||||
|
//import com.jeesite.modules.sys.entity.Role;
|
||||||
|
//import com.jeesite.modules.sys.service.RoleServiceSupport;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * 角色服务扩展实现类
|
||||||
|
// * @author ThinkGem
|
||||||
|
// * @version 2018年10月13日
|
||||||
|
// */
|
||||||
|
//@Service
|
||||||
|
//public class RoleServiceExtendImpl extends RoleServiceSupport {
|
||||||
|
//
|
||||||
|
// public RoleServiceExtendImpl() {
|
||||||
|
// this.entityClass = Role.class;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public Role get(Role role) {
|
||||||
|
// System.out.println("============= role get ");
|
||||||
|
// return super.get(role);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public List<Role> findList(Role role) {
|
||||||
|
// System.out.println("============= role findList ");
|
||||||
|
// return super.findList(role);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public List<Role> findListByUserCode(Role role) {
|
||||||
|
// System.out.println("============= role findListByUserCode ");
|
||||||
|
// return super.findListByUserCode(role);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
///**
|
||||||
|
// * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||||
|
// */
|
||||||
|
//package com.jeesite.modules.sys.service.impl;
|
||||||
|
//
|
||||||
|
//import java.util.List;
|
||||||
|
//
|
||||||
|
//import org.springframework.stereotype.Service;
|
||||||
|
//
|
||||||
|
//import com.jeesite.modules.sys.entity.User;
|
||||||
|
//import com.jeesite.modules.sys.service.UserServiceSupport;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * 用户服务扩展实现类
|
||||||
|
// * @author ThinkGem
|
||||||
|
// * @version 2018年10月13日
|
||||||
|
// */
|
||||||
|
//@Service
|
||||||
|
//public class UserServiceExtendImpl extends UserServiceSupport {
|
||||||
|
//
|
||||||
|
// public UserServiceExtendImpl() {
|
||||||
|
// this.entityClass = User.class;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public User get(User user) {
|
||||||
|
// System.out.println("============= user get ");
|
||||||
|
// return super.get(user);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public User getByLoginCode(User user) {
|
||||||
|
// System.out.println("============= user getByLoginCode ");
|
||||||
|
// return super.getByLoginCode(user);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public User getByUserTypeAndRefCode(User user) {
|
||||||
|
// System.out.println("============= user getByUserTypeAndRefCode ");
|
||||||
|
// return super.getByUserTypeAndRefCode(user);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public List<User> findList(User user) {
|
||||||
|
// System.out.println("============= user findList ");
|
||||||
|
// return super.findList(user);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//}
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<logger name="com.jeesite.common.shiro" level="INFO" />
|
<logger name="com.jeesite.common.shiro" level="INFO" />
|
||||||
<logger name="com.jeesite.common.mybatis" level="INFO" />
|
<logger name="com.jeesite.common.mybatis" level="INFO" />
|
||||||
<logger name="com.jeesite.common.mybatis.mapper" level="DEBUG" />
|
<logger name="com.jeesite.common.mybatis.mapper" level="DEBUG" />
|
||||||
|
<logger name="com.jeesite.common.reflect.ReflectUtils" level="INFO" />
|
||||||
<logger name="com.jeesite.common.io.FileUtils" level="INFO" />
|
<logger name="com.jeesite.common.io.FileUtils" level="INFO" />
|
||||||
<logger name="com.jeesite.common.web.view.JstlView" level="INFO" />
|
|
||||||
|
|
||||||
</included>
|
</included>
|
||||||
Reference in New Issue
Block a user