修改返回结果为泛型方式
This commit is contained in:
@ -6,6 +6,8 @@ import java.util.concurrent.TimeUnit;
|
||||
import javax.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.common.core.domain.model.Captcha;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.FastByteArrayOutputStream;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -43,13 +45,16 @@ public class CaptchaController
|
||||
* 生成验证码
|
||||
*/
|
||||
@GetMapping("/captchaImage")
|
||||
public AjaxResult getCode(HttpServletResponse response) throws IOException
|
||||
public AjaxResult<Captcha> getCode(HttpServletResponse response) throws IOException
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
Captcha captcha = new Captcha();
|
||||
AjaxResult<Captcha> ajax = AjaxResult.success(captcha);
|
||||
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
||||
ajax.put("captchaEnabled", captchaEnabled);
|
||||
if (!captchaEnabled)
|
||||
{
|
||||
|
||||
captcha.setCaptchaEnabled(captchaEnabled);
|
||||
|
||||
return ajax;
|
||||
}
|
||||
|
||||
@ -87,8 +92,8 @@ public class CaptchaController
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
|
||||
ajax.put("uuid", uuid);
|
||||
ajax.put("img", Base64.encode(os.toByteArray()));
|
||||
captcha.setUuid(uuid);
|
||||
captcha.setImg(Base64.encode(os.toByteArray()));
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.common.core.domain.model.Upload;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -22,13 +24,12 @@ import com.ruoyi.framework.config.ServerConfig;
|
||||
|
||||
/**
|
||||
* 通用请求处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common")
|
||||
public class CommonController
|
||||
{
|
||||
public class CommonController {
|
||||
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
|
||||
|
||||
@Autowired
|
||||
@ -38,17 +39,14 @@ public class CommonController
|
||||
|
||||
/**
|
||||
* 通用下载请求
|
||||
*
|
||||
*
|
||||
* @param fileName 文件名称
|
||||
* @param delete 是否删除
|
||||
* @param delete 是否删除
|
||||
*/
|
||||
@GetMapping("/download")
|
||||
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!FileUtils.checkAllowDownload(fileName))
|
||||
{
|
||||
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) {
|
||||
try {
|
||||
if (!FileUtils.checkAllowDownload(fileName)) {
|
||||
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
||||
}
|
||||
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
||||
@ -57,13 +55,10 @@ public class CommonController
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||
FileUtils.writeBytes(filePath, response.getOutputStream());
|
||||
if (delete)
|
||||
{
|
||||
if (delete) {
|
||||
FileUtils.deleteFile(filePath);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
@ -72,24 +67,20 @@ public class CommonController
|
||||
* 通用上传请求(单个)
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
public AjaxResult uploadFile(MultipartFile file) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
public AjaxResult uploadFile(MultipartFile file) throws Exception {
|
||||
try {
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Upload upload = new Upload();
|
||||
upload.setFileName(fileName);
|
||||
upload.setUrl(url);
|
||||
upload.setNewFileName(FileUtils.getName(fileName));
|
||||
upload.setOriginalFilename(file.getOriginalFilename());
|
||||
return AjaxResult.success(upload);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
@ -98,35 +89,25 @@ public class CommonController
|
||||
* 通用上传请求(多个)
|
||||
*/
|
||||
@PostMapping("/uploads")
|
||||
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception {
|
||||
try {
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
List<String> urls = new ArrayList<String>();
|
||||
List<String> fileNames = new ArrayList<String>();
|
||||
List<String> newFileNames = new ArrayList<String>();
|
||||
List<String> originalFilenames = new ArrayList<String>();
|
||||
for (MultipartFile file : files)
|
||||
{
|
||||
List<Upload> urls = new ArrayList<Upload>();
|
||||
|
||||
for (MultipartFile file : files) {
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
urls.add(url);
|
||||
fileNames.add(fileName);
|
||||
newFileNames.add(FileUtils.getName(fileName));
|
||||
originalFilenames.add(file.getOriginalFilename());
|
||||
Upload upload = new Upload();
|
||||
upload.setUrl(url);
|
||||
upload.setFileName(fileName);
|
||||
upload.setNewFileName(FileUtils.getName(fileName));
|
||||
upload.setOriginalFilename(file.getOriginalFilename());
|
||||
urls.add(upload);
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
|
||||
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
|
||||
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
|
||||
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return AjaxResult.success(urls);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
@ -136,12 +117,9 @@ public class CommonController
|
||||
*/
|
||||
@GetMapping("/download/resource")
|
||||
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!FileUtils.checkAllowDownload(resource))
|
||||
{
|
||||
throws Exception {
|
||||
try {
|
||||
if (!FileUtils.checkAllowDownload(resource)) {
|
||||
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
|
||||
}
|
||||
// 本地资源路径
|
||||
@ -153,9 +131,7 @@ public class CommonController
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, downloadName);
|
||||
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +1,9 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.Info;
|
||||
import com.ruoyi.common.core.domain.model.LoginBody;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
@ -21,8 +13,18 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.web.service.SysLoginService;
|
||||
import com.ruoyi.framework.web.service.SysPermissionService;
|
||||
import com.ruoyi.framework.web.service.TokenService;
|
||||
import com.ruoyi.system.domain.vo.RouterVo;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
@ -56,12 +58,12 @@ public class SysLoginController
|
||||
@PostMapping("/login")
|
||||
public AjaxResult login(@RequestBody LoginBody loginBody)
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
|
||||
// 生成令牌
|
||||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||
loginBody.getUuid());
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
return ajax;
|
||||
|
||||
return AjaxResult.success(token);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,7 +72,7 @@ public class SysLoginController
|
||||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping("getInfo")
|
||||
public AjaxResult getInfo()
|
||||
public AjaxResult<Info> getInfo()
|
||||
{
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
SysUser user = loginUser.getUser();
|
||||
@ -83,13 +85,13 @@ public class SysLoginController
|
||||
loginUser.setPermissions(permissions);
|
||||
tokenService.refreshToken(loginUser);
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("user", user);
|
||||
ajax.put("roles", roles);
|
||||
ajax.put("permissions", permissions);
|
||||
ajax.put("isDefaultModifyPwd", initPasswordIsModify(user.getPwdUpdateDate()));
|
||||
ajax.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
|
||||
return ajax;
|
||||
Info info = new Info();
|
||||
info.setUser(user);
|
||||
info.setRoles(roles);
|
||||
info.setPermissions(permissions);
|
||||
info.setIsDefaultModifyPwd(initPasswordIsModify(user.getPwdUpdateDate()));
|
||||
info.setIsPasswordExpired(passwordIsExpiration(user.getPwdUpdateDate()));
|
||||
return AjaxResult.success(info);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -98,7 +100,7 @@ public class SysLoginController
|
||||
* @return 路由信息
|
||||
*/
|
||||
@GetMapping("getRouters")
|
||||
public AjaxResult getRouters()
|
||||
public AjaxResult<List<RouterVo>> getRouters()
|
||||
{
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.model.MenuTreeselect;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -68,13 +70,13 @@ public class SysMenuController extends BaseController
|
||||
* 加载对应角色菜单列表树
|
||||
*/
|
||||
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
||||
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
|
||||
public AjaxResult<MenuTreeselect> roleMenuTreeselect(@PathVariable("roleId") Long roleId)
|
||||
{
|
||||
List<SysMenu> menus = menuService.selectMenuList(getUserId());
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
|
||||
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
|
||||
return ajax;
|
||||
MenuTreeselect menuTreeselect = new MenuTreeselect();
|
||||
menuTreeselect.setCheckedKeys(menuService.selectMenuListByRoleId(roleId));
|
||||
menuTreeselect.setMenus(menuService.buildMenuTreeSelect(menus));
|
||||
return AjaxResult.success(menuTreeselect);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -19,7 +19,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
import com.ruoyi.common.core.domain.model.SysPost;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,9 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.common.core.domain.model.SysUserExt;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -49,10 +52,11 @@ public class SysProfileController extends BaseController
|
||||
{
|
||||
LoginUser loginUser = getLoginUser();
|
||||
SysUser user = loginUser.getUser();
|
||||
AjaxResult ajax = AjaxResult.success(user);
|
||||
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
|
||||
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
|
||||
return ajax;
|
||||
SysUserExt sysUserExt = new SysUserExt();
|
||||
BeanUtils.copyProperties(user, sysUserExt);
|
||||
sysUserExt.setRoleGroup(userService.selectUserRoleGroup(loginUser.getUsername()));
|
||||
sysUserExt.setPostGroup(userService.selectUserPostGroup(loginUser.getUsername()));
|
||||
return AjaxResult.success(sysUserExt);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -122,7 +126,7 @@ public class SysProfileController extends BaseController
|
||||
*/
|
||||
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/avatar")
|
||||
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception
|
||||
public AjaxResult<String> avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception
|
||||
{
|
||||
if (!file.isEmpty())
|
||||
{
|
||||
@ -135,8 +139,8 @@ public class SysProfileController extends BaseController
|
||||
{
|
||||
FileUtils.deleteFile(RuoYiConfig.getProfile() + FileUtils.stripPrefix(oldAvatar));
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("imgUrl", avatar);
|
||||
AjaxResult<String> ajax = AjaxResult.success(avatar);
|
||||
|
||||
// 更新缓存用户头像
|
||||
loginUser.getUser().setAvatar(avatar);
|
||||
tokenService.setLoginUser(loginUser);
|
||||
|
@ -2,6 +2,8 @@ package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.common.core.domain.model.DeptTree;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -241,7 +243,7 @@ public class SysRoleController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/selectAll")
|
||||
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
|
||||
public AjaxResult<Integer> selectAuthUserAll(Long roleId, Long[] userIds)
|
||||
{
|
||||
roleService.checkRoleDataScope(roleId);
|
||||
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
||||
@ -252,11 +254,12 @@ public class SysRoleController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||
@GetMapping(value = "/deptTree/{roleId}")
|
||||
public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
|
||||
public AjaxResult<DeptTree> deptTree(@PathVariable("roleId") Long roleId)
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
||||
ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
|
||||
return ajax;
|
||||
|
||||
DeptTree deptTree = new DeptTree();
|
||||
deptTree.setCheckedKeys(deptService.selectDeptListByRoleId(roleId));
|
||||
deptTree.setDepts(deptService.selectDeptTreeList(new SysDept()));
|
||||
return AjaxResult.success(deptTree);
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,10 @@ package com.ruoyi.web.controller.system;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.common.core.domain.model.AuthRole;
|
||||
import com.ruoyi.common.core.domain.model.Info;
|
||||
import com.ruoyi.common.core.domain.model.Infos;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -98,22 +102,23 @@ public class SysUserController extends BaseController
|
||||
* 根据用户编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
@GetMapping(value = { "/", "/{userId}" })
|
||||
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
||||
@GetMapping(value = {"/{userId}" })
|
||||
public AjaxResult<Infos> getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
|
||||
Infos info = new Infos();
|
||||
if (StringUtils.isNotNull(userId))
|
||||
{
|
||||
userService.checkUserDataScope(userId);
|
||||
SysUser sysUser = userService.selectUserById(userId);
|
||||
ajax.put(AjaxResult.DATA_TAG, sysUser);
|
||||
ajax.put("postIds", postService.selectPostListByUserId(userId));
|
||||
ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
|
||||
info.setUser(sysUser);
|
||||
info.setPostIds(postService.selectPostListByUserId(userId));
|
||||
info.setRoleIds(sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
|
||||
}
|
||||
List<SysRole> roles = roleService.selectRoleAll();
|
||||
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||
ajax.put("posts", postService.selectPostAll());
|
||||
return ajax;
|
||||
info.setRoles(SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||
info.setPosts(postService.selectPostAll());
|
||||
return AjaxResult.success(info);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -222,12 +227,12 @@ public class SysUserController extends BaseController
|
||||
@GetMapping("/authRole/{userId}")
|
||||
public AjaxResult authRole(@PathVariable("userId") Long userId)
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
AuthRole authRole = new AuthRole();
|
||||
SysUser user = userService.selectUserById(userId);
|
||||
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
||||
ajax.put("user", user);
|
||||
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||
return ajax;
|
||||
authRole.setUser(user);
|
||||
authRole.setRoles(SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||
return AjaxResult.success(authRole);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -6,9 +6,9 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://192.168.1.210:33060/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: password
|
||||
password: Xueqiang1230@
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
@ -16,7 +16,7 @@ ruoyi:
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8080
|
||||
port: 8081
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
@ -68,11 +68,11 @@ spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: localhost
|
||||
host: 192.168.1.210
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
database: 2
|
||||
# 密码
|
||||
password:
|
||||
# 连接超时时间
|
||||
|
@ -10,18 +10,25 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class AjaxResult extends HashMap<String, Object>
|
||||
|
||||
public class AjaxResult<T>
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private int code;
|
||||
private String msg;
|
||||
private T data;
|
||||
// private String roleGroup;
|
||||
// private String postGroup;
|
||||
// private String imgUrl;
|
||||
|
||||
/** 状态码 */
|
||||
public static final String CODE_TAG = "code";
|
||||
|
||||
/** 返回内容 */
|
||||
public static final String MSG_TAG = "msg";
|
||||
|
||||
/** 数据对象 */
|
||||
public static final String DATA_TAG = "data";
|
||||
// /** 状态码 */
|
||||
// public static final String CODE_TAG = "code";
|
||||
//
|
||||
// /** 返回内容 */
|
||||
// public static final String MSG_TAG = "msg";
|
||||
//
|
||||
// /** 数据对象 */
|
||||
// public static final String DATA_TAG = "data";
|
||||
|
||||
/**
|
||||
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
|
||||
@ -38,8 +45,8 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*/
|
||||
public AjaxResult(int code, String msg)
|
||||
{
|
||||
super.put(CODE_TAG, code);
|
||||
super.put(MSG_TAG, msg);
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -49,14 +56,11 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
* @param msg 返回内容
|
||||
* @param data 数据对象
|
||||
*/
|
||||
public AjaxResult(int code, String msg, Object data)
|
||||
public AjaxResult(int code, String msg, T data)
|
||||
{
|
||||
super.put(CODE_TAG, code);
|
||||
super.put(MSG_TAG, msg);
|
||||
if (StringUtils.isNotNull(data))
|
||||
{
|
||||
super.put(DATA_TAG, data);
|
||||
}
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -64,7 +68,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult success()
|
||||
public static <T> AjaxResult<T> success()
|
||||
{
|
||||
return AjaxResult.success("操作成功");
|
||||
}
|
||||
@ -74,7 +78,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult success(Object data)
|
||||
public static <T> AjaxResult<T> success(T data)
|
||||
{
|
||||
return AjaxResult.success("操作成功", data);
|
||||
}
|
||||
@ -85,7 +89,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
* @param msg 返回内容
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult success(String msg)
|
||||
public static <T> AjaxResult<T> success(String msg)
|
||||
{
|
||||
return AjaxResult.success(msg, null);
|
||||
}
|
||||
@ -97,9 +101,9 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
* @param data 数据对象
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult success(String msg, Object data)
|
||||
public static <T> AjaxResult<T> success(String msg, T data)
|
||||
{
|
||||
return new AjaxResult(HttpStatus.SUCCESS, msg, data);
|
||||
return new AjaxResult<T>(HttpStatus.SUCCESS, msg, data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -108,7 +112,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
* @param msg 返回内容
|
||||
* @return 警告消息
|
||||
*/
|
||||
public static AjaxResult warn(String msg)
|
||||
public static <T> AjaxResult<T> warn(String msg)
|
||||
{
|
||||
return AjaxResult.warn(msg, null);
|
||||
}
|
||||
@ -120,9 +124,9 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
* @param data 数据对象
|
||||
* @return 警告消息
|
||||
*/
|
||||
public static AjaxResult warn(String msg, Object data)
|
||||
public static <T> AjaxResult<T> warn(String msg, T data)
|
||||
{
|
||||
return new AjaxResult(HttpStatus.WARN, msg, data);
|
||||
return new AjaxResult<T>(HttpStatus.WARN, msg, data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -130,7 +134,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*
|
||||
* @return 错误消息
|
||||
*/
|
||||
public static AjaxResult error()
|
||||
public static <T> AjaxResult<T> error()
|
||||
{
|
||||
return AjaxResult.error("操作失败");
|
||||
}
|
||||
@ -141,7 +145,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
* @param msg 返回内容
|
||||
* @return 错误消息
|
||||
*/
|
||||
public static AjaxResult error(String msg)
|
||||
public static <T> AjaxResult<T> error(String msg)
|
||||
{
|
||||
return AjaxResult.error(msg, null);
|
||||
}
|
||||
@ -153,7 +157,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
* @param data 数据对象
|
||||
* @return 错误消息
|
||||
*/
|
||||
public static AjaxResult error(String msg, Object data)
|
||||
public static <T> AjaxResult<T> error(String msg, Object data)
|
||||
{
|
||||
return new AjaxResult(HttpStatus.ERROR, msg, data);
|
||||
}
|
||||
@ -177,7 +181,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*/
|
||||
public boolean isSuccess()
|
||||
{
|
||||
return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG));
|
||||
return this.code == HttpStatus.SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -187,7 +191,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*/
|
||||
public boolean isWarn()
|
||||
{
|
||||
return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG));
|
||||
return this.code == HttpStatus.WARN;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -197,7 +201,31 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*/
|
||||
public boolean isError()
|
||||
{
|
||||
return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG));
|
||||
return this.code == HttpStatus.ERROR;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -207,10 +235,10 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
* @param value 值
|
||||
* @return 数据对象
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult put(String key, Object value)
|
||||
{
|
||||
super.put(key, value);
|
||||
return this;
|
||||
}
|
||||
// @Override
|
||||
// public AjaxResult put(String key, Object value)
|
||||
// {
|
||||
// super.put(key, value);
|
||||
// return this;
|
||||
// }
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class AuthRole implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private List<SysRole> roles;
|
||||
private SysUser user;
|
||||
|
||||
public List<SysRole> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(List<SysRole> roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public SysUser getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(SysUser user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 返回的验证码数据
|
||||
*/
|
||||
public class Captcha implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String img;
|
||||
private Boolean captchaEnabled;
|
||||
private String uuid;
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(String img) {
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public Boolean getCaptchaEnabled() {
|
||||
return captchaEnabled;
|
||||
}
|
||||
|
||||
public void setCaptchaEnabled(Boolean captchaEnabled) {
|
||||
this.captchaEnabled = captchaEnabled;
|
||||
}
|
||||
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
import com.ruoyi.common.core.domain.TreeSelect;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class DeptTree implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private List<Long> checkedKeys;
|
||||
private List<TreeSelect> depts;
|
||||
|
||||
public List<Long> getCheckedKeys() {
|
||||
return checkedKeys;
|
||||
}
|
||||
|
||||
public void setCheckedKeys(List<Long> checkedKeys) {
|
||||
this.checkedKeys = checkedKeys;
|
||||
}
|
||||
|
||||
public List<TreeSelect> getDepts() {
|
||||
return depts;
|
||||
}
|
||||
|
||||
public void setDepts(List<TreeSelect> depts) {
|
||||
this.depts = depts;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class Info implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Set<String> permissions;
|
||||
private Set<String> roles;
|
||||
private SysUser user;
|
||||
private boolean isDefaultModifyPwd;
|
||||
private boolean isPasswordExpired;
|
||||
private List<Long> postIds;
|
||||
private String roleIds;
|
||||
|
||||
|
||||
public Set<String> getPermissions() {
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(Set<String> permissions) {
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
public Set<String> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(Set<String> roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public SysUser getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(SysUser user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public boolean getIsDefaultModifyPwd() {
|
||||
return isDefaultModifyPwd;
|
||||
}
|
||||
|
||||
public void setIsDefaultModifyPwd(boolean isDefaultModifyPwd) {
|
||||
this.isDefaultModifyPwd = isDefaultModifyPwd;
|
||||
}
|
||||
|
||||
public boolean getIsPasswordExpired() {
|
||||
return isPasswordExpired;
|
||||
}
|
||||
|
||||
public void setIsPasswordExpired(boolean isPasswordExpired) {
|
||||
this.isPasswordExpired = isPasswordExpired;
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class Infos implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private SysUser user;
|
||||
private List<Long> postIds;
|
||||
private List<Long> roleIds;
|
||||
private List<SysRole> roles;
|
||||
private List<SysPost> posts;
|
||||
|
||||
|
||||
public SysUser getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(SysUser user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public List<Long> getPostIds() {
|
||||
return postIds;
|
||||
}
|
||||
|
||||
public void setPostIds(List<Long> postIds) {
|
||||
this.postIds = postIds;
|
||||
}
|
||||
|
||||
public List<Long> getRoleIds() {
|
||||
return roleIds;
|
||||
}
|
||||
|
||||
public void setRoleIds(List<Long> roleIds) {
|
||||
this.roleIds = roleIds;
|
||||
}
|
||||
|
||||
public List<SysRole> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(List<SysRole> roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public List<SysPost> getPosts() {
|
||||
return posts;
|
||||
}
|
||||
|
||||
public void setPosts(List<SysPost> posts) {
|
||||
this.posts = posts;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
import com.ruoyi.common.core.domain.TreeSelect;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MenuTreeselect implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private List<Long> checkedKeys;
|
||||
private List<TreeSelect> menus;
|
||||
|
||||
public List<Long> getCheckedKeys() {
|
||||
return checkedKeys;
|
||||
}
|
||||
|
||||
public void setCheckedKeys(List<Long> checkedKeys) {
|
||||
this.checkedKeys = checkedKeys;
|
||||
}
|
||||
|
||||
public List<TreeSelect> getMenus() {
|
||||
return menus;
|
||||
}
|
||||
|
||||
public void setMenus(List<TreeSelect> menus) {
|
||||
this.menus = menus;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
public class RoleGroup {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String roleGroup;
|
||||
private String postGroup;
|
||||
|
||||
public String getRoleGroup() {
|
||||
return roleGroup;
|
||||
}
|
||||
|
||||
public void setRoleGroup(String roleGroup) {
|
||||
this.roleGroup = roleGroup;
|
||||
}
|
||||
|
||||
public String getPostGroup() {
|
||||
return postGroup;
|
||||
}
|
||||
|
||||
public void setPostGroup(String postGroup) {
|
||||
this.postGroup = postGroup;
|
||||
}
|
||||
}
|
@ -1,124 +1,124 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 岗位表 sys_post
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class SysPost extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 岗位序号 */
|
||||
@Excel(name = "岗位序号", cellType = ColumnType.NUMERIC)
|
||||
private Long postId;
|
||||
|
||||
/** 岗位编码 */
|
||||
@Excel(name = "岗位编码")
|
||||
private String postCode;
|
||||
|
||||
/** 岗位名称 */
|
||||
@Excel(name = "岗位名称")
|
||||
private String postName;
|
||||
|
||||
/** 岗位排序 */
|
||||
@Excel(name = "岗位排序")
|
||||
private Integer postSort;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 用户是否存在此岗位标识 默认不存在 */
|
||||
private boolean flag = false;
|
||||
|
||||
public Long getPostId()
|
||||
{
|
||||
return postId;
|
||||
}
|
||||
|
||||
public void setPostId(Long postId)
|
||||
{
|
||||
this.postId = postId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "岗位编码不能为空")
|
||||
@Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符")
|
||||
public String getPostCode()
|
||||
{
|
||||
return postCode;
|
||||
}
|
||||
|
||||
public void setPostCode(String postCode)
|
||||
{
|
||||
this.postCode = postCode;
|
||||
}
|
||||
|
||||
@NotBlank(message = "岗位名称不能为空")
|
||||
@Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符")
|
||||
public String getPostName()
|
||||
{
|
||||
return postName;
|
||||
}
|
||||
|
||||
public void setPostName(String postName)
|
||||
{
|
||||
this.postName = postName;
|
||||
}
|
||||
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
public Integer getPostSort()
|
||||
{
|
||||
return postSort;
|
||||
}
|
||||
|
||||
public void setPostSort(Integer postSort)
|
||||
{
|
||||
this.postSort = postSort;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public boolean isFlag()
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setFlag(boolean flag)
|
||||
{
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("postId", getPostId())
|
||||
.append("postCode", getPostCode())
|
||||
.append("postName", getPostName())
|
||||
.append("postSort", getPostSort())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 岗位表 sys_post
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class SysPost extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 岗位序号 */
|
||||
@Excel(name = "岗位序号", cellType = ColumnType.NUMERIC)
|
||||
private Long postId;
|
||||
|
||||
/** 岗位编码 */
|
||||
@Excel(name = "岗位编码")
|
||||
private String postCode;
|
||||
|
||||
/** 岗位名称 */
|
||||
@Excel(name = "岗位名称")
|
||||
private String postName;
|
||||
|
||||
/** 岗位排序 */
|
||||
@Excel(name = "岗位排序")
|
||||
private Integer postSort;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 用户是否存在此岗位标识 默认不存在 */
|
||||
private boolean flag = false;
|
||||
|
||||
public Long getPostId()
|
||||
{
|
||||
return postId;
|
||||
}
|
||||
|
||||
public void setPostId(Long postId)
|
||||
{
|
||||
this.postId = postId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "岗位编码不能为空")
|
||||
@Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符")
|
||||
public String getPostCode()
|
||||
{
|
||||
return postCode;
|
||||
}
|
||||
|
||||
public void setPostCode(String postCode)
|
||||
{
|
||||
this.postCode = postCode;
|
||||
}
|
||||
|
||||
@NotBlank(message = "岗位名称不能为空")
|
||||
@Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符")
|
||||
public String getPostName()
|
||||
{
|
||||
return postName;
|
||||
}
|
||||
|
||||
public void setPostName(String postName)
|
||||
{
|
||||
this.postName = postName;
|
||||
}
|
||||
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
public Integer getPostSort()
|
||||
{
|
||||
return postSort;
|
||||
}
|
||||
|
||||
public void setPostSort(Integer postSort)
|
||||
{
|
||||
this.postSort = postSort;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public boolean isFlag()
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setFlag(boolean flag)
|
||||
{
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("postId", getPostId())
|
||||
.append("postCode", getPostCode())
|
||||
.append("postName", getPostName())
|
||||
.append("postSort", getPostSort())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
|
||||
public class SysUserExt extends SysUser {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String roleGroup;
|
||||
private String postGroup;
|
||||
|
||||
public String getRoleGroup() {
|
||||
return roleGroup;
|
||||
}
|
||||
|
||||
public void setRoleGroup(String roleGroup) {
|
||||
this.roleGroup = roleGroup;
|
||||
}
|
||||
|
||||
public String getPostGroup() {
|
||||
return postGroup;
|
||||
}
|
||||
|
||||
public void setPostGroup(String postGroup) {
|
||||
this.postGroup = postGroup;
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
|
||||
public class Upload {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String url;
|
||||
private String fileName;
|
||||
private String newFileName;
|
||||
private String originalFilename;
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getNewFileName() {
|
||||
return newFileName;
|
||||
}
|
||||
|
||||
public void setNewFileName(String newFileName) {
|
||||
this.newFileName = newFileName;
|
||||
}
|
||||
|
||||
public String getOriginalFilename() {
|
||||
return originalFilename;
|
||||
}
|
||||
|
||||
public void setOriginalFilename(String originalFilename) {
|
||||
this.originalFilename = originalFilename;
|
||||
}
|
||||
}
|
@ -8,7 +8,7 @@ import java.util.List;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class TableDataInfo implements Serializable
|
||||
public class TableDataInfo<T> implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -16,7 +16,7 @@ public class TableDataInfo implements Serializable
|
||||
private long total;
|
||||
|
||||
/** 列表数据 */
|
||||
private List<?> rows;
|
||||
private List<T> rows;
|
||||
|
||||
/** 消息状态码 */
|
||||
private int code;
|
||||
@ -37,7 +37,7 @@ public class TableDataInfo implements Serializable
|
||||
* @param list 列表数据
|
||||
* @param total 总记录数
|
||||
*/
|
||||
public TableDataInfo(List<?> list, long total)
|
||||
public TableDataInfo(List<T> list, long total)
|
||||
{
|
||||
this.rows = list;
|
||||
this.total = total;
|
||||
@ -58,7 +58,7 @@ public class TableDataInfo implements Serializable
|
||||
return rows;
|
||||
}
|
||||
|
||||
public void setRows(List<?> rows)
|
||||
public void setRows(List<T> rows)
|
||||
{
|
||||
this.rows = rows;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
import com.ruoyi.common.core.domain.model.SysPost;
|
||||
|
||||
/**
|
||||
* 岗位信息 数据层
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
import com.ruoyi.common.core.domain.model.SysPost;
|
||||
|
||||
/**
|
||||
* 岗位信息 服务层
|
||||
|
@ -6,7 +6,7 @@ import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
import com.ruoyi.common.core.domain.model.SysPost;
|
||||
import com.ruoyi.system.mapper.SysPostMapper;
|
||||
import com.ruoyi.system.mapper.SysUserPostMapper;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
|
@ -19,7 +19,7 @@ import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.bean.BeanValidators;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
import com.ruoyi.common.core.domain.model.SysPost;
|
||||
import com.ruoyi.system.domain.SysUserPost;
|
||||
import com.ruoyi.system.domain.SysUserRole;
|
||||
import com.ruoyi.system.mapper.SysPostMapper;
|
||||
|
Reference in New Issue
Block a user