Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yaru
fgqyxxlr
Commits
ecfba426
Commit
ecfba426
authored
Nov 13, 2018
by
CharlesSong
Committed by
若依
Nov 13, 2018
Browse files
Options
Browse Files
Download
Plain Diff
!34 BaseController迁移到framework模块的com.ruoyi.web.base路径下
Merge pull request !34 from CharlesSong/master
parents
737c2d85
26b4f598
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
184 additions
and
184 deletions
+184
-184
pom.xml
+1
-0
ruoyi-admin/pom.xml
+1
-12
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/DruidController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysJobController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysJobLogController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysCaptchaController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/BuildController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/GenController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java
+1
-1
ruoyi-framework/pom.xml
+9
-0
ruoyi-framework/src/main/java/com/ruoyi/framework/web/base/BaseController.java
+150
-149
No files found.
pom.xml
View file @
ecfba426
...
...
@@ -24,6 +24,7 @@
<bitwalker.version>
1.19
</bitwalker.version>
<kaptcha.version>
2.3.2
</kaptcha.version>
<swagger.version>
2.7.0
</swagger.version>
<pagehelper.boot.version>
1.2.5
</pagehelper.boot.version>
</properties>
<dependencyManagement>
...
...
ruoyi-admin/pom.xml
View file @
ecfba426
...
...
@@ -14,11 +14,7 @@
<description>
web服务入口
</description>
<properties>
<pagehelper.boot.version>
1.2.5
</pagehelper.boot.version>
<swagger.version>
2.7.0
</swagger.version>
</properties>
<dependencies>
...
...
@@ -28,13 +24,6 @@
<artifactId>
spring-boot-devtools
</artifactId>
<optional>
true
</optional>
<!-- 表示依赖不会传递 -->
</dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<version>
${pagehelper.boot.version}
</version>
</dependency>
<!-- swagger2-->
<dependency>
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/DruidController.java
View file @
ecfba426
...
...
@@ -4,7 +4,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* druid 监控
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysJobController.java
View file @
ecfba426
...
...
@@ -18,7 +18,7 @@ import com.ruoyi.framework.util.ShiroUtils;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.quartz.domain.SysJob
;
import
com.ruoyi.quartz.service.ISysJobService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 调度任务信息操作处理
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysJobLogController.java
View file @
ecfba426
...
...
@@ -15,7 +15,7 @@ import com.ruoyi.common.utils.ExcelUtil;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.quartz.domain.SysJobLog
;
import
com.ruoyi.quartz.service.ISysJobLogService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 调度日志操作处理
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java
View file @
ecfba426
...
...
@@ -15,7 +15,7 @@ import com.ruoyi.common.utils.ExcelUtil;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.system.domain.SysLogininfor
;
import
com.ruoyi.system.service.ISysLogininforService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 系统访问记录
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java
View file @
ecfba426
...
...
@@ -17,7 +17,7 @@ import com.ruoyi.common.utils.ExcelUtil;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.system.domain.SysOperLog
;
import
com.ruoyi.system.service.ISysOperLogService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 操作日志记录
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
View file @
ecfba426
...
...
@@ -19,7 +19,7 @@ import com.ruoyi.framework.util.ShiroUtils;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.system.domain.SysUserOnline
;
import
com.ruoyi.system.service.impl.SysUserOnlineServiceImpl
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 在线用户监控
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysCaptchaController.java
View file @
ecfba426
...
...
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.servlet.ModelAndView
;
import
com.google.code.kaptcha.Constants
;
import
com.google.code.kaptcha.Producer
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 图片验证码(支持算术形式)
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
View file @
ecfba426
...
...
@@ -18,7 +18,7 @@ import com.ruoyi.framework.util.ShiroUtils;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.system.domain.SysConfig
;
import
com.ruoyi.system.service.ISysConfigService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 参数配置 信息操作处理
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
View file @
ecfba426
...
...
@@ -19,7 +19,7 @@ import com.ruoyi.framework.util.ShiroUtils;
import
com.ruoyi.system.domain.SysDept
;
import
com.ruoyi.system.domain.SysRole
;
import
com.ruoyi.system.service.ISysDeptService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 部门信息
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
View file @
ecfba426
...
...
@@ -18,7 +18,7 @@ import com.ruoyi.framework.util.ShiroUtils;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.system.domain.SysDictData
;
import
com.ruoyi.system.service.ISysDictDataService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 数据字典信息
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
View file @
ecfba426
...
...
@@ -18,7 +18,7 @@ import com.ruoyi.framework.util.ShiroUtils;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.system.domain.SysDictType
;
import
com.ruoyi.system.service.ISysDictTypeService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 数据字典信息
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java
View file @
ecfba426
...
...
@@ -9,7 +9,7 @@ import com.ruoyi.common.config.Global;
import
com.ruoyi.system.domain.SysMenu
;
import
com.ruoyi.system.domain.SysUser
;
import
com.ruoyi.system.service.ISysMenuService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 首页 业务处理
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
View file @
ecfba426
...
...
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
com.ruoyi.common.base.AjaxResult
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.framework.util.ServletUtils
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 登录验证
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java
View file @
ecfba426
...
...
@@ -18,7 +18,7 @@ import com.ruoyi.framework.util.ShiroUtils;
import
com.ruoyi.system.domain.SysMenu
;
import
com.ruoyi.system.domain.SysRole
;
import
com.ruoyi.system.service.ISysMenuService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 菜单信息
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java
View file @
ecfba426
...
...
@@ -17,7 +17,7 @@ import com.ruoyi.framework.util.ShiroUtils;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.system.domain.SysNotice
;
import
com.ruoyi.system.service.ISysNoticeService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 公告 信息操作处理
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
View file @
ecfba426
...
...
@@ -18,7 +18,7 @@ import com.ruoyi.framework.util.ShiroUtils;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.system.domain.SysPost
;
import
com.ruoyi.system.service.ISysPostService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 岗位信息操作处理
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
View file @
ecfba426
...
...
@@ -23,7 +23,7 @@ import com.ruoyi.framework.util.ShiroUtils;
import
com.ruoyi.system.domain.SysUser
;
import
com.ruoyi.system.service.ISysDictDataService
;
import
com.ruoyi.system.service.ISysUserService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 个人信息 业务处理
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
View file @
ecfba426
...
...
@@ -19,7 +19,7 @@ import com.ruoyi.framework.util.ShiroUtils;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.system.domain.SysRole
;
import
com.ruoyi.system.service.ISysRoleService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 角色信息
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
View file @
ecfba426
...
...
@@ -23,7 +23,7 @@ import com.ruoyi.system.domain.SysUser;
import
com.ruoyi.system.service.ISysPostService
;
import
com.ruoyi.system.service.ISysRoleService
;
import
com.ruoyi.system.service.ISysUserService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 用户信息
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/BuildController.java
View file @
ecfba426
...
...
@@ -4,7 +4,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* build 表单构建
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/GenController.java
View file @
ecfba426
...
...
@@ -18,7 +18,7 @@ import com.ruoyi.common.support.Convert;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.generator.domain.TableInfo
;
import
com.ruoyi.generator.service.IGenService
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* 代码生成 操作处理
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java
View file @
ecfba426
...
...
@@ -4,7 +4,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
/**
* swagger 接口
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java
View file @
ecfba426
...
...
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ruoyi.common.base.AjaxResult
;
import
com.ruoyi.
web.core
.base.BaseController
;
import
com.ruoyi.
framework.web
.base.BaseController
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
ruoyi-framework/pom.xml
View file @
ecfba426
...
...
@@ -111,6 +111,14 @@
<version>
${ruoyi.version}
</version>
</dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<version>
${pagehelper.boot.version}
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
ruoyi-
admin/src/main/java/com/ruoyi/web/core
/base/BaseController.java
→
ruoyi-
framework/src/main/java/com/ruoyi/framework/web
/base/BaseController.java
View file @
ecfba426
package
com
.
ruoyi
.
web
.
core
.
base
;
import
java.util.Date
;
import
java.util.List
;
import
java.beans.PropertyEditorSupport
;
import
org.springframework.web.bind.WebDataBinder
;
import
org.springframework.web.bind.annotation.InitBinder
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.ruoyi.common.base.AjaxResult
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.framework.util.ShiroUtils
;
import
com.ruoyi.framework.web.page.PageDomain
;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.framework.web.page.TableSupport
;
import
com.ruoyi.system.domain.SysUser
;
/**
* web层通用数据处理
*
* @author ruoyi
*/
public
class
BaseController
{
/**
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
*/
@InitBinder
public
void
initBinder
(
WebDataBinder
binder
)
{
// Date 类型转换
binder
.
registerCustomEditor
(
Date
.
class
,
new
PropertyEditorSupport
()
{
@Override
public
void
setAsText
(
String
text
)
{
setValue
(
DateUtils
.
parseDate
(
text
));
}
});
}
/**
* 设置请求分页数据
*/
protected
void
startPage
()
{
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
Integer
pageNum
=
pageDomain
.
getPageNum
();
Integer
pageSize
=
pageDomain
.
getPageSize
();
if
(
StringUtils
.
isNotNull
(
pageNum
)
&&
StringUtils
.
isNotNull
(
pageSize
))
{
String
orderBy
=
pageDomain
.
getOrderBy
();
PageHelper
.
startPage
(
pageNum
,
pageSize
,
orderBy
);
}
}
/**
* 响应请求分页数据
*/
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
protected
TableDataInfo
getDataTable
(
List
<?>
list
)
{
TableDataInfo
rspData
=
new
TableDataInfo
();
rspData
.
setCode
(
0
);
rspData
.
setRows
(
list
);
rspData
.
setTotal
(
new
PageInfo
(
list
).
getTotal
());
return
rspData
;
}
/**
* 响应返回结果
*
* @param rows 影响行数
* @return 操作结果
*/
protected
AjaxResult
toAjax
(
int
rows
)
{
return
rows
>
0
?
success
()
:
error
();
}
/**
* 返回成功
*/
public
AjaxResult
success
()
{
return
AjaxResult
.
success
();
}
/**
* 返回失败消息
*/
public
AjaxResult
error
()
{
return
AjaxResult
.
error
();
}
/**
* 返回成功消息
*/
public
AjaxResult
success
(
String
message
)
{
return
AjaxResult
.
success
(
message
);
}
/**
* 返回失败消息
*/
public
AjaxResult
error
(
String
message
)
{
return
AjaxResult
.
error
(
message
);
}
/**
* 返回错误码消息
*/
public
AjaxResult
error
(
int
code
,
String
message
)
{
return
AjaxResult
.
error
(
code
,
message
);
}
/**
* 页面跳转
*/
public
String
redirect
(
String
url
)
{
return
StringUtils
.
format
(
"redirect:{}"
,
url
);
}
public
SysUser
getUser
()
{
return
ShiroUtils
.
getUser
();
}
public
void
setUser
(
SysUser
user
)
{
ShiroUtils
.
setUser
(
user
);
}
public
Long
getUserId
()
{
return
getUser
().
getUserId
();
}
public
String
getLoginName
()
{
return
getUser
().
getLoginName
();
}
}
package
com
.
ruoyi
.
framework
.
web
.
base
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.ruoyi.common.base.AjaxResult
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.framework.util.ShiroUtils
;
import
com.ruoyi.framework.web.page.PageDomain
;
import
com.ruoyi.framework.web.page.TableDataInfo
;
import
com.ruoyi.framework.web.page.TableSupport
;
import
com.ruoyi.system.domain.SysUser
;
import
org.springframework.web.bind.WebDataBinder
;
import
org.springframework.web.bind.annotation.InitBinder
;
import
java.beans.PropertyEditorSupport
;
import
java.util.Date
;
import
java.util.List
;
/**
* web层通用数据处理
*
* @author ruoyi
*/
public
class
BaseController
{
/**
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
*/
@InitBinder
public
void
initBinder
(
WebDataBinder
binder
)
{
// Date 类型转换
binder
.
registerCustomEditor
(
Date
.
class
,
new
PropertyEditorSupport
()
{
@Override
public
void
setAsText
(
String
text
)
{
setValue
(
DateUtils
.
parseDate
(
text
));
}
});
}
/**
* 设置请求分页数据
*/
protected
void
startPage
()
{
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
Integer
pageNum
=
pageDomain
.
getPageNum
();
Integer
pageSize
=
pageDomain
.
getPageSize
();
if
(
StringUtils
.
isNotNull
(
pageNum
)
&&
StringUtils
.
isNotNull
(
pageSize
))
{
String
orderBy
=
pageDomain
.
getOrderBy
();
PageHelper
.
startPage
(
pageNum
,
pageSize
,
orderBy
);
}
}
/**
* 响应请求分页数据
*/
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
protected
TableDataInfo
getDataTable
(
List
<?>
list
)
{
TableDataInfo
rspData
=
new
TableDataInfo
();
rspData
.
setCode
(
0
);
rspData
.
setRows
(
list
);
rspData
.
setTotal
(
new
PageInfo
(
list
).
getTotal
());
return
rspData
;
}
/**
* 响应返回结果
*
* @param rows 影响行数
* @return 操作结果
*/
protected
AjaxResult
toAjax
(
int
rows
)
{
return
rows
>
0
?
success
()
:
error
();
}
/**
* 返回成功
*/
public
AjaxResult
success
()
{
return
AjaxResult
.
success
();
}
/**
* 返回失败消息
*/
public
AjaxResult
error
()
{
return
AjaxResult
.
error
();
}
/**
* 返回成功消息
*/
public
AjaxResult
success
(
String
message
)
{
return
AjaxResult
.
success
(
message
);
}
/**
* 返回失败消息
*/
public
AjaxResult
error
(
String
message
)
{
return
AjaxResult
.
error
(
message
);
}
/**
* 返回错误码消息
*/
public
AjaxResult
error
(
int
code
,
String
message
)
{
return
AjaxResult
.
error
(
code
,
message
);
}
/**
* 页面跳转
*/
public
String
redirect
(
String
url
)
{
return
StringUtils
.
format
(
"redirect:{}"
,
url
);
}
public
SysUser
getUser
()
{
return
ShiroUtils
.
getUser
();
}
public
void
setUser
(
SysUser
user
)
{
ShiroUtils
.
setUser
(
user
);
}
public
Long
getUserId
()
{
return
getUser
().
getUserId
();
}
public
String
getLoginName
()
{
return
getUser
().
getLoginName
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment