更改为构造注入并完善方法注释

This commit is contained in:
thinkgem
2025-10-12 14:10:00 +08:00
parent 4538ce0050
commit 06e88b5bad
94 changed files with 557 additions and 733 deletions

View File

@@ -61,7 +61,6 @@ public class DigestUtils {
* @param algorithm 散列算法("SHA-1"、"MD5"、"SM3"
* @param salt 可为空
* @param iterations 迭代次数
* @return
*/
public static byte[] digest(byte[] input, String algorithm, byte[] salt, int iterations) {
try {

View File

@@ -53,9 +53,7 @@ public class ResourceUtils extends org.springframework.util.ResourceUtils {
/**
* 获取资源文件流(用后记得关闭)
* @param location
* @author ThinkGem
* @throws IOException
*/
public static InputStream getResourceFileStream(String location) throws IOException{
Resource resource = resourceLoader.getResource(location);
@@ -64,7 +62,6 @@ public class ResourceUtils extends org.springframework.util.ResourceUtils {
/**
* 获取资源文件内容
* @param location
* @author ThinkGem
*/
public static String getResourceFileContent(String location){
@@ -77,7 +74,6 @@ public class ResourceUtils extends org.springframework.util.ResourceUtils {
/**
* Spring 搜索资源文件
* @param locationPattern
* @author ThinkGem
*/
public static Resource[] getResources(String locationPattern){

View File

@@ -15,7 +15,6 @@ public class ByteUtils {
/**
* @param byteSize 字节
* @return
*/
public static String formatByteSize(long byteSize) {

View File

@@ -84,7 +84,6 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
* @param pattern 格式yyyy-MM-dd pattern可以为"yyyy-MM-dd" "HH:mm:ss" "E"
* @param amont 数量,前为负数,后为正数
* @param type 类型可参考Calendar的常量(如Calendar.HOUR、Calendar.MINUTE、Calendar.SECOND)
* @return
*/
public static String getDate(String pattern, int amont, int type) {
Calendar calendar = Calendar.getInstance(LocaleUtils.getTimeZone(), LocaleUtils.getLocale());

View File

@@ -31,7 +31,7 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
String[] ver = StringUtils.split(System.getProperty("java.version"), StringUtils.DOT);
isJavaSerialize = ver.length > 0 && Integer.parseInt(ver[0]) > 1;
}
/**
* 转换为 Double 类型
*/
@@ -150,8 +150,8 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
/**
* 拷贝一个对象(但是子对象无法拷贝)
* @param source
* @param ignoreProperties
* @param source 原对象
* @param ignoreProperties 忽略的属性
*/
public static Object copyBean(Object source, String... ignoreProperties){
if (source == null){
@@ -169,7 +169,7 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
/**
* 克隆一个对象(完全拷贝)
* @param source
* @param source 原对象
*/
public static Object cloneBean(Object source){
if (source == null){
@@ -181,8 +181,6 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
/**
* 序列化对象
* @param object
* @return
*/
public static byte[] serialize(Object object) {
try {
@@ -199,8 +197,6 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
/**
* 反序列化对象
* @param bytes
* @return
*/
public static Object unserialize(byte[] bytes) {
try {
@@ -217,8 +213,6 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
/**
* 序列化对象
* @param object
* @return
*/
public static byte[] serializeJava(Object object) {
if (object == null){
@@ -242,8 +236,6 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
/**
* 反序列化对象
* @param bytes
* @return
*/
public static Object unserializeJava(byte[] bytes) {
if (bytes == null){

View File

@@ -10,9 +10,6 @@ public class WorkDayUtils {
/**
* 获取日期之间的天数
* @param d1
* @param d2
* @return
*/
public int getDaysBetween(java.util.Calendar d1, java.util.Calendar d2) {
if (d1.after(d2)) { // swap dates so that d1 is start and d2 is end
@@ -35,9 +32,6 @@ public class WorkDayUtils {
/**
* 获取工作日
* @param d1
* @param d2
* @return
*/
public int getWorkingDay(java.util.Calendar d1, java.util.Calendar d2) {
int result = -1;
@@ -72,8 +66,6 @@ public class WorkDayUtils {
/**
* 获取中文日期
* @param date
* @return
*/
public String getChineseWeek(Calendar date) {
final String[] dayNames = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
@@ -84,8 +76,6 @@ public class WorkDayUtils {
/**
* 获得日期的下一个星期一的日期
* @param date
* @return
*/
public Calendar getNextMonday(Calendar date) {
Calendar result = null;
@@ -99,9 +89,6 @@ public class WorkDayUtils {
/**
* 获取休息日
* @param d1
* @param d2
* @return
*/
public int getHolidays(Calendar d1, Calendar d2) {
return this.getDaysBetween(d1, d2) - this.getWorkingDay(d1, d2);

View File

@@ -146,7 +146,6 @@ public class VideoUtils {
/**
* 检查文件是否存在
* @param inputFile
* @return boolean
*/
public boolean checkfile(String inputFile) {
@@ -160,8 +159,7 @@ public class VideoUtils {
/**
* ffmpeg 截取缩略图
* @param inputFile
* @return boolean
* @return boolean
*/
public boolean processFfmpegCutpic(String inputFile, String outputFile) {
List<String> command = new java.util.ArrayList<String>();
@@ -274,8 +272,7 @@ public class VideoUtils {
/**
* 执行命令
* @param command
* @return boolean
* @return boolean
*/
private boolean process(List<String> command) {
try {

View File

@@ -21,7 +21,6 @@ public class EmailUtils {
/**
* 发送邮件
* @return
*/
public static boolean send(String toAddress, String subject, String content) {
PropertiesUtils props = PropertiesUtils.getInstance();
@@ -52,7 +51,6 @@ public class EmailUtils {
* @param toAddress 接收地址
* @param subject 标题
* @param content 内容
* @return
*/
public static boolean send(String fromAddress, String fromPassword, String fromHostName, Integer smtpPort,
String sslOnConnect, String sslSmtpPort, String toAddress, String subject, String content) {

View File

@@ -59,7 +59,6 @@ public class IpUtils {
* 172.16.0.0/12172.16.0.0172.31.255.255
* 192.168.0.0/16192.168.0.0192.168.255.255
* @param ip 地址
* @return
*/
public static boolean isInternalAddr(String ip) {

View File

@@ -235,7 +235,6 @@ public class ExcelImport implements Closeable {
/**
* 获取行对象
* @param rownum
* @return 返回Row对象如果空行返回null
*/
public Row getRow(int rownum){
@@ -262,7 +261,6 @@ public class ExcelImport implements Closeable {
/**
* 获取数据行号
* @return
*/
public int getDataRowNum(){
return headerNum;
@@ -270,7 +268,6 @@ public class ExcelImport implements Closeable {
/**
* 获取最后一个数据行号
* @return
*/
public int getLastDataRowNum(){
//return this.sheet.getLastRowNum() + headerNum;
@@ -279,7 +276,6 @@ public class ExcelImport implements Closeable {
/**
* 获取最后一个列号
* @return
*/
public int getLastCellNum(){
Row row = this.getRow(headerNum);

View File

@@ -59,8 +59,6 @@ public class BookMark {
/**
* 构造函数
* @param ctBookmark
* @param para
*/
public BookMark(CTBookmark ctBookmark, XWPFParagraph para) {
this._ctBookmark = ctBookmark;
@@ -72,9 +70,6 @@ public class BookMark {
/**
* 构造函数,用于表格中的标签
* @param ctBookmark
* @param para
* @param tableCell
*/
public BookMark(CTBookmark ctBookmark, XWPFParagraph para, XWPFTableCell tableCell) {
this(ctBookmark, para);

View File

@@ -19,8 +19,6 @@ public class UserAgentUtils {
/**
* 获取用户代理对象
* @param request
* @return
*/
public static UserAgent getUserAgent(HttpServletRequest request){
return UserAgent.parseUserAgentString(request.getHeader("User-Agent"));
@@ -28,8 +26,6 @@ public class UserAgentUtils {
/**
* 获取设备类型
* @param request
* @return
*/
public static DeviceType getDeviceType(HttpServletRequest request){
return getUserAgent(request).getOperatingSystem().getDeviceType();
@@ -37,8 +33,6 @@ public class UserAgentUtils {
/**
* 是否是PC
* @param request
* @return
*/
public static boolean isComputer(HttpServletRequest request){
return DeviceType.COMPUTER.equals(getDeviceType(request));
@@ -46,8 +40,6 @@ public class UserAgentUtils {
/**
* 是否是手机
* @param request
* @return
*/
public static boolean isMobile(HttpServletRequest request){
return DeviceType.MOBILE.equals(getDeviceType(request));
@@ -55,8 +47,6 @@ public class UserAgentUtils {
/**
* 是否是平板
* @param request
* @return
*/
public static boolean isTablet(HttpServletRequest request){
return DeviceType.TABLET.equals(getDeviceType(request));
@@ -64,8 +54,6 @@ public class UserAgentUtils {
/**
* 是否是手机和平板
* @param request
* @return
*/
public static boolean isMobileOrTablet(HttpServletRequest request){
DeviceType deviceType = getDeviceType(request);
@@ -74,8 +62,6 @@ public class UserAgentUtils {
/**
* 获取浏览类型
* @param request
* @return
*/
public static Browser getBrowser(HttpServletRequest request){
return getUserAgent(request).getBrowser();
@@ -83,8 +69,6 @@ public class UserAgentUtils {
/**
* 是否IE版本是否小于等于IE8
* @param request
* @return
*/
public static boolean isLteIE8(HttpServletRequest request){
Browser browser = getBrowser(request);

View File

@@ -48,8 +48,6 @@ public class CodeStatistic {
/**
* 获得目录下的文件和子目录下的文件
* @param f
* @return
*/
public static ArrayList<File> getFile(File f) {
File[] ff = f.listFiles();
@@ -66,7 +64,6 @@ public class CodeStatistic {
/**
* 统计方法
* @param f
*/
private static void count(File f) {
FileReader fr = null;

View File

@@ -23,8 +23,7 @@ public class AppCommentService extends CrudService<AppCommentDao, AppComment> {
/**
* 获取单条数据
* @param appComment
* @return
* @param appComment 主键
*/
@Override
public AppComment get(AppComment appComment) {
@@ -35,7 +34,6 @@ public class AppCommentService extends CrudService<AppCommentDao, AppComment> {
* 查询分页数据
* @param appComment 查询条件
* @param appComment page 分页对象
* @return
*/
@Override
public Page<AppComment> findPage(AppComment appComment) {
@@ -44,7 +42,7 @@ public class AppCommentService extends CrudService<AppCommentDao, AppComment> {
/**
* 保存数据(插入或更新)
* @param appComment
* @param appComment 查询条件
*/
@Override
@Transactional
@@ -56,7 +54,7 @@ public class AppCommentService extends CrudService<AppCommentDao, AppComment> {
/**
* 更新状态
* @param appComment
* @param appComment 数据对象
*/
@Override
@Transactional
@@ -66,7 +64,7 @@ public class AppCommentService extends CrudService<AppCommentDao, AppComment> {
/**
* 删除数据
* @param appComment
* @param appComment 数据对象
*/
@Override
@Transactional

View File

@@ -22,8 +22,7 @@ public class AppUpgradeService extends CrudService<AppUpgradeDao, AppUpgrade> {
/**
* 获取单条数据
* @param appUpgrade
* @return
* @param appUpgrade 主键
*/
@Override
public AppUpgrade get(AppUpgrade appUpgrade) {
@@ -34,7 +33,6 @@ public class AppUpgradeService extends CrudService<AppUpgradeDao, AppUpgrade> {
* 查询分页数据
* @param appUpgrade 查询条件
* @param appUpgrade page 分页对象
* @return
*/
@Override
public Page<AppUpgrade> findPage(AppUpgrade appUpgrade) {
@@ -43,7 +41,7 @@ public class AppUpgradeService extends CrudService<AppUpgradeDao, AppUpgrade> {
/**
* 保存数据(插入或更新)
* @param appUpgrade
* @param appUpgrade 数据对象
*/
@Override
@Transactional
@@ -53,7 +51,7 @@ public class AppUpgradeService extends CrudService<AppUpgradeDao, AppUpgrade> {
/**
* 更新状态
* @param appUpgrade
* @param appUpgrade 数据对象
*/
@Override
@Transactional
@@ -63,7 +61,7 @@ public class AppUpgradeService extends CrudService<AppUpgradeDao, AppUpgrade> {
/**
* 删除数据
* @param appUpgrade
* @param appUpgrade 数据对象
*/
@Override
@Transactional

View File

@@ -9,9 +9,10 @@ import com.jeesite.common.entity.Page;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.app.entity.AppComment;
import com.jeesite.modules.app.service.AppCommentService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -20,8 +21,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
/**
@@ -33,9 +32,12 @@ import java.util.Date;
@RequestMapping(value = "${adminPath}/app/appComment")
public class AppCommentController extends BaseController {
@Autowired
private AppCommentService appCommentService;
private final AppCommentService appCommentService;
public AppCommentController(AppCommentService appCommentService) {
this.appCommentService = appCommentService;
}
/**
* 获取数据
*/

View File

@@ -4,21 +4,19 @@
*/
package com.jeesite.modules.app.web;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jeesite.common.config.Global;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.app.entity.AppComment;
import com.jeesite.modules.app.entity.AppUpgrade;
import com.jeesite.modules.app.service.AppCommentService;
import com.jeesite.modules.app.service.AppUpgradeService;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* APP公共服务 Controller
@@ -29,12 +27,14 @@ import com.jeesite.modules.app.service.AppUpgradeService;
@RequestMapping(value = "/app")
public class AppPublicServiceController extends BaseController {
@Autowired
private AppUpgradeService appUpgradeService;
private final AppUpgradeService appUpgradeService;
private final AppCommentService appCommentService;
public AppPublicServiceController(AppUpgradeService appUpgradeService, AppCommentService appCommentService) {
this.appUpgradeService = appUpgradeService;
this.appCommentService = appCommentService;
}
@Autowired
private AppCommentService appCommentService;
/**
* 升级检测
*/

View File

@@ -4,11 +4,14 @@
*/
package com.jeesite.modules.app.web;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.app.entity.AppUpgrade;
import com.jeesite.modules.app.service.AppUpgradeService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -17,12 +20,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.app.entity.AppUpgrade;
import com.jeesite.modules.app.service.AppUpgradeService;
/**
* APP版本管理Controller
* @author ThinkGem
@@ -32,9 +29,12 @@ import com.jeesite.modules.app.service.AppUpgradeService;
@RequestMapping(value = "${adminPath}/app/appUpgrade")
public class AppUpgradeController extends BaseController {
@Autowired
private AppUpgradeService appUpgradeService;
private final AppUpgradeService appUpgradeService;
public AppUpgradeController(AppUpgradeService appUpgradeService) {
this.appUpgradeService = appUpgradeService;
}
/**
* 获取数据
*/

View File

@@ -10,7 +10,7 @@ import com.jeesite.modules.cms.entity.Article;
/**
* 文章表DAO接口
* @author 长春叭哥
* @author 长春叭哥、ThinkGem
* @version 2018-10-15
*/
@MyBatisDao

View File

@@ -10,7 +10,7 @@ import com.jeesite.modules.cms.entity.ArticleData;
/**
* 文章详情表DAO接口
* @author 长春叭哥
* @author 长春叭哥、ThinkGem
* @version 2018-10-15
*/
@MyBatisDao

View File

@@ -10,7 +10,7 @@ import com.jeesite.modules.cms.entity.ArticlePosid;
/**
* 文章推荐位DAO接口
* @author 长春叭哥
* @author 长春叭哥、ThinkGem
* @version 2018-10-15
*/
@MyBatisDao

View File

@@ -10,7 +10,7 @@ import com.jeesite.modules.cms.entity.ArticleTag;
/**
* 文章与标签关系DAO接口
* @author 长春叭哥
* @author 长春叭哥、ThinkGem
* @version 2018-10-15
*/
@MyBatisDao

View File

@@ -10,7 +10,7 @@ import com.jeesite.modules.cms.entity.Category;
/**
* 栏目表DAO接口
* @author 长春叭哥
* @author 长春叭哥、ThinkGem
* @version 2018-10-15
*/
@MyBatisDao

View File

@@ -10,7 +10,7 @@ import com.jeesite.modules.cms.entity.Comment;
/**
* 文章评论表DAO接口
* @author 长春叭哥
* @author 长春叭哥、ThinkGem
* @version 2018-10-15
*/
@MyBatisDao

View File

@@ -10,7 +10,7 @@ import com.jeesite.modules.cms.entity.Report;
/**
* 内容举报表DAO接口
* @author 长春叭哥
* @author 长春叭哥、ThinkGem
* @version 2018-10-15
*/
@MyBatisDao

View File

@@ -10,7 +10,7 @@ import com.jeesite.modules.cms.entity.Site;
/**
* 站点表DAO接口
* @author 长春叭哥
* @author 长春叭哥、ThinkGem
* @version 2018-10-15
*/
@MyBatisDao

View File

@@ -10,7 +10,7 @@ import com.jeesite.modules.cms.entity.Tag;
/**
* 内容标签DAO接口
* @author 长春叭哥
* @author 长春叭哥、ThinkGem
* @version 2018-10-15
*/
@MyBatisDao

View File

@@ -10,7 +10,7 @@ import com.jeesite.modules.cms.entity.VisitLog;
/**
* 访问日志表DAO接口
* @author 长春叭哥
* @author 长春叭哥、ThinkGem
* @version 2018-10-15
*/
@MyBatisDao

View File

@@ -16,6 +16,7 @@ import com.jeesite.modules.cms.utils.CmsUtils;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
@@ -280,7 +281,6 @@ public class Article extends DataEntity<Article> {
/**
* 是否查询文章内容
* @return
*/
public Boolean getIsQueryArticleData() {
return isQueryArticleData;

View File

@@ -4,19 +4,17 @@
*/
package com.jeesite.modules.cms.entity;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeesite.common.entity.BaseEntity;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
* 文章评论表Entity
@@ -45,7 +43,7 @@ public class Comment extends DataEntity<Comment> {
private static final long serialVersionUID = 1L;
private Category category;// 分类编号
private Category category; // 分类编号
private String categoryCode; // 栏目编码
private String articleId; // 内容编号 Article.id、Photo.id、Download.id

View File

@@ -187,7 +187,6 @@ public class Site extends DataEntity<Site> {
/**
* 获得模板方案路径。如:/WEB-INF/views/modules/cmsfront/themes/jeesite
* @return
*/
public String getSolutionPath() {
return TEMPLATE_BASE_DIRECTION + "/" + getTheme();

View File

@@ -19,7 +19,7 @@ import com.jeesite.modules.cms.utils.CmsUtils;
import com.jeesite.modules.file.utils.FileUploadUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import io.netty.util.concurrent.DefaultThreadFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -32,19 +32,24 @@ import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/**
* 文章Service
* @author 长春叭哥、ThinkGem
* @version 2023-4-10
* 文章Service
* @author ThinkGem
* @version 2025-10-12
*/
@Service
public class ArticleService extends CrudService<ArticleDao, Article> {
@Autowired
private ArticleDataDao articleDataDao;
@Autowired(required = false)
private ArticleIndexService articleIndexService;
@Autowired(required = false)
private PageCacheService pageCacheService;
private final ArticleDataDao articleDataDao;
private final ArticleIndexService articleIndexService;
private final PageCacheService pageCacheService;
public ArticleService(ArticleDataDao articleDataDao,
ObjectProvider<ArticleIndexService> articleIndexService,
ObjectProvider<PageCacheService> pageCacheService) {
this.articleDataDao = articleDataDao;
this.articleIndexService = articleIndexService.getIfAvailable();
this.pageCacheService = pageCacheService.getIfAvailable();
}
private static final ExecutorService updateExpiredWeightThreadPool = new ThreadPoolExecutor(5, 20,
60L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(),
@@ -52,8 +57,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
/**
* 获取单条数据
* @param article
* @return
* @param article 主键
*/
@Override
public Article get(Article article) {
@@ -84,7 +88,6 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
* 查询分页数据
* @param article 查询条件
* @param article page 分页对象
* @return
*/
@Override
public Page<Article> findPage(Article article) {
@@ -94,6 +97,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
/**
* 通过编号获取内容标题
* @param ids 主键,使用逗号分隔
* @return new Object[]{栏目Id,内容Id,内容标题}
*/
public List<Object[]> findByIds(String ids) {
@@ -111,7 +115,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
/**
* 权重更新
* @param article
* @param article 数据对象
* @author ThinkGem
*/
@Transactional
@@ -127,7 +131,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
/**
* 保存数据(插入或更新)
* @param article
* @param article 数据对象
*/
@Override
@Transactional
@@ -173,7 +177,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
/**
* 更新状态
* @param article
* @param article 数据对象
*/
@Override
@Transactional
@@ -210,7 +214,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
/**
* 删除数据
* @param article
* @param article 文章
*/
@Override
@Transactional

View File

@@ -10,24 +10,28 @@ import com.jeesite.modules.cms.entity.Article;
import com.jeesite.modules.cms.entity.Category;
import com.jeesite.modules.cms.utils.CmsUtils;
import com.jeesite.modules.file.utils.FileUploadUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 栏目Service
* @author 长春叭哥、ThinkGem
* @version 2023-4-10
* 栏目Service
* @author ThinkGem
* @version 2025-10-12
*/
@Service
public class CategoryService extends TreeService<CategoryDao, Category> {
@Autowired(required = false)
private ArticleIndexService articleIndexService;
@Autowired(required = false)
private PageCacheService pageCacheService;
private final ArticleIndexService articleIndexService;
private final PageCacheService pageCacheService;
public CategoryService(ObjectProvider<ArticleIndexService> articleIndexService,
ObjectProvider<PageCacheService> pageCacheService) {
this.articleIndexService = articleIndexService.getIfAvailable();
this.pageCacheService = pageCacheService.getIfAvailable();
}
/**
* 获取单条数据

View File

@@ -23,8 +23,7 @@ public class CommentService extends CrudService<CommentDao, Comment> {
/**
* 获取单条数据
* @param comment
* @return
* @param comment 主键
*/
@Override
public Comment get(Comment comment) {
@@ -35,7 +34,6 @@ public class CommentService extends CrudService<CommentDao, Comment> {
* 查询分页数据
* @param comment 查询条件
* @param comment page 分页对象
* @return
*/
@Override
public Page<Comment> findPage(Comment comment) {
@@ -44,7 +42,7 @@ public class CommentService extends CrudService<CommentDao, Comment> {
/**
* 保存数据(插入或更新)
* @param comment
* @param comment 数据对象
*/
@Override
@Transactional
@@ -58,7 +56,7 @@ public class CommentService extends CrudService<CommentDao, Comment> {
/**
* 更新状态
* @param comment
* @param comment 数据对象
*/
@Override
@Transactional
@@ -68,7 +66,7 @@ public class CommentService extends CrudService<CommentDao, Comment> {
/**
* 删除数据
* @param comment
* @param comment 数据对象
*/
@Override
@Transactional

View File

@@ -25,7 +25,7 @@ public class FileTemplateService {
/**
* 获取对应视图模板列表,兼容 Select 字典
* @param prefix
* @param prefix 路径前缀
*/
public List<DictData> getTemplateContentDict(String prefix) throws IOException {
List<DictData> listSite = ListUtils.newArrayList();

View File

@@ -23,8 +23,7 @@ public class ReportService extends CrudService<ReportDao, Report> {
/**
* 获取单条数据
* @param report
* @return
* @param report 主键
*/
@Override
public Report get(Report report) {
@@ -35,7 +34,6 @@ public class ReportService extends CrudService<ReportDao, Report> {
* 查询分页数据
* @param report 查询条件
* @param report page 分页对象
* @return
*/
@Override
public Page<Report> findPage(Report report) {
@@ -44,7 +42,7 @@ public class ReportService extends CrudService<ReportDao, Report> {
/**
* 保存数据(插入或更新)
* @param report
* @param report 数据对象
*/
@Override
@Transactional
@@ -58,7 +56,7 @@ public class ReportService extends CrudService<ReportDao, Report> {
/**
* 更新状态
* @param report
* @param report 数据对象
*/
@Override
@Transactional
@@ -68,7 +66,7 @@ public class ReportService extends CrudService<ReportDao, Report> {
/**
* 删除数据
* @param report
* @param report 数据对象
*/
@Override
@Transactional

View File

@@ -12,26 +12,30 @@ import com.jeesite.modules.cms.entity.Category;
import com.jeesite.modules.cms.entity.Site;
import com.jeesite.modules.cms.utils.CmsUtils;
import com.jeesite.modules.file.utils.FileUploadUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 站点Service
* @author 长春叭哥、ThinkGem
* @version 2023-4-10
* 站点Service
* @author ThinkGem
* @version 2025-10-12
*/
@Service
public class SiteService extends CrudService<SiteDao, Site> {
@Autowired(required = false)
private ArticleIndexService articleIndexService;
@Autowired(required = false)
private PageCacheService pageCacheService;
private final ArticleIndexService articleIndexService;
private final PageCacheService pageCacheService;
public SiteService(ObjectProvider<ArticleIndexService> articleIndexService,
ObjectProvider<PageCacheService> pageCacheService) {
this.articleIndexService = articleIndexService.getIfAvailable();
this.pageCacheService = pageCacheService.getIfAvailable();
}
/**
* 获取单条数据
* @param site
* @param site 主键
*/
@Override
public Site get(Site site) {
@@ -50,6 +54,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
/**
* 保存数据(插入或更新)
* @param site 数据对象
*/
@Override
@Transactional
@@ -62,7 +67,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
/**
* 更新状态
* @param site
* @param site 数据对象
*/
@Override
@Transactional
@@ -74,7 +79,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
/**
* 删除数据
* @param site
* @param site 数据对象
*/
@Override
@Transactional
@@ -85,18 +90,6 @@ public class SiteService extends CrudService<SiteDao, Site> {
clearCache(site);
}
// /**
// * 删除站点
// * @param site
// * @param isRe
// */
// @Transactional
// public void delete(Site site, Boolean isRe) {
// site.setStatus(isRe != null && isRe ? Site.STATUS_NORMAL : Site.STATUS_DELETE);
// super.delete(site);
// CmsUtils.removeCache("siteList");
// }
/**
* 清理站点缓存
*/

View File

@@ -22,8 +22,7 @@ public class TagService extends CrudService<TagDao, Tag> {
/**
* 获取单条数据
* @param tag
* @return
* @param tag 主键
*/
@Override
public Tag get(Tag tag) {
@@ -34,7 +33,6 @@ public class TagService extends CrudService<TagDao, Tag> {
* 查询分页数据
* @param tag 查询条件
* @param tag page 分页对象
* @return
*/
@Override
public Page<Tag> findPage(Tag tag) {
@@ -43,7 +41,7 @@ public class TagService extends CrudService<TagDao, Tag> {
/**
* 保存数据(插入或更新)
* @param tag
* @param tag 数据对象
*/
@Override
@Transactional
@@ -53,7 +51,7 @@ public class TagService extends CrudService<TagDao, Tag> {
/**
* 更新状态
* @param tag
* @param tag 数据对象
*/
@Override
@Transactional
@@ -63,7 +61,7 @@ public class TagService extends CrudService<TagDao, Tag> {
/**
* 删除数据
* @param tag
* @param tag 数据对象
*/
@Override
@Transactional

View File

@@ -23,8 +23,7 @@ public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
/**
* 获取单条数据
* @param visitLog
* @return
* @param visitLog 主键
*/
@Override
public VisitLog get(VisitLog visitLog) {
@@ -35,7 +34,6 @@ public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
* 查询分页数据
* @param visitLog 查询条件
* @param visitLog page 分页对象
* @return
*/
@Override
public Page<VisitLog> findPage(VisitLog visitLog) {
@@ -44,7 +42,7 @@ public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
/**
* 保存数据(插入或更新)
* @param visitLog
* @param visitLog 数据对象
*/
@Override
@Transactional
@@ -58,7 +56,7 @@ public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
/**
* 更新状态
* @param visitLog
* @param visitLog 数据对象
*/
@Override
@Transactional
@@ -68,7 +66,7 @@ public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
/**
* 删除数据
* @param visitLog
* @param visitLog 数据对象
*/
@Override
@Transactional

View File

@@ -24,7 +24,7 @@ public class FileTemplateUtils {
/**
* 获取模版文件
* @param fileName
* @param fileName 模块名称
*/
public static FileTemplate getFileTemplateByResource(String fileName) {
if (!StringUtils.startsWith(fileName, "views/modules/cmsfront")) {

View File

@@ -17,8 +17,9 @@ import com.jeesite.modules.cms.service.CategoryService;
import com.jeesite.modules.cms.service.FileTemplateService;
import com.jeesite.modules.cms.utils.CmsUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -27,8 +28,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@@ -41,12 +40,15 @@ import java.util.List;
@RequestMapping(value = "${adminPath}/cms/article")
public class ArticleController extends BaseController {
@Autowired
private ArticleService articleService;
@Autowired
private CategoryService categoryService;
@Autowired
private FileTemplateService fileTemplateService;
private final ArticleService articleService;
private final CategoryService categoryService;
private final FileTemplateService fileTemplateService;
public ArticleController(ArticleService articleService, CategoryService categoryService, FileTemplateService fileTemplateService) {
this.articleService = articleService;
this.categoryService = categoryService;
this.fileTemplateService = fileTemplateService;
}
/**
* 获取数据
@@ -58,7 +60,6 @@ public class ArticleController extends BaseController {
/**
* 查询列表
* @throws IOException
*/
@RequiresPermissions("cms:article:view")
@RequestMapping(value = { "list", "" })
@@ -73,7 +74,7 @@ public class ArticleController extends BaseController {
Page<Article> page = new Page<>(1, 1, -1);
article.setPage(page);
page = articleService.findPage(article);
if (page.getList().size() > 0) {
if (!page.getList().isEmpty()) {
article = page.getList().get(0);
article.setArticleData(articleService.get(new ArticleData(article.getId())));
}
@@ -116,7 +117,6 @@ public class ArticleController extends BaseController {
/**
* 查看编辑表单
* @throws IOException
*/
@RequiresPermissions("cms:article:view")
@RequestMapping(value = "form")

View File

@@ -20,7 +20,6 @@ import com.jeesite.modules.sys.utils.DictUtils;
import javax.servlet.http.HttpServletRequest;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -42,11 +41,13 @@ import java.util.Map;
@RequestMapping(value = "${adminPath}/cms/category")
public class CategoryController extends BaseController {
@Autowired
private CategoryService categoryService;
private final CategoryService categoryService;
private final FileTemplateService fileTemplateService;
@Autowired
private FileTemplateService fileTemplateService;
public CategoryController(CategoryService categoryService, FileTemplateService fileTemplateService) {
this.categoryService = categoryService;
this.fileTemplateService = fileTemplateService;
}
/**
* 获取数据
@@ -108,7 +109,6 @@ public class CategoryController extends BaseController {
/**
* 查看编辑表单
* @throws IOException
*/
@RequiresPermissions("cms:category:view")
@RequestMapping(value = "form")
@@ -121,7 +121,7 @@ public class CategoryController extends BaseController {
Category categoryChild = new Category();
categoryChild.setParent(new Category(category.getParentCode()));
List<Category> list = categoryService.findList(category);
if (list.size() > 0) {
if (!list.isEmpty()) {
category.setTreeSort(list.get(list.size() - 1).getTreeSort());
if (category.getTreeSort() != null) {
category.setTreeSort(category.getTreeSort() + 30);
@@ -274,7 +274,6 @@ public class CategoryController extends BaseController {
* 获取树结构数据
* @param excludeCode 排除的Code
* @param isShowCode 是否显示编码true or 1显示在左侧2显示在右侧false or null不显示
* @return
*/
@RequiresPermissions(value = {"cms:category:view", "cms:article:view"}, logical = Logical.OR)
@RequestMapping(value = "treeData")

View File

@@ -19,19 +19,28 @@ import com.jeesite.common.web.BaseController;
@Controller
@RequestMapping(value = "${adminPath}/cms")
public class CmsIndexController extends BaseController {
/**
* 管理内容页
*/
@RequiresPermissions("cms:view")
@RequestMapping(value = "index")
public String index() {
return "modules/cms/cmsIndex";
}
/**
* 查看内容页
*/
@RequiresPermissions("cms:view")
@RequestMapping(value = "view")
public String view(Model model) {
return "modules/cms/cmsView";
}
/**
* 空内容页面
*/
@RequiresPermissions("cms:view")
@RequestMapping(value = "none")
public String none() {

View File

@@ -4,11 +4,14 @@
*/
package com.jeesite.modules.cms.web;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.cms.entity.Comment;
import com.jeesite.modules.cms.service.CommentService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -17,12 +20,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.cms.entity.Comment;
import com.jeesite.modules.cms.service.CommentService;
/**
* 文章评论表Controller
* @author 长春叭哥、ThinkGem
@@ -32,9 +29,12 @@ import com.jeesite.modules.cms.service.CommentService;
@RequestMapping(value = "${adminPath}/cms/comment")
public class CommentController extends BaseController {
@Autowired
private CommentService commentService;
private final CommentService commentService;
public CommentController(CommentService commentService) {
this.commentService = commentService;
}
/**
* 获取数据
*/
@@ -120,5 +120,5 @@ public class CommentController extends BaseController {
commentService.delete(comment);
return renderResult(Global.TRUE, text("删除文章评论表成功!"));
}
}

View File

@@ -11,7 +11,6 @@ import com.jeesite.modules.cms.entity.FileTemplate;
import com.jeesite.modules.cms.entity.Site;
import com.jeesite.modules.cms.service.FileTemplateService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -30,15 +29,24 @@ import java.util.Map;
@RequestMapping(value = "${adminPath}/cms/template")
public class FileTemplateController extends BaseController {
@Autowired
private FileTemplateService fileTemplateService;
private final FileTemplateService fileTemplateService;
public FileTemplateController(FileTemplateService fileTemplateService) {
this.fileTemplateService = fileTemplateService;
}
/**
* 模版管理页
*/
@RequiresPermissions("cms:template:edit")
@RequestMapping(value = { "list", "" })
public String index() {
return "modules/cms/tplIndex";
}
/**
* 模版查看页
*/
@RequiresPermissions("cms:template:edit")
@RequestMapping(value = "form")
public String form(String name, Model model) throws IOException {
@@ -75,6 +83,9 @@ public class FileTemplateController extends BaseController {
return renderResult(Global.FALSE, "模版文件不存在!");
}*/
/**
* 模版帮助页
*/
@RequiresPermissions("cms:template:edit")
@RequestMapping(value = "help")
public String help() {

View File

@@ -4,11 +4,14 @@
*/
package com.jeesite.modules.cms.web;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.cms.entity.Report;
import com.jeesite.modules.cms.service.ReportService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -17,12 +20,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.cms.entity.Report;
import com.jeesite.modules.cms.service.ReportService;
/**
* 内容举报表Controller
* @author 长春叭哥、ThinkGem
@@ -32,9 +29,12 @@ import com.jeesite.modules.cms.service.ReportService;
@RequestMapping(value = "${adminPath}/cms/report")
public class ReportController extends BaseController {
@Autowired
private ReportService reportService;
private final ReportService reportService;
public ReportController(ReportService reportService) {
this.reportService = reportService;
}
/**
* 获取数据
*/
@@ -120,5 +120,5 @@ public class ReportController extends BaseController {
reportService.delete(report);
return renderResult(Global.TRUE, text("删除内容举报表成功!"));
}
}

View File

@@ -13,7 +13,6 @@ import com.jeesite.modules.cms.service.FileTemplateService;
import com.jeesite.modules.cms.service.SiteService;
import com.jeesite.modules.sys.utils.UserUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -35,11 +34,13 @@ import java.io.IOException;
@RequestMapping(value = "${adminPath}/cms/site")
public class SiteController extends BaseController {
@Autowired
private SiteService siteService;
private final SiteService siteService;
private final FileTemplateService fileTemplateService;
@Autowired
private FileTemplateService fileTemplateService;
public SiteController(SiteService siteService, FileTemplateService fileTemplateService) {
this.siteService = siteService;
this.fileTemplateService = fileTemplateService;
}
/**
* 获取数据

View File

@@ -16,13 +16,12 @@ import com.jeesite.modules.cms.service.CategoryService;
import com.jeesite.modules.cms.service.CommentService;
import com.jeesite.modules.cms.utils.CmsUtils;
import com.jeesite.modules.sys.utils.ValidCodeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
@@ -35,12 +34,15 @@ import java.util.List;
@RequestMapping(value = "${frontPath}")
public class FrontController extends BaseController {
@Autowired
private CategoryService categoryService;
@Autowired
private ArticleService articleService;
@Autowired
private CommentService commentService;
private final CategoryService categoryService;
private final ArticleService articleService;
private final CommentService commentService;
public FrontController(CategoryService categoryService, ArticleService articleService, CommentService commentService) {
this.categoryService = categoryService;
this.articleService = articleService;
this.commentService = commentService;
}
/**
* 主站首页
@@ -75,7 +77,7 @@ public class FrontController extends BaseController {
// 否则显示子站第一个栏目
List<Category> mainNavList = CmsUtils.getMainNavList(siteCode);
if (mainNavList.size() > 0) {
if (!mainNavList.isEmpty()) {
String firstCategoryCode = CmsUtils.getMainNavList(siteCode).get(0).getId();
return REDIRECT + frontPath + "/list-" + firstCategoryCode + ".html";
}
@@ -142,7 +144,7 @@ public class FrontController extends BaseController {
if (Category.SHOW_MODES_CENTENT_LIST.equals(category.getShowModes()) || categoryList.size() <= 1) {
// 有子栏目并展现方式为2则获取第一个子栏目无子栏目则获取同级分类列表。
if (categoryList.size() > 0) {
if (!categoryList.isEmpty()) {
category = categoryList.get(0);
}
@@ -231,15 +233,15 @@ public class FrontController extends BaseController {
// 文章模型
if ("article".equals(category.getModuleType())) {
// // 获取当前级别的栏目列表
// List<Category> categoryList = Lists.newArrayList();
//// if (category.getIsRoot()){
//// categoryList.add(category);
//// }else{
//// categoryList = categoryService.findListByParentCode(category.getParentCode(), category.getSite().getId());
// categoryList = CmsUtils.getCategoryList(category.getSite().getSiteCode(), category.getParentCode(), -1, null);
//// }
// model.addAttribute("categoryList", categoryList);
/*// 获取当前级别的栏目列表
List<Category> categoryList = ListUtils.newArrayList();
// if (category.getIsRoot()){
// categoryList.add(category);
// }else{
// categoryList = categoryService.findListByParentCode(category.getParentCode(), category.getSite().getId());
categoryList = CmsUtils.getCategoryList(category.getSite().getSiteCode(), category.getParentCode(), -1, null);
// }
model.addAttribute("categoryList", categoryList);*/
// 获取文章
Article article = null;
@@ -254,7 +256,7 @@ public class FrontController extends BaseController {
Article entity = new Article(category);
entity.setPage(page);
page = articleService.findPage(entity);
if (page.getList().size() > 0) {
if (!page.getList().isEmpty()) {
article = page.getList().get(0);
article.setArticleData(articleService.get(new ArticleData(article.getId())));
}

View File

@@ -4,16 +4,6 @@
*/
package com.jeesite.modules.cmsfront.web;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.jeesite.common.collect.MapUtils;
import com.jeesite.common.entity.Page;
import com.jeesite.common.lang.StringUtils;
@@ -22,6 +12,13 @@ import com.jeesite.common.web.BaseController;
import com.jeesite.modules.cms.entity.Site;
import com.jeesite.modules.cms.service.ArticleService;
import com.jeesite.modules.cms.utils.CmsUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.Map;
/**
* 网站搜索Controller
@@ -32,9 +29,12 @@ import com.jeesite.modules.cms.utils.CmsUtils;
@RequestMapping(value = "${frontPath}/search")
public class FrontSearchController extends BaseController{
@Autowired
private ArticleService articleService;
private final ArticleService articleService;
public FrontSearchController(ArticleService articleService) {
this.articleService = articleService;
}
/**
* 全站搜索
* @param t 搜索类型(article、guestbook)

View File

@@ -20,6 +20,8 @@ import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* CAS过滤器
@@ -29,6 +31,7 @@ import javax.servlet.http.HttpServletResponse;
@SuppressWarnings("deprecation")
public class CasFilter extends CasBaseFilter {
private static final Logger logger = LoggerFactory.getLogger(CasFilter.class);
private BaseAuthorizingRealm authorizingRealm;
public CasFilter() {
@@ -65,7 +68,7 @@ public class CasFilter extends CasBaseFilter {
WebUtils.issueRedirect(request, response, getLoginUrl());
}
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getMessage(), e);
}
return false;
}

View File

@@ -9,15 +9,15 @@ import com.jeesite.common.config.Global;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.web.http.ServletUtils;
import com.jeesite.common.web.http.wrapper.GetHttpServletRequestWrapper;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.UnauthorizedException;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.util.WebUtils;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
@@ -34,10 +34,6 @@ public class PermissionsFilter extends org.apache.shiro.web.filter.authz.Permiss
/**
* 无访问权限时跳转到403页面
* @param request
* @param response
* @return
* @throws IOException
* @author ThinkGem
*/
public static boolean redirectTo403Page(ServletRequest request, ServletResponse response) throws IOException {

View File

@@ -18,8 +18,6 @@ public class FileType {
/**
* 根据给定的文件名,获取其后缀信息
* @param filename
* @return
*/
public static String getSuffixByFilename(String filename) {
return filename.substring(filename.lastIndexOf(".")).toLowerCase();

View File

@@ -18,37 +18,35 @@ public interface BizCategoryService extends TreeServiceApi<BizCategory> {
/**
* 获取单条数据
* @param bpmCategory
* @return
* @param bpmCategory 主键
*/
@Override
BizCategory get(BizCategory bpmCategory);
/**
* 查询列表数据
* @param bpmCategory
* @return
* @param bpmCategory 查询条件
*/
@Override
List<BizCategory> findList(BizCategory bpmCategory);
/**
* 保存数据(插入或更新)
* @param bpmCategory
* @param bpmCategory 数据对象
*/
@Override
void save(BizCategory bpmCategory);
/**
* 更新状态
* @param bpmCategory
* @param bpmCategory 数据对象
*/
@Override
void updateStatus(BizCategory bpmCategory);
/**
* 删除数据
* @param bpmCategory
* @param bpmCategory 数据对象
*/
@Override
void delete(BizCategory bpmCategory);

View File

@@ -22,8 +22,7 @@ public class BizCategoryServiceSupport extends TreeService<BizCategoryDao, BizCa
/**
* 获取单条数据
* @param bizCategory
* @return
* @param bizCategory 主键编码
*/
@Override
public BizCategory get(BizCategory bizCategory) {
@@ -32,8 +31,7 @@ public class BizCategoryServiceSupport extends TreeService<BizCategoryDao, BizCa
/**
* 查询列表数据
* @param bizCategory
* @return
* @param bizCategory 查询条件
*/
@Override
public List<BizCategory> findList(BizCategory bizCategory) {
@@ -42,7 +40,7 @@ public class BizCategoryServiceSupport extends TreeService<BizCategoryDao, BizCa
/**
* 保存数据(插入或更新)
* @param bizCategory
* @param bizCategory 数据对象
*/
@Override
@Transactional
@@ -56,7 +54,7 @@ public class BizCategoryServiceSupport extends TreeService<BizCategoryDao, BizCa
/**
* 更新状态
* @param bizCategory
* @param bizCategory 数据对象
*/
@Override
@Transactional
@@ -66,7 +64,7 @@ public class BizCategoryServiceSupport extends TreeService<BizCategoryDao, BizCa
/**
* 删除数据
* @param bizCategory
* @param bizCategory 数据对象
*/
@Override
@Transactional

View File

@@ -14,7 +14,6 @@ import com.jeesite.modules.biz.entity.BizCategory;
import com.jeesite.modules.biz.service.BizCategoryService;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -37,9 +36,12 @@ import java.util.Map;
@RequestMapping(value = "${adminPath}/biz/bizCategory")
public class BizCategoryController extends BaseController {
@Autowired
private BizCategoryService bizCategoryService;
private final BizCategoryService bizCategoryService;
public BizCategoryController(BizCategoryService bizCategoryService) {
this.bizCategoryService = bizCategoryService;
}
/**
* 获取数据
*/
@@ -191,7 +193,6 @@ public class BizCategoryController extends BaseController {
* @param excludeCode 排除的Code
* @param parentCode 设置父级编码返回一级
* @param isShowCode 是否显示编码true or 1显示在左侧2显示在右侧false or null不显示
* @return
*/
@RequiresPermissions("biz:bizCategory:view")
@RequestMapping(value = "treeData")

View File

@@ -10,16 +10,15 @@ import com.jeesite.common.web.BaseController;
import com.jeesite.modules.file.entity.FileUpload;
import com.jeesite.modules.file.entity.FileUploadParams;
import com.jeesite.modules.file.service.FileUploadService;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@@ -33,9 +32,12 @@ import java.util.Map;
@ConditionalOnProperty(name={"file.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class FileUploadController extends BaseController {
@Autowired
private FileUploadService fileUploadService;
private final FileUploadService fileUploadService;
public FileUploadController(FileUploadService fileUploadService) {
this.fileUploadService = fileUploadService;
}
/**
* 上传文件参数
*/

View File

@@ -21,8 +21,7 @@ public interface MsgInnerService extends CrudServiceApi<MsgInner> {
/**
* 获取单条数据
* @param msgInner
* @return
* @param msgInner 主键
*/
@Override
MsgInner get(MsgInner msgInner);
@@ -30,7 +29,6 @@ public interface MsgInnerService extends CrudServiceApi<MsgInner> {
/**
* 查询分页数据
* @param msgInner 查询条件; page 分页对象
* @return
*/
@Override
Page<MsgInner> findPage(MsgInner msgInner);
@@ -42,7 +40,7 @@ public interface MsgInnerService extends CrudServiceApi<MsgInner> {
/**
* 保存数据(插入或更新)
* @param msgInner
* @param msgInner 数据对象
*/
@Override
@Transactional
@@ -56,7 +54,7 @@ public interface MsgInnerService extends CrudServiceApi<MsgInner> {
/**
* 更新状态
* @param msgInner
* @param msgInner 数据对象
*/
@Override
@Transactional
@@ -64,7 +62,7 @@ public interface MsgInnerService extends CrudServiceApi<MsgInner> {
/**
* 删除数据
* @param msgInner
* @param msgInner 数据对象
*/
@Override
@Transactional

View File

@@ -52,8 +52,7 @@ public class MsgInnerServiceSupport extends CrudService<MsgInnerDao, MsgInner>
/**
* 获取单条数据
* @param msgInner
* @return
* @param msgInner 主键
*/
@Override
public MsgInner get(MsgInner msgInner) {
@@ -63,7 +62,6 @@ public class MsgInnerServiceSupport extends CrudService<MsgInnerDao, MsgInner>
/**
* 查询分页数据
* @param msgInner 查询条件; page 分页对象
* @return
*/
@Override
public Page<MsgInner> findPage(MsgInner msgInner) {
@@ -82,7 +80,7 @@ public class MsgInnerServiceSupport extends CrudService<MsgInnerDao, MsgInner>
/**
* 保存数据(插入或更新)
* @param msgInner
* @param msgInner 数据对象
*/
@Override
@Transactional
@@ -225,7 +223,7 @@ public class MsgInnerServiceSupport extends CrudService<MsgInnerDao, MsgInner>
/**
* 更新状态
* @param msgInner
* @param msgInner 数据对象
*/
@Override
@Transactional
@@ -235,7 +233,7 @@ public class MsgInnerServiceSupport extends CrudService<MsgInnerDao, MsgInner>
/**
* 删除数据
* @param msgInner
* @param msgInner 数据对象
*/
@Override
@Transactional

View File

@@ -12,8 +12,9 @@ import com.jeesite.modules.msg.entity.MsgInner;
import com.jeesite.modules.msg.entity.MsgInnerRecord;
import com.jeesite.modules.msg.entity.MsgPush;
import com.jeesite.modules.msg.service.MsgInnerService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -23,9 +24,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 内部消息Controller
* @author ThinkGem
@@ -36,9 +34,12 @@ import javax.servlet.http.HttpServletResponse;
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class MsgInnerController extends BaseController {
@Autowired
private MsgInnerService msgInnerService;
private final MsgInnerService msgInnerService;
public MsgInnerController(MsgInnerService msgInnerService) {
this.msgInnerService = msgInnerService;
}
/**
* 获取数据
*/

View File

@@ -240,7 +240,6 @@ public class Log extends DataEntity<Log> {
/**
* 设置请求参数
* @param paramsMap
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public void setRequestParams(Map paramsMap){
@@ -275,8 +274,6 @@ public class Log extends DataEntity<Log> {
/**
* 根据名称获取参数只有先执行setParams(Map)后才有效)
* @param name
* @return
*/
public String getRequestParam(String name) {
if (paramsMap == null){

View File

@@ -22,6 +22,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
/**
* 组织机构Entity
* @author ThinkGem
@@ -224,7 +225,6 @@ public class Office extends TreeEntity<Office> {
* 2、例如当前机构类型为部门的子部门你想获取部门所在省公司名称
* 3、例如当前机构类型为小组你想获取所在公司名称
* @param type 机构类型
* @return
*/
@JsonIgnore
public Office getParentByType(String type){

View File

@@ -15,10 +15,10 @@ import com.jeesite.modules.sys.entity.*;
import com.jeesite.modules.sys.service.CompanyService;
import com.jeesite.modules.sys.service.EmployeeService;
import com.jeesite.modules.sys.service.OfficeService;
import javax.servlet.http.HttpServletRequest;
import org.apache.shiro.session.Session;
import org.springframework.core.NamedThreadLocal;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Set;
@@ -113,7 +113,6 @@ public class EmpUtils {
/**
* 根据机构编码获取机构对象
* @param officeCode
* @author ThinkGem
*/
public static Office getOffice(String officeCode){
@@ -269,7 +268,6 @@ public class EmpUtils {
/**
* 根据公司编码获取公司对象
* @param companyCode
* @author ThinkGem
*/
public static Company getCompany(String companyCode){
@@ -354,7 +352,6 @@ public class EmpUtils {
/**
* 获取当前员工岗位(返回岗位编码和名称)
* @return
*/
public static List<EmployeePost> getEmployeePostList(){
return UserUtils.computeIfAbsentCache(CACHE_EMPLOYEE_POST_LIST, k ->
@@ -363,8 +360,6 @@ public class EmpUtils {
/**
* 根据员工编号,获取员工岗位(返回岗位编码和名称)
* @param empCode
* @return
*/
public static List<EmployeePost> getEmployeePostList(String empCode){
Employee employee = new Employee();
@@ -386,7 +381,6 @@ public class EmpUtils {
/**
* 获取当前登录用户的部门代码
* @return
*/
public static String getCurrentOfficeCode() {
String officeCode = StringUtils.EMPTY;
@@ -413,7 +407,6 @@ public class EmpUtils {
/**
* 获取当前登录用户的部门名称
* @return
*/
public static String getCurrentOfficeName() {
String officeName = StringUtils.EMPTY;

View File

@@ -69,7 +69,6 @@ public class LogUtils {
/**
* 保存日志
* @param executeTime
*/
public static void saveLog(User user, HttpServletRequest request, Object handler, Exception ex, String logTitle, String logType, long executeTime){
if (user == null || StringUtils.isBlank(user.getUserCode()) || request == null

View File

@@ -23,7 +23,6 @@ import com.jeesite.modules.sys.utils.UserUtils;
import com.jeesite.modules.sys.utils.ValidCodeUtils;
import io.swagger.annotations.*;
import org.apache.shiro.authc.AuthenticationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -52,8 +51,11 @@ import java.util.stream.Collectors;
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class AccountController extends BaseController{
@Autowired
private UserService userService;
private final UserService userService;
public AccountController(UserService userService) {
this.userService = userService;
}
/**
* 获取登录短信或邮件验证码
@@ -325,9 +327,6 @@ public class AccountController extends BaseController{
/**
* 校验密保问题答案
* @param user
* @param request
* @return
*/
@PostMapping(value = "savePwdByPwdQuestion")
@ResponseBody

View File

@@ -16,7 +16,6 @@ import com.jeesite.modules.sys.service.AreaService;
import com.jeesite.modules.sys.utils.AreaUtils;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -42,9 +41,12 @@ import java.util.Map;
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class AreaController extends BaseController {
@Autowired
private AreaService areaService;
private final AreaService areaService;
public AreaController(AreaService areaService) {
this.areaService = areaService;
}
/**
* 获取区域
*/
@@ -68,7 +70,6 @@ public class AreaController extends BaseController {
/**
* 区域列表
* @param area
*/
@RequiresPermissions("sys:area:view")
@RequestMapping(value = "list")
@@ -79,7 +80,6 @@ public class AreaController extends BaseController {
/**
* 查询区域数据
* @param area
*/
@RequiresPermissions("sys:area:view")
@RequestMapping(value = "listData")
@@ -114,7 +114,6 @@ public class AreaController extends BaseController {
/**
* 查看编辑区域
* @param area
*/
@RequiresPermissions("sys:area:view")
@RequestMapping(value = "form")
@@ -156,7 +155,6 @@ public class AreaController extends BaseController {
/**
* 保存区域
* @param area
*/
@RequiresPermissions("sys:area:edit")
@PostMapping(value = "save")
@@ -168,7 +166,6 @@ public class AreaController extends BaseController {
/**
* 停用区域
* @param area
*/
@RequiresPermissions("sys:area:edit")
@RequestMapping(value = "disable")
@@ -188,7 +185,6 @@ public class AreaController extends BaseController {
/**
* 启用区域
* @param area
*/
@RequiresPermissions("sys:area:edit")
@RequestMapping(value = "enable")
@@ -201,7 +197,6 @@ public class AreaController extends BaseController {
/**
* 删除区域
* @param area
*/
@RequiresPermissions("sys:area:edit")
@RequestMapping(value = "delete")
@@ -215,7 +210,6 @@ public class AreaController extends BaseController {
* 获取区域树结构数据
* @param excludeCode 排除的Code
* @param isShowCode 是否显示编码true or 1显示在左侧2显示在右侧false or null不显示
* @return
*/
@RequiresPermissions("user")
@RequestMapping(value = "treeData")

View File

@@ -4,20 +4,6 @@
*/
package com.jeesite.modules.sys.web;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.collect.MapUtils;
import com.jeesite.common.entity.Page;
@@ -26,12 +12,22 @@ import com.jeesite.common.lang.ObjectUtils;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.utils.excel.ExcelExport;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.sys.entity.Menu;
import com.jeesite.modules.sys.entity.Audit;
import com.jeesite.modules.sys.entity.Menu;
import com.jeesite.modules.sys.service.AuditService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 安全审计Controller
* @author ThinkGem
@@ -43,8 +39,11 @@ import springfox.documentation.annotations.ApiIgnore;
@ApiIgnore
public class AuditController extends BaseController {
@Autowired
private AuditService auditService;
private final AuditService auditService;
public AuditController(AuditService auditService) {
this.auditService = auditService;
}
/**
* 安全审计列表

View File

@@ -1,20 +1,19 @@
package com.jeesite.modules.sys.web;
import javax.annotation.PostConstruct;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jeesite.common.cache.CacheUtils;
import com.jeesite.common.config.Global;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.mybatis.mapper.MapperHelper;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.sys.utils.UserUtils;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.PostConstruct;
/**
* 缓存管理
@@ -28,7 +27,6 @@ public class CacheController extends BaseController {
/**
* 清理全部缓存,可清理属性文件里的缓存
* @return
*/
@RequiresPermissions(value={"sys:config:edit", "sys:state:cache"}, logical=Logical.OR)
@RequestMapping(value = "clearAll")

View File

@@ -18,7 +18,6 @@ import com.jeesite.modules.sys.service.EmpUserService;
import com.jeesite.modules.sys.service.OfficeService;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -43,12 +42,15 @@ import java.util.Map;
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class CompanyController extends BaseController {
@Autowired
private CompanyService companyService;
@Autowired
private OfficeService officeService;
@Autowired
private EmpUserService empUserService;
private final CompanyService companyService;
private final OfficeService officeService;
private final EmpUserService empUserService;
public CompanyController(CompanyService companyService, OfficeService officeService, EmpUserService empUserService) {
this.companyService = companyService;
this.officeService = officeService;
this.empUserService = empUserService;
}
/**
* 获取公司
@@ -74,7 +76,6 @@ public class CompanyController extends BaseController {
/**
* 公司列表
* @param company
*/
@RequiresPermissions("sys:company:view")
@RequestMapping(value = "list")
@@ -86,7 +87,6 @@ public class CompanyController extends BaseController {
/**
* 查询公司数据
* @param company
*/
@RequiresPermissions("sys:company:view")
@RequestMapping(value = "listData")
@@ -109,7 +109,6 @@ public class CompanyController extends BaseController {
/**
* 查看编辑公司
* @param company
*/
@RequiresPermissions("sys:company:view")
@RequestMapping(value = "form")
@@ -165,7 +164,6 @@ public class CompanyController extends BaseController {
/**
* 保存公司
* @param company
*/
@RequiresPermissions("sys:company:edit")
@PostMapping(value = "save")
@@ -177,7 +175,6 @@ public class CompanyController extends BaseController {
/**
* 停用公司
* @param company
*/
@RequiresPermissions("sys:company:edit")
@RequestMapping(value = "disable")
@@ -197,7 +194,6 @@ public class CompanyController extends BaseController {
/**
* 启用公司
* @param company
*/
@RequiresPermissions("sys:company:edit")
@RequestMapping(value = "enable")
@@ -210,7 +206,6 @@ public class CompanyController extends BaseController {
/**
* 删除公司
* @param company
*/
@RequiresPermissions("sys:company:edit")
@RequestMapping(value = "delete")
@@ -235,7 +230,6 @@ public class CompanyController extends BaseController {
* @param isAll 是否显示所有机构true不进行权限过滤
* @param isShowCode 是否显示编码true or 1显示在左侧2显示在右侧false or null不显示
* @param isShowFullName 是否显示全公司名称
* @return
*/
@RequiresPermissions("user")
@RequestMapping(value = "treeData")

View File

@@ -4,11 +4,13 @@
*/
package com.jeesite.modules.sys.web;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.sys.entity.Config;
import com.jeesite.modules.sys.service.ConfigService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -17,20 +19,15 @@ import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.sys.entity.Config;
import com.jeesite.modules.sys.service.ConfigService;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 参数设置Controller
* @author ThinkGem
* @version 2014-07-31
* @version 2019-07-31
*/
@Controller
@RequestMapping(value = "${adminPath}/sys/config")
@@ -38,13 +35,14 @@ import springfox.documentation.annotations.ApiIgnore;
@ApiIgnore
public class ConfigController extends BaseController {
@Autowired
private ConfigService configService;
private final ConfigService configService;
public ConfigController(ConfigService configService) {
this.configService = configService;
}
/**
* 获取数据
* @param id
* @return
*/
@ModelAttribute
public Config get(String id, boolean isNewRecord) {
@@ -53,9 +51,6 @@ public class ConfigController extends BaseController {
/**
* 查询列表
* @param config
* @param model
* @return
*/
@RequiresPermissions("sys:config:view")
@RequestMapping(value = "list")
@@ -66,10 +61,6 @@ public class ConfigController extends BaseController {
/**
* 查询列表
* @param config
* @param request
* @param response
* @return
*/
@RequiresPermissions("sys:config:view")
@RequestMapping(value = "listData")
@@ -82,9 +73,6 @@ public class ConfigController extends BaseController {
/**
* 查看编辑表单
* @param config
* @param model
* @return
*/
@RequiresPermissions("sys:config:view")
@RequestMapping(value = "form")
@@ -95,8 +83,6 @@ public class ConfigController extends BaseController {
/**
* 保存数据
* @param config
* @return
*/
@RequiresPermissions("sys:config:edit")
@PostMapping(value = "save")
@@ -136,8 +122,6 @@ public class ConfigController extends BaseController {
/**
* 删除数据
* @param config
* @return
*/
@RequiresPermissions("sys:config:edit")
@RequestMapping(value = "delete")

View File

@@ -16,7 +16,6 @@ import com.jeesite.modules.sys.service.DictDataService;
import com.jeesite.modules.sys.service.DictTypeService;
import com.jeesite.modules.sys.utils.DictUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -43,11 +42,14 @@ import java.util.Map;
@ApiIgnore
public class DictDataController extends BaseController {
@Autowired
private DictDataService dictDataService;
@Autowired
private DictTypeService dictTypeService;
private final DictDataService dictDataService;
private final DictTypeService dictTypeService;
public DictDataController(DictDataService dictDataService, DictTypeService dictTypeService) {
this.dictDataService = dictDataService;
this.dictTypeService = dictTypeService;
}
/**
* 获取数据
*/
@@ -176,7 +178,6 @@ public class DictDataController extends BaseController {
/**
* 停用字典
* @param dictData
*/
@RequiresPermissions("sys:dictData:edit")
@RequestMapping(value = "disable")
@@ -201,7 +202,6 @@ public class DictDataController extends BaseController {
/**
* 启用字典
* @param dictData
*/
@RequiresPermissions("sys:dictData:edit")
@RequestMapping(value = "enable")
@@ -283,7 +283,6 @@ public class DictDataController extends BaseController {
/**
* 树结构数据修复
* @return
*/
@RequiresPermissions("sys:dictData:edit")
@RequestMapping(value = "fixTreeData")

View File

@@ -4,24 +4,6 @@
*/
package com.jeesite.modules.sys.web;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.collect.MapUtils;
import com.jeesite.common.config.Global;
@@ -30,13 +12,23 @@ import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.sys.entity.DictType;
import com.jeesite.modules.sys.service.DictTypeService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 字典分类管理Controller
* @author ThinkGem
* @version 2017-3-24
* @version 2019-3-24
*/
@Controller
@RequestMapping(value = "${adminPath}/sys/dictType")
@@ -44,9 +36,12 @@ import springfox.documentation.annotations.ApiIgnore;
@ApiIgnore
public class DictTypeController extends BaseController {
@Autowired
private DictTypeService dictTypeService;
private final DictTypeService dictTypeService;
public DictTypeController(DictTypeService dictTypeService) {
this.dictTypeService = dictTypeService;
}
/**
* 获取数据
*/
@@ -111,7 +106,6 @@ public class DictTypeController extends BaseController {
/**
* 验证字段类型是否有效
* @return
*/
@RequiresPermissions("sys:dictType:edit")
@RequestMapping(value = "checkDictType")

View File

@@ -4,12 +4,12 @@
*/
package com.jeesite.modules.sys.web;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jeesite.common.entity.Page;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.sys.entity.Log;
import com.jeesite.modules.sys.service.LogService;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -17,10 +17,8 @@ import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jeesite.common.entity.Page;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.sys.entity.Log;
import com.jeesite.modules.sys.service.LogService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 日志Controller
@@ -33,9 +31,12 @@ import com.jeesite.modules.sys.service.LogService;
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class LogController extends BaseController {
@Autowired
private LogService logService;
private final LogService logService;
public LogController(LogService logService) {
this.logService = logService;
}
/**
* 获取数据
*/

View File

@@ -15,7 +15,6 @@ import com.jeesite.modules.sys.service.MenuService;
import com.jeesite.modules.sys.service.ModuleService;
import com.jeesite.modules.sys.utils.UserUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -42,10 +41,13 @@ import java.util.Map;
@ApiIgnore
public class MenuController extends BaseController {
@Autowired
private MenuService menuService;
@Autowired
private ModuleService moduleService;
private final MenuService menuService;
private final ModuleService moduleService;
public MenuController(MenuService menuService, ModuleService moduleService) {
this.menuService = menuService;
this.moduleService = moduleService;
}
@ModelAttribute
public Menu get(String menuCode, boolean isNewRecord, HttpServletRequest request) {
@@ -202,7 +204,6 @@ public class MenuController extends BaseController {
* 返回树结构数据
* @param excludeCode 排除的编码
* @param isShowRawName 是否显示原文默认false
* @return
*/
@RequiresPermissions("sys:menu:view")
@RequestMapping(value = "treeData")

View File

@@ -15,7 +15,6 @@ import com.jeesite.modules.gen.utils.GenUtils;
import com.jeesite.modules.sys.entity.Module;
import com.jeesite.modules.sys.service.ModuleService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -44,13 +43,14 @@ import java.util.stream.Collectors;
@ApiIgnore
public class ModuleController extends BaseController {
@Autowired
private ModuleService moduleService;
private final ModuleService moduleService;
public ModuleController(ModuleService moduleService) {
this.moduleService = moduleService;
}
/**
* 获取数据
* @param moduleCode
* @return
*/
@ModelAttribute
public Module get(String moduleCode, boolean isNewRecord) {
@@ -59,9 +59,6 @@ public class ModuleController extends BaseController {
/**
* 查询列表
* @param module
* @param model
* @return
*/
@RequiresPermissions("sys:module:view")
@RequestMapping(value = "list")
@@ -73,10 +70,6 @@ public class ModuleController extends BaseController {
/**
* 查询列表
* @param module
* @param request
* @param response
* @return
*/
@RequiresPermissions("sys:module:view")
@RequestMapping(value = "listData")
@@ -104,9 +97,6 @@ public class ModuleController extends BaseController {
/**
* 查看编辑表单
* @param module
* @param model
* @return
*/
@RequiresPermissions("sys:module:view")
@RequestMapping(value = "form")
@@ -132,8 +122,6 @@ public class ModuleController extends BaseController {
/**
* 保存数据
* @param module
* @return
*/
@RequiresPermissions("sys:module:edit")
@PostMapping(value = "save")
@@ -159,7 +147,6 @@ public class ModuleController extends BaseController {
/**
* 验证编码是否有效
* @return
*/
@RequiresPermissions("sys:module:edit")
@RequestMapping(value = "checkModuleCode")
@@ -177,8 +164,6 @@ public class ModuleController extends BaseController {
/**
* 停用数据
* @param module
* @return
*/
@RequiresPermissions("sys:module:edit")
@RequestMapping(value = "disable")
@@ -197,8 +182,6 @@ public class ModuleController extends BaseController {
/**
* 启用数据
* @param module
* @return
*/
@RequiresPermissions("sys:module:edit")
@RequestMapping(value = "enable")
@@ -214,8 +197,6 @@ public class ModuleController extends BaseController {
/**
* 删除数据
* @param module
* @return
*/
@RequiresPermissions("sys:module:edit")
@RequestMapping(value = "delete")

View File

@@ -20,7 +20,6 @@ import com.jeesite.modules.sys.service.OfficeService;
import com.jeesite.modules.sys.web.user.EmpUserController;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -47,12 +46,15 @@ import java.util.Map;
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class OfficeController extends BaseController {
@Autowired
private OfficeService officeService;
@Autowired
private EmpUserService empUserService;
@Autowired
private EmpUserController empUserController;
private final OfficeService officeService;
private final EmpUserService empUserService;
private final EmpUserController empUserController;
public OfficeController(OfficeService officeService, EmpUserService empUserService, EmpUserController empUserController) {
this.officeService = officeService;
this.empUserService = empUserService;
this.empUserController = empUserController;
}
/**
* 获取机构
@@ -78,7 +80,6 @@ public class OfficeController extends BaseController {
/**
* 机构列表
* @param office
*/
@RequiresPermissions("sys:office:view")
@RequestMapping(value = "list")
@@ -90,7 +91,6 @@ public class OfficeController extends BaseController {
/**
* 查询机构数据
* @param office
*/
@RequiresPermissions("sys:office:view")
@RequestMapping(value = "listData")
@@ -115,7 +115,6 @@ public class OfficeController extends BaseController {
/**
* 查看编辑机构
* @param office
*/
@RequiresPermissions("sys:office:view")
@RequestMapping(value = "form")
@@ -173,7 +172,6 @@ public class OfficeController extends BaseController {
/**
* 保存机构
* @param office
*/
@RequiresPermissions("sys:office:edit")
@PostMapping(value = "save")
@@ -232,7 +230,6 @@ public class OfficeController extends BaseController {
/**
* 停用机构
* @param office
*/
@RequiresPermissions("sys:office:edit")
@RequestMapping(value = "disable")
@@ -252,7 +249,6 @@ public class OfficeController extends BaseController {
/**
* 启用机构
* @param office
*/
@RequiresPermissions("sys:office:edit")
@RequestMapping(value = "enable")
@@ -265,7 +261,6 @@ public class OfficeController extends BaseController {
/**
* 删除机构
* @param office
*/
@RequiresPermissions("sys:office:edit")
@RequestMapping(value = "delete")
@@ -295,7 +290,6 @@ public class OfficeController extends BaseController {
* @param isLoadUser 是否加载机构下的用户true 一次性加载lazy 懒加载,点击再加载)
* @param postCode 机构下的用户过滤岗位
* @param roleCode 机构下的用户过滤角色
* @return
*/
@RequiresPermissions("user")
@RequestMapping(value = "treeData")

View File

@@ -20,7 +20,6 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.subject.support.DefaultSubjectContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -44,13 +43,15 @@ import java.util.Map;
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class OnlineController extends BaseController{
@Autowired
private SessionDAO sessionDAO;
private final SessionDAO sessionDAO;
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
public OnlineController(SessionDAO sessionDAO) {
this.sessionDAO = sessionDAO;
}
/**
* 在线用户数
* @param request
* @param response
* @author ThinkGem
*/
@RequiresPermissions("user")
@@ -63,7 +64,6 @@ public class OnlineController extends BaseController{
/**
* 在线用户列表
* @param model
*/
@RequiresPermissions("sys:online:view")
@RequestMapping(value = "list")

View File

@@ -15,7 +15,6 @@ import com.jeesite.modules.sys.entity.PostRole;
import com.jeesite.modules.sys.service.PostService;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -41,8 +40,11 @@ import java.util.Map;
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class PostController extends BaseController {
@Autowired
private PostService postService;
private final PostService postService;
public PostController(PostService postService) {
this.postService = postService;
}
@ModelAttribute
public Post get(String postCode, boolean isNewRecord) {
@@ -131,9 +133,6 @@ public class PostController extends BaseController {
/**
* 验证岗位名是否有效
* @param oldPostName
* @param postName
* @return
*/
@RequiresPermissions("user")
@RequestMapping(value = "checkPostName")
@@ -152,7 +151,6 @@ public class PostController extends BaseController {
/**
* 获取岗位树结构数据
* @param isShowCode 是否显示编码true or 1显示在左侧2显示在右侧false or null不显示
* @return
*/
@RequiresPermissions("user")
@RequestMapping(value = "treeData")

View File

@@ -19,7 +19,6 @@ import com.jeesite.modules.sys.utils.DictUtils;
import com.jeesite.modules.sys.utils.ModuleUtils;
import com.jeesite.modules.sys.utils.RoleUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -46,11 +45,13 @@ import java.util.Map;
@ApiIgnore
public class RoleController extends BaseController {
@Autowired
private RoleService roleService;
@Autowired
private MenuService menuService;
private final RoleService roleService;
private final MenuService menuService;
public RoleController(RoleService roleService, MenuService menuService) {
this.roleService = roleService;
this.menuService = menuService;
}
@ModelAttribute
public Role get(String roleCode, boolean isNewRecord) {
@@ -120,9 +121,6 @@ public class RoleController extends BaseController {
/**
* 验证角色名是否有效
* @param oldRoleName
* @param roleName
* @return
*/
@RequiresPermissions("user")
@RequestMapping(value = "checkRoleName")
@@ -140,8 +138,6 @@ public class RoleController extends BaseController {
/**
* 停用角色
* @param role
* @return
*/
@RequiresPermissions("sys:role:edit")
@RequestMapping(value = "disable")
@@ -159,8 +155,6 @@ public class RoleController extends BaseController {
/**
* 启用角色
* @param role
* @return
*/
@RequiresPermissions("sys:role:edit")
@RequestMapping(value = "enable")
@@ -178,8 +172,6 @@ public class RoleController extends BaseController {
/**
* 删除角色
* @param role
* @return
*/
@RequiresPermissions("sys:role:edit")
@RequestMapping(value = "delete")
@@ -202,9 +194,6 @@ public class RoleController extends BaseController {
/**
* 判断某用户是包含某角色
* @param userCode
* @param roleCode
* @return
*/
@RequiresPermissions("user")
@RequestMapping(value = "hasUserRole")
@@ -219,7 +208,6 @@ public class RoleController extends BaseController {
/**
* 查询菜单的树结构数据
* @param role
*/
@RequiresPermissions("sys:role:view")
@RequestMapping(value = "menuTreeData")
@@ -265,8 +253,6 @@ public class RoleController extends BaseController {
/**
* 查询角色的菜单树结构数据
* @param roleCode
* @param sysCode
*/
@RequiresPermissions("sys:role:view")
@RequestMapping(value = "menuTreeDataByRoleCode")
@@ -351,7 +337,6 @@ public class RoleController extends BaseController {
* 获取角色树结构数据
* @param isAll 是否显示所有机构true不进行权限过滤
* @param isShowCode 是否显示编码true or 1显示在左侧2显示在右侧false or null不显示
* @return
*/
@RequiresPermissions("user")
@RequestMapping(value = "treeData")

View File

@@ -40,8 +40,11 @@ import java.util.Set;
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
public class SwitchController extends BaseController{
@Autowired
private PostService postService;
private final PostService postService;
public SwitchController(PostService postService) {
this.postService = postService;
}
/**
* 切换系统菜单(菜单归属子系统)

View File

@@ -20,7 +20,6 @@ import com.jeesite.modules.sys.utils.UserUtils;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.session.Session;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -43,10 +42,13 @@ import java.util.Map;
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class CorpAdminController extends BaseController {
@Autowired
private UserService userService;
@Autowired
private RoleService roleService;
private final UserService userService;
private final RoleService roleService;
public CorpAdminController(UserService userService, RoleService roleService) {
this.userService = userService;
this.roleService = roleService;
}
@ModelAttribute
public User get(String userCode, boolean isNewRecord) {
@@ -156,8 +158,6 @@ public class CorpAdminController extends BaseController {
/**
* 停用用户
* @param user
* @return
*/
@RequiresPermissions("sys:corpAdmin:edit")
@ResponseBody
@@ -176,8 +176,6 @@ public class CorpAdminController extends BaseController {
/**
* 启用用户
* @param user
* @return
*/
@RequiresPermissions("sys:corpAdmin:edit")
@ResponseBody
@@ -193,8 +191,6 @@ public class CorpAdminController extends BaseController {
/**
* 密码重置
* @param user
* @return
*/
@RequiresPermissions("sys:corpAdmin:edit")
@RequestMapping(value = "resetpwd")
@@ -209,8 +205,6 @@ public class CorpAdminController extends BaseController {
/**
* 删除用户
* @param user
* @return
*/
@RequiresPermissions("sys:corpAdmin:edit")
@RequestMapping(value = "delete")
@@ -238,7 +232,6 @@ public class CorpAdminController extends BaseController {
* 查询租户数据树格式
* @param pId 父级编码,默认 -1
* @param isShowCode 是否显示编码true or 1显示在左侧2显示在右侧false or null不显示
* @return
*/
//@RequiresPermissions("user") // 注释掉允许配置URI控制权限
@RequestMapping(value = "treeData")
@@ -260,8 +253,6 @@ public class CorpAdminController extends BaseController {
/**
* 切换租户
* @param corpCode
* @return
*/
@RequiresPermissions("sys:corpAdmin:edit")
@RequestMapping(value = "switch/{corpCode}")

View File

@@ -31,7 +31,6 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -57,16 +56,20 @@ import java.util.concurrent.atomic.AtomicReference;
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class EmpUserController extends BaseController {
@Autowired
private EmpUserService empUserService;
@Autowired
private EmployeeService employeeService;
@Autowired
private PostService postService;
@Autowired
private UserService userService;
@Autowired
private RoleService roleService;
private final EmpUserService empUserService;
private final EmployeeService employeeService;
private final PostService postService;
private final UserService userService;
private final RoleService roleService;
public EmpUserController(EmpUserService empUserService, EmployeeService employeeService,
PostService postService, UserService userService, RoleService roleService) {
this.empUserService = empUserService;
this.employeeService = employeeService;
this.postService = postService;
this.userService = userService;
this.roleService = roleService;
}
@ModelAttribute
public EmpUser get(String userCode, boolean isNewRecord, Boolean isAll, String ctrlPermi) {
@@ -205,9 +208,6 @@ public class EmpUserController extends BaseController {
/**
* 验证工号是否有效
* @param oldEmpNo
* @param empNo
* @return
*/
@RequiresPermissions("user")
@RequestMapping(value = "checkEmpNo")
@@ -279,8 +279,6 @@ public class EmpUserController extends BaseController {
/**
* 停用用户
* @param empUser
* @return
*/
@RequiresPermissions("sys:empUser:updateStatus")
@ResponseBody
@@ -303,8 +301,6 @@ public class EmpUserController extends BaseController {
/**
* 启用用户
* @param empUser
* @return
*/
@RequiresPermissions("sys:empUser:updateStatus")
@ResponseBody
@@ -325,8 +321,6 @@ public class EmpUserController extends BaseController {
/**
* 密码重置
* @param empUser
* @return
*/
@RequiresPermissions("sys:empUser:resetpwd")
@RequestMapping(value = "resetpwd")
@@ -345,8 +339,6 @@ public class EmpUserController extends BaseController {
/**
* 删除用户
* @param empUser
* @return
*/
@RequiresPermissions("sys:empUser:edit")
@RequestMapping(value = "delete")
@@ -407,7 +399,6 @@ public class EmpUserController extends BaseController {
* @param roleCode 角色Code
* @param isAll 是否显示所有用户true不进行权限过滤
* @param isShowCode 是否显示编码true or 1显示在左侧2显示在右侧false or null不显示
* @return
*/
@RequiresPermissions("user")
@RequestMapping(value = "treeData")

View File

@@ -4,23 +4,6 @@
*/
package com.jeesite.modules.sys.web.user;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.mapper.JsonMapper;
@@ -29,6 +12,20 @@ import com.jeesite.modules.sys.entity.User;
import com.jeesite.modules.sys.entity.UserDataScope;
import com.jeesite.modules.sys.service.UserService;
import com.jeesite.modules.sys.utils.ModuleUtils;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 二级管理员Controller
@@ -41,8 +38,11 @@ import com.jeesite.modules.sys.utils.ModuleUtils;
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class SecAdminController extends BaseController {
@Autowired
private UserService userService;
private final UserService userService;
public SecAdminController(UserService userService) {
this.userService = userService;
}
@ModelAttribute
public User get(String userCode, boolean isNewRecord) {
@@ -84,8 +84,6 @@ public class SecAdminController extends BaseController {
/**
* 设置为二级管理员身份
* @param user
* @return
*/
@RequiresPermissions("sys:secAdmin:edit")
@PostMapping(value = "save")
@@ -104,8 +102,6 @@ public class SecAdminController extends BaseController {
/**
* 取消二级管理员身份
* @param user
* @return
*/
@RequiresPermissions("sys:secAdmin:edit")
@RequestMapping(value = "delete")

View File

@@ -17,7 +17,6 @@ import com.jeesite.modules.sys.service.UserService;
import com.jeesite.modules.sys.utils.PwdUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -41,8 +40,11 @@ import javax.servlet.http.HttpServletResponse;
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class UserController extends BaseController {
@Autowired
private UserService userService;
private final UserService userService;
public UserController(UserService userService) {
this.userService = userService;
}
/**
* 获取用户列表

View File

@@ -20,7 +20,6 @@ import javax.servlet.http.HttpServletResponse;
<% } %>
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -66,8 +65,11 @@ import ${packageName}.${moduleName}.service${subModuleNameDot}.${ClassName}Servi
@RequestMapping(value = "\${adminPath}/${urlPrefix}")
public class ${ClassName}Controller extends BaseController {
@Autowired
private ${ClassName}Service ${className}Service;
private final ${ClassName}Service ${className}Service;
public ${ClassName}Controller(${ClassName}Service ${className}Service) {
this.${className}Service = ${className}Service;
}
/**
* 获取数据
@@ -327,7 +329,6 @@ public class ${ClassName}Controller extends BaseController {
* @param excludeCode 排除的Code
* @param parentCode 设置父级编码返回一级
* @param isShowCode 是否显示编码true or 1显示在左侧2显示在右侧false or null不显示
* @return
*/
@RequiresPermissions("${permissionPrefix}:view")
@RequestMapping(value = "treeData")

View File

@@ -9,9 +9,6 @@
package ${packageName}.${moduleName}.service${subModuleNameDot};
import java.util.List;
<% if (table.childList.~size > 0){ %>
import org.springframework.beans.factory.annotation.Autowired;
<% } %>
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -53,14 +50,16 @@ import javax.validation.ConstraintViolationException;
public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Service<${ClassName}Dao, ${ClassName}> {
<% for (child in table.childList){ %>
@Autowired
private ${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao;
private final ${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao;
public ${ClassName}Service(${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao) {
this.${@StringUtils.uncap(child.className)}Dao = ${@StringUtils.uncap(child.className)}Dao;
}
<% } %>
/**
* 获取单条数据
* @param ${className}
* @return
* @param ${className} 主键
*/
@Override
public ${ClassName} get(${ClassName} ${className}) {
@@ -83,7 +82,6 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
* 查询分页数据
* @param ${className} 查询条件
* @param ${className} page 分页对象
* @return
*/
@Override
public Page<${ClassName}> findPage(${ClassName} ${className}) {
@@ -92,8 +90,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
/**
* 查询列表数据
* @param ${className}
* @return
* @param ${className} 查询条件
*/
@Override
public List<${ClassName}> findList(${ClassName} ${className}) {
@@ -105,7 +102,6 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
* 查询子表分页数据
* @param ${@StringUtils.uncap(child.className)}
* @param ${@StringUtils.uncap(child.className)} page 分页对象
* @return
*/
public Page<${@StringUtils.cap(child.className)}> findSubPage(${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)}) {
Page<${@StringUtils.cap(child.className)}> page = ${@StringUtils.uncap(child.className)}.getPage();
@@ -116,7 +112,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
/**
* 保存数据(插入或更新)
* @param ${className}
* @param ${className} 数据对象
*/
@Override
@Transactional
@@ -264,7 +260,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
/**
* 更新状态
* @param ${className}
* @param ${className} 数据对象
*/
@Override
@Transactional
@@ -274,7 +270,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
/**
* 删除数据
* @param ${className}
* @param ${className} 数据对象
*/
@Override
@Transactional

View File

@@ -20,7 +20,6 @@ import javax.servlet.http.HttpServletResponse;
<% } %>
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -57,7 +56,7 @@ import ${packageName}.${moduleName}.entity${subModuleNameDot}.${@StringUtils.cap
<% } %>
import ${packageName}.${moduleName}.service${subModuleNameDot}.${ClassName}Service;
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.seata.spring.annotation.GlobalTransactional;
/**
* ${functionName}Controller
@@ -68,8 +67,11 @@ import io.seata.spring.annotation.GlobalTransactional;
@RequestMapping(value = "\${adminPath}/${urlPrefix}")
public class ${ClassName}Controller extends BaseController {
@Autowired
private ${ClassName}Service ${className}Service;
private final ${ClassName}Service ${className}Service;
public ${ClassName}Controller(${ClassName}Service ${className}Service) {
this.${className}Service = ${className}Service;
}
/**
* 获取数据
@@ -334,7 +336,6 @@ public class ${ClassName}Controller extends BaseController {
* @param excludeCode 排除的Code
* @param parentCode 设置父级编码返回一级
* @param isShowCode 是否显示编码true or 1显示在左侧2显示在右侧false or null不显示
* @return
*/
@RequiresPermissions("${permissionPrefix}:view")
@RequestMapping(value = "treeData")

View File

@@ -9,9 +9,6 @@
package ${packageName}.${moduleName}.service${subModuleNameDot};
import java.util.List;
<% if (table.childList.~size > 0){ %>
import org.springframework.beans.factory.annotation.Autowired;
<% } %>
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RestController;
@@ -46,7 +43,7 @@ import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
<% } %>
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.seata.spring.annotation.GlobalTransactional;
/**
* ${functionName}Service
@@ -59,14 +56,16 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
implements ${ClassName}ServiceApi {
<% for (child in table.childList){ %>
@Autowired
private ${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao;
private final ${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao;
public ${ClassName}Service(${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao) {
this.${@StringUtils.uncap(child.className)}Dao = ${@StringUtils.uncap(child.className)}Dao;
}
<% } %>
/**
* 获取单条数据
* @param ${className}
* @return
* @param ${className} 主键
*/
@Override
public ${ClassName} get(${ClassName} ${className}) {
@@ -89,7 +88,6 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
* 查询分页数据
* @param ${className} 查询条件
* @param ${className} page 分页对象
* @return
*/
@Override
public Page<${ClassName}> findPage(${ClassName} ${className}) {
@@ -98,8 +96,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
/**
* 查询列表数据
* @param ${className}
* @return
* @param ${className} 查询条件
*/
@Override
public List<${ClassName}> findList(${ClassName} ${className}) {
@@ -111,7 +108,6 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
* 查询子表分页数据
* @param ${@StringUtils.uncap(child.className)}
* @param ${@StringUtils.uncap(child.className)} page 分页对象
* @return
*/
public Page<${@StringUtils.cap(child.className)}> findSubPage(${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)}) {
Page<${@StringUtils.cap(child.className)}> page = ${@StringUtils.uncap(child.className)}.getPage();
@@ -122,7 +118,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
/**
* 保存数据(插入或更新)
* @param ${className}
* @param ${className} 数据对象
*/
@Override
@GlobalTransactional
@@ -252,7 +248,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
/**
* 更新状态
* @param ${className}
* @param ${className} 数据对象
*/
@Override
@GlobalTransactional
@@ -263,7 +259,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
/**
* 删除数据
* @param ${className}
* @param ${className} 数据对象
*/
@Override
@GlobalTransactional

View File

@@ -18,7 +18,6 @@ import javax.servlet.http.HttpServletResponse;
<% } %>
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
@@ -51,8 +50,11 @@ import ${packageName}.${moduleName}.service${subModuleNameDot}.${ClassName}Servi
@RequestMapping(value = "\${adminPath}/${urlPrefix}")
public class ${ClassName}Controller extends BaseController {
@Autowired
private ${ClassName}Service ${className}Service;
private final ${ClassName}Service ${className}Service;
public ${ClassName}Controller(${ClassName}Service ${className}Service) {
this.${className}Service = ${className}Service;
}
/**
* 获取数据
@@ -167,7 +169,6 @@ public class ${ClassName}Controller extends BaseController {
* @param excludeCode 排除的Code
* @param parentCode 设置父级编码返回一级
* @param isShowCode 是否显示编码true or 1显示在左侧2显示在右侧false or null不显示
* @return
*/
@RequiresPermissions("${permissionPrefix}:view")
@RequestMapping(value = "treeData")

View File

@@ -9,9 +9,6 @@
package ${packageName}.${moduleName}.service${subModuleNameDot};
import java.util.List;
<% if (table.childList.~size > 0){ %>
import org.springframework.beans.factory.annotation.Autowired;
<% } %>
import org.springframework.stereotype.Service;
import com.jeesite.common.entity.Page;
@@ -32,14 +29,16 @@ import ${packageName}.${moduleName}.dao${subModuleNameDot}.${@StringUtils.cap(ch
public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Query'}Service<${ClassName}Dao, ${ClassName}> {
<% for (child in table.childList){ %>
@Autowired
private ${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao;
private final ${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao;
public ${ClassName}Service(${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao) {
this.${@StringUtils.uncap(child.className)}Dao = ${@StringUtils.uncap(child.className)}Dao;
}
<% } %>
/**
* 获取单条数据
* @param ${className}
* @return
* @param ${className} 主键
*/
@Override
public ${ClassName} get(${ClassName} ${className}) {
@@ -62,7 +61,6 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Query'}Ser
* 查询分页数据
* @param ${className} 查询条件
* @param ${className} page 分页对象
* @return
*/
@Override
public Page<${ClassName}> findPage(${ClassName} ${className}) {
@@ -71,8 +69,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Query'}Ser
/**
* 查询列表数据
* @param ${className}
* @return
* @param ${className} 查询条件
*/
@Override
public List<${ClassName}> findList(${ClassName} ${className}) {
@@ -82,9 +79,8 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Query'}Ser
/**
* 查询子表分页数据
* @param ${@StringUtils.uncap(child.className)}
* @param ${@StringUtils.uncap(child.className)} 查询条件
* @param ${@StringUtils.uncap(child.className)} page 分页对象
* @return
*/
public Page<${@StringUtils.cap(child.className)}> findSubPage(${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)}) {
Page<${@StringUtils.cap(child.className)}> page = ${@StringUtils.uncap(child.className)}.getPage();

View File

@@ -33,8 +33,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
/**
* 获取单条数据
* @param testData
* @return
* @param testData 主键
*/
@Override
public TestData get(TestData testData) {
@@ -55,9 +54,8 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
/**
* 查询分页数据
* @param testData
* @param testData 查询条件
* @param testData page 分页对象
* @return
*/
@Override
public Page<TestData> findPage(TestData testData) {
@@ -78,7 +76,6 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
* 查询子表分页数据
* @param testData 查询条件
* @param testData page 分页对象
* @return
*/
public List<TestDataChild> findSubList(TestDataChild testData) {
return testDataChildDao.findList(testData);
@@ -86,7 +83,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
/**
* 保存数据(插入或更新)
* @param testData
* @param testData 数据对象
*/
@Override
@Transactional
@@ -123,7 +120,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
/**
* 更新状态
* @param testData
* @param testData 数据对象
*/
@Override
@Transactional
@@ -133,7 +130,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
/**
* 删除数据
* @param testData
* @param testData 数据对象
*/
@Override
@Transactional

View File

@@ -23,8 +23,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
/**
* 获取单条数据
* @param testTree
* @return
* @param testTree 主键
*/
@Override
public TestTree get(TestTree testTree) {
@@ -33,8 +32,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
/**
* 查询列表数据
* @param testTree
* @return
* @param testTree 查询条件
*/
@Override
public List<TestTree> findList(TestTree testTree) {
@@ -43,7 +41,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
/**
* 保存数据(插入或更新)
* @param testTree
* @param testTree 数据对象
*/
@Override
@Transactional
@@ -57,7 +55,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
/**
* 更新状态
* @param testTree
* @param testTree 数据对象
*/
@Override
@Transactional
@@ -67,7 +65,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
/**
* 删除数据
* @param testTree
* @param testTree 数据对象
*/
@Override
@Transactional

View File

@@ -4,19 +4,17 @@
*/
package com.jeesite.modules.test.web;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.test.entity.TestData;
import com.jeesite.modules.test.service.TestDataService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.test.entity.TestData;
import com.jeesite.modules.test.service.TestDataService;
/**
* 演示实例Controller
* @author ThinkGem
@@ -26,9 +24,12 @@ import com.jeesite.modules.test.service.TestDataService;
@RequestMapping(value = "${adminPath}/demo")
public class DemoController extends BaseController {
@Autowired
private TestDataService testDataService;
private final TestDataService testDataService;
public DemoController(TestDataService testDataService) {
this.testDataService = testDataService;
}
/**
* 获取数据
*/

View File

@@ -12,7 +12,6 @@ import com.jeesite.modules.test.entity.TestData;
import com.jeesite.modules.test.entity.TestDataChild;
import com.jeesite.modules.test.service.TestDataService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -34,9 +33,12 @@ import java.util.List;
@RequestMapping(value = "${adminPath}/test/testData")
public class TestDataController extends BaseController {
@Autowired
private TestDataService testDataService;
private final TestDataService testDataService;
public TestDataController(TestDataService testDataService) {
this.testDataService = testDataService;
}
/**
* 获取数据
*/

View File

@@ -13,7 +13,6 @@ import com.jeesite.common.web.BaseController;
import com.jeesite.modules.test.entity.TestTree;
import com.jeesite.modules.test.service.TestTreeService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -35,9 +34,12 @@ import java.util.Map;
@RequestMapping(value = "${adminPath}/test/testTree")
public class TestTreeController extends BaseController {
@Autowired
private TestTreeService testTreeService;
private final TestTreeService testTreeService;
public TestTreeController(TestTreeService testTreeService) {
this.testTreeService = testTreeService;
}
/**
* 获取数据
*/
@@ -186,7 +188,6 @@ public class TestTreeController extends BaseController {
* 获取树结构数据
* @param excludeCode 排除的Code
* @param isShowCode 是否显示编码true or 1显示在左侧2显示在右侧false or null不显示
* @return
*/
@RequiresPermissions("test:testTree:view")
@RequestMapping(value = "treeData")