merge
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package com.xwbing.domain.entity.vo;
|
||||
|
||||
import com.xwbing.domain.entity.sys.SysAuthority;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目名称: boot-module-demo
|
||||
* 创建时间: 2018/1/18 15:52
|
||||
* 作者: xiangwb
|
||||
* 说明:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class ListSysAuthorityVo extends RestMessageVo {
|
||||
@ApiModelProperty(value = "返回数据")
|
||||
private List<SysAuthority> data;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.xwbing.domain.entity.vo;
|
||||
|
||||
import com.xwbing.domain.entity.sys.SysConfig;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目名称: boot-module-demo
|
||||
* 创建时间: 2018/1/18 15:44
|
||||
* 作者: xiangwb
|
||||
* 说明:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class ListSysConfigVo extends RestMessageVo {
|
||||
@ApiModelProperty(value = "返回数据")
|
||||
private List<SysConfig> data;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.xwbing.domain.entity.vo;
|
||||
|
||||
import com.xwbing.domain.entity.sys.SysRole;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目名称: boot-module-demo
|
||||
* 创建时间: 2018/1/18 15:57
|
||||
* 作者: xiangwb
|
||||
* 说明:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class ListSysRoleVo extends RestMessageVo {
|
||||
@ApiModelProperty(value = "返回数据")
|
||||
private List<SysRole> data;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.xwbing.domain.entity.vo;
|
||||
|
||||
import com.xwbing.domain.entity.sys.SysUserLoginInOut;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目名称: boot-module-demo
|
||||
* 创建时间: 2018/1/18 16:05
|
||||
* 作者: xiangwb
|
||||
* 说明:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class ListSysUserLoginInOutVo extends RestMessageVo {
|
||||
@ApiModelProperty(value = "返回数据")
|
||||
private List<SysUserLoginInOut> data;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.xwbing.domain.entity.vo;
|
||||
|
||||
import com.xwbing.domain.entity.sys.SysUser;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目名称: boot-module-demo
|
||||
* 创建时间: 2018/1/18 16:01
|
||||
* 作者: xiangwb
|
||||
* 说明:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class ListSysUserVo extends RestMessageVo {
|
||||
@ApiModelProperty(value = "返回数据")
|
||||
private List<SysUser> data;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.xwbing.domain.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 项目名称: boot-module-demo
|
||||
* 创建时间: 2018/1/18 15:25
|
||||
* 作者: xiangwb
|
||||
* 说明:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class RestMessageVo {
|
||||
@ApiModelProperty(value = "是否成功")
|
||||
private boolean success;
|
||||
@ApiModelProperty(value = "返回消息")
|
||||
private String message;
|
||||
@ApiModelProperty(value = "新增、修改主鍵返回id")
|
||||
private String id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.xwbing.domain.entity.vo;
|
||||
|
||||
import com.xwbing.domain.entity.sys.SysConfig;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 项目名称: boot-module-demo
|
||||
* 创建时间: 2018/1/18 15:28
|
||||
* 作者: xiangwb
|
||||
* 说明:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class SysConfigVo extends RestMessageVo {
|
||||
@ApiModelProperty(value = "返回数据")
|
||||
private SysConfig data;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.xwbing.domain.entity.vo;
|
||||
|
||||
import com.xwbing.domain.entity.sys.SysRole;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 项目名称: boot-module-demo
|
||||
* 创建时间: 2018/1/18 15:56
|
||||
* 作者: xiangwb
|
||||
* 说明:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class SysRoleVo extends RestMessageVo {
|
||||
@ApiModelProperty(value = "返回数据")
|
||||
private SysRole data;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.xwbing.domain.entity.vo;
|
||||
|
||||
import com.xwbing.domain.entity.sys.SysUser;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 项目名称: boot-module-demo
|
||||
* 创建时间: 2018/1/18 16:00
|
||||
* 作者: xiangwb
|
||||
* 说明:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class SysUserVo extends RestMessageVo {
|
||||
@ApiModelProperty(value = " 返回数据")
|
||||
private SysUser data;
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xwbing.util;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -9,10 +11,15 @@ import java.io.Serializable;
|
||||
* 作者: xiangwb
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class RestMessage implements Serializable {
|
||||
private static final long serialVersionUID = -4167591341943919542L;
|
||||
private boolean success = false;// 默认false
|
||||
private String message;// 成功、错误返回提示信息
|
||||
@ApiModelProperty(value = "是否成功")
|
||||
private boolean success = false;
|
||||
@ApiModelProperty(value = "成功、错误返回提示信息")
|
||||
private String message;
|
||||
@ApiModelProperty(value = "返回的数据")
|
||||
private Object data;// 返回的数据
|
||||
private String id;// 新增、修改主鍵返回id
|
||||
@ApiModelProperty(value = "新增、修改主鍵返回id")
|
||||
private String id;
|
||||
}
|
||||
|
||||
@@ -7,10 +7,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
import org.springframework.web.servlet.config.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -66,12 +63,26 @@ public class DispatcherServletConfig extends WebMvcConfigurerAdapter {
|
||||
@Override
|
||||
public void addViewControllers(ViewControllerRegistry registry) {
|
||||
registry.addViewController("/").setViewName("login.html");
|
||||
registry.addRedirectViewController("doc","swagger-ui.html");
|
||||
registry.addRedirectViewController("doc", "swagger-ui.html");
|
||||
//添加更多
|
||||
registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
|
||||
super.addViewControllers(registry);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解决跨域
|
||||
*
|
||||
* @param registry
|
||||
*/
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
.allowedOrigins("*")
|
||||
.allowCredentials(true)
|
||||
.allowedMethods("GET", "POST", "DELETE", "PUT", "OPTIONS")
|
||||
.maxAge(3600);
|
||||
}
|
||||
|
||||
/**
|
||||
* 扩展消息转换器,增加fastjson
|
||||
*
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.xwbing.annotation.LogInfo;
|
||||
import com.xwbing.constant.CommonConstant;
|
||||
import com.xwbing.constant.CommonEnum;
|
||||
import com.xwbing.domain.entity.sys.SysAuthority;
|
||||
import com.xwbing.domain.entity.vo.ListSysAuthorityVo;
|
||||
import com.xwbing.domain.entity.vo.SysAuthVo;
|
||||
import com.xwbing.redis.RedisService;
|
||||
import com.xwbing.service.sys.SysAuthorityService;
|
||||
@@ -37,7 +38,7 @@ public class SysAuthorityControl {
|
||||
|
||||
@LogInfo("添加权限")
|
||||
@PostMapping("save")
|
||||
@ApiOperation(value = "添加权限")
|
||||
@ApiOperation(value = "添加权限", response = RestMessage.class)
|
||||
public JSONObject save(@RequestBody SysAuthority sysAuthority) {
|
||||
RestMessage save = sysAuthorityService.save(sysAuthority);
|
||||
//删除缓存
|
||||
@@ -47,7 +48,7 @@ public class SysAuthorityControl {
|
||||
}
|
||||
|
||||
@LogInfo("删除权限")
|
||||
@ApiOperation(value = "删除权限")
|
||||
@ApiOperation(value = "删除权限", response = RestMessage.class)
|
||||
@GetMapping("removeById")
|
||||
public JSONObject removeById(@RequestParam String id) {
|
||||
if (StringUtils.isEmpty(id))
|
||||
@@ -60,7 +61,7 @@ public class SysAuthorityControl {
|
||||
}
|
||||
|
||||
@LogInfo("修改权限")
|
||||
@ApiOperation(value = "修改权限")
|
||||
@ApiOperation(value = "修改权限", response = RestMessage.class)
|
||||
@PostMapping("update")
|
||||
public JSONObject update(@RequestBody SysAuthority sysAuthority) {
|
||||
if (StringUtils.isEmpty(sysAuthority.getId()))
|
||||
@@ -88,7 +89,7 @@ public class SysAuthorityControl {
|
||||
}
|
||||
|
||||
@LogInfo("根据是否启用查询所有权限")
|
||||
@ApiOperation(value = "根据是否启用查询所有权限")
|
||||
@ApiOperation(value = "根据是否启用查询所有权限", response = ListSysAuthorityVo.class)
|
||||
@ApiImplicitParam(name = "enable", value = "是否启用,格式Y|N", paramType = "query", dataType = "string")
|
||||
@GetMapping("listByEnable")
|
||||
public JSONObject listByEnable(String enable) {
|
||||
@@ -98,7 +99,7 @@ public class SysAuthorityControl {
|
||||
|
||||
@LogInfo("根据父节点查询子节点")
|
||||
@GetMapping("listByParentId")
|
||||
@ApiOperation(value = "根据父节点查询子节点")
|
||||
@ApiOperation(value = "根据父节点查询子节点", response = ListSysAuthorityVo.class)
|
||||
@ApiImplicitParam(name = "parentId", value = "父id,可为空", paramType = "query", dataType = "string")
|
||||
public JSONObject listByParentId(String parentId) {
|
||||
if (StringUtils.isEmpty(parentId))
|
||||
@@ -110,7 +111,7 @@ public class SysAuthorityControl {
|
||||
}
|
||||
|
||||
@LogInfo("递归查询所有权限")
|
||||
@ApiOperation(value = "递归查询所有权限")
|
||||
@ApiOperation(value = "递归查询所有权限", response = ListSysAuthorityVo.class)
|
||||
@ApiImplicitParam(name = "enable", value = "是否启用,格式Y|N", paramType = "query", dataType = "string")
|
||||
@GetMapping("listTree")
|
||||
public JSONObject listTree(String enable) {
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.xwbing.controller.sys;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.xwbing.annotation.LogInfo;
|
||||
import com.xwbing.domain.entity.sys.SysConfig;
|
||||
import com.xwbing.domain.entity.vo.ListSysConfigVo;
|
||||
import com.xwbing.domain.entity.vo.SysConfigVo;
|
||||
import com.xwbing.service.sys.SysConfigService;
|
||||
import com.xwbing.util.JSONObjResult;
|
||||
import com.xwbing.util.RestMessage;
|
||||
@@ -34,7 +36,7 @@ public class SysConfigControl {
|
||||
private SysConfigService sysConfigService;
|
||||
|
||||
@LogInfo("新增系统配置信息")
|
||||
@ApiOperation(value = "新增", notes = "新增系统配置信息")
|
||||
@ApiOperation(value = "新增", notes = "新增系统配置信息", response = RestMessage.class)
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "code", value = "配置项的key,长度为1-50", paramType = "query", required = true, dataType = "string"),
|
||||
// @ApiImplicitParam(name = "value", value = "配置项的值", paramType = "query", required = true, dataType = "string"),
|
||||
@@ -50,7 +52,7 @@ public class SysConfigControl {
|
||||
}
|
||||
|
||||
@LogInfo("根据code删除系统配置信息")
|
||||
@ApiOperation(value = "删除", notes = "根据code删除系统配置信息")
|
||||
@ApiOperation(value = "删除", notes = "根据code删除系统配置信息", response = RestMessage.class)
|
||||
@ApiImplicitParam(name = "code", value = "配置项的code", paramType = "query", required = true, dataType = "string")
|
||||
@GetMapping("removeByCode")
|
||||
public JSONObject removeByCode(@RequestParam String code) {
|
||||
@@ -64,7 +66,7 @@ public class SysConfigControl {
|
||||
}
|
||||
|
||||
@LogInfo("修改系统配置信息")
|
||||
@ApiOperation(value = "修改", notes = "修改系统配置信息")
|
||||
@ApiOperation(value = "修改", notes = "修改系统配置信息", response = RestMessage.class)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "code", value = "配置项的key,长度为1-50", paramType = "query", required = true, dataType = "string"),
|
||||
@ApiImplicitParam(name = "value", value = "配置项的值", paramType = "query", required = true, dataType = "string"),
|
||||
@@ -81,7 +83,7 @@ public class SysConfigControl {
|
||||
}
|
||||
|
||||
@LogInfo("根据key查找系统配置信息")
|
||||
@ApiOperation(value = "查找", notes = "根据key查找系统配置信息")
|
||||
@ApiOperation(value = "查找", notes = "根据key查找系统配置信息", response = SysConfigVo.class)
|
||||
@ApiImplicitParam(name = "code", value = "配置项的code", paramType = "query", required = true, dataType = "string")
|
||||
@GetMapping("getByCode")
|
||||
public JSONObject getByCode(@RequestParam String code) {
|
||||
@@ -98,7 +100,7 @@ public class SysConfigControl {
|
||||
}
|
||||
|
||||
@LogInfo("根据是否启用查找配置列表")
|
||||
@ApiOperation(value = "查找列表", notes = "根据是否启用查找配置列表")
|
||||
@ApiOperation(value = "查找列表", notes = "根据是否启用查找配置列表", response = ListSysConfigVo.class)
|
||||
@ApiImplicitParam(name = "enable", value = "是否启用,格式为Y|N", paramType = "query", required = true, dataType = "string")
|
||||
@GetMapping("listByEnable")
|
||||
public JSONObject listByEnable(@RequestParam String enable) {
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.xwbing.annotation.LogInfo;
|
||||
import com.xwbing.domain.entity.sys.SysAuthority;
|
||||
import com.xwbing.domain.entity.sys.SysRole;
|
||||
import com.xwbing.domain.entity.sys.SysRoleAuthority;
|
||||
import com.xwbing.domain.entity.vo.ListSysRoleVo;
|
||||
import com.xwbing.domain.entity.vo.SysRoleVo;
|
||||
import com.xwbing.service.sys.SysAuthorityService;
|
||||
import com.xwbing.service.sys.SysRoleAuthorityService;
|
||||
import com.xwbing.service.sys.SysRoleService;
|
||||
@@ -38,7 +40,7 @@ public class SysRoleControl {
|
||||
private SysRoleAuthorityService sysRoleAuthorityService;
|
||||
|
||||
@LogInfo("添加角色")
|
||||
@ApiOperation(value = "添加角色")
|
||||
@ApiOperation(value = "添加角色", response = RestMessage.class)
|
||||
@PostMapping("save")
|
||||
public JSONObject save(@RequestBody SysRole sysRole) {
|
||||
RestMessage result = sysRoleService.save(sysRole);
|
||||
@@ -46,7 +48,7 @@ public class SysRoleControl {
|
||||
}
|
||||
|
||||
@LogInfo("删除角色")
|
||||
@ApiOperation(value = "删除角色")
|
||||
@ApiOperation(value = "删除角色", response = RestMessage.class)
|
||||
@GetMapping("removeById")
|
||||
public JSONObject removeById(@RequestParam String id) {
|
||||
if (StringUtils.isEmpty(id))
|
||||
@@ -56,7 +58,7 @@ public class SysRoleControl {
|
||||
}
|
||||
|
||||
@LogInfo("修改角色")
|
||||
@ApiOperation(value = "修改角色")
|
||||
@ApiOperation(value = "修改角色", response = RestMessage.class)
|
||||
@PostMapping("update")
|
||||
public JSONObject update(@RequestBody SysRole sysRole) {
|
||||
if (StringUtils.isEmpty(sysRole.getId()))
|
||||
@@ -66,7 +68,7 @@ public class SysRoleControl {
|
||||
}
|
||||
|
||||
@LogInfo("获取角色详情")
|
||||
@ApiOperation(value = "获取角色详情")
|
||||
@ApiOperation(value = "获取角色详情", response = SysRoleVo.class)
|
||||
@GetMapping("getById")
|
||||
public JSONObject getById(@RequestParam String id) {
|
||||
if (StringUtils.isEmpty(id))
|
||||
@@ -78,7 +80,7 @@ public class SysRoleControl {
|
||||
}
|
||||
|
||||
@LogInfo("根据是否启用查询所有角色")
|
||||
@ApiOperation(value = "根据是否启用查询所有角色")
|
||||
@ApiOperation(value = "根据是否启用查询所有角色", response = ListSysRoleVo.class)
|
||||
@ApiImplicitParam(name = "enable", value = "是否启用,格式Y|N", paramType = "query", dataType = "string")
|
||||
@GetMapping("listByEnable")
|
||||
public JSONObject listByEnable(String enable) {
|
||||
@@ -87,7 +89,7 @@ public class SysRoleControl {
|
||||
}
|
||||
|
||||
@LogInfo("根据角色主键查找权限")
|
||||
@ApiOperation(value = "根据角色主键查找权限")
|
||||
@ApiOperation(value = "根据角色主键查找权限", response = ListSysRoleVo.class)
|
||||
@ApiImplicitParam(name = "enable", value = "是否启用,格式Y|N", paramType = "query", dataType = "string")
|
||||
@PostMapping("listAuthorityByRoleId")
|
||||
public JSONObject listAuthorityByRoleId(@RequestParam String roleId, String enable) {
|
||||
@@ -101,7 +103,7 @@ public class SysRoleControl {
|
||||
}
|
||||
|
||||
@LogInfo("保存角色权限")
|
||||
@ApiOperation(value = "保存角色权限")
|
||||
@ApiOperation(value = "保存角色权限", response = RestMessage.class)
|
||||
@PostMapping("saveAuthority")
|
||||
public JSONObject saveAuthority(@RequestParam String authorityIds, @RequestParam String roleId) {
|
||||
if (StringUtils.isEmpty(authorityIds))
|
||||
|
||||
@@ -8,6 +8,10 @@ import com.xwbing.domain.entity.sys.SysAuthority;
|
||||
import com.xwbing.domain.entity.sys.SysRole;
|
||||
import com.xwbing.domain.entity.sys.SysUser;
|
||||
import com.xwbing.domain.entity.sys.SysUserRole;
|
||||
import com.xwbing.domain.entity.vo.ListSysAuthorityVo;
|
||||
import com.xwbing.domain.entity.vo.ListSysRoleVo;
|
||||
import com.xwbing.domain.entity.vo.ListSysUserVo;
|
||||
import com.xwbing.domain.entity.vo.SysUserVo;
|
||||
import com.xwbing.service.sys.SysAuthorityService;
|
||||
import com.xwbing.service.sys.SysRoleService;
|
||||
import com.xwbing.service.sys.SysUserRoleService;
|
||||
@@ -49,7 +53,7 @@ public class SysUserControl {
|
||||
private SysAuthorityService sysAuthorityService;
|
||||
|
||||
@LogInfo("添加用户")
|
||||
@ApiOperation(value = "添加用户")
|
||||
@ApiOperation(value = "添加用户", response = RestMessage.class)
|
||||
@PostMapping("save")
|
||||
public JSONObject save(@RequestBody @Valid SysUser sysUser) {
|
||||
RestMessage result = sysUserService.save(sysUser);
|
||||
@@ -57,7 +61,7 @@ public class SysUserControl {
|
||||
}
|
||||
|
||||
@LogInfo("删除用户")
|
||||
@ApiOperation(value = "删除用户")
|
||||
@ApiOperation(value = "删除用户", response = RestMessage.class)
|
||||
@GetMapping("removeById")
|
||||
public JSONObject removeById(@RequestParam String id) {
|
||||
if (StringUtils.isEmpty(id))
|
||||
@@ -67,7 +71,7 @@ public class SysUserControl {
|
||||
}
|
||||
|
||||
@LogInfo("修改用户信息")
|
||||
@ApiOperation(value = "修改用户信息")
|
||||
@ApiOperation(value = "修改用户信息", response = RestMessage.class)
|
||||
@PostMapping("update")
|
||||
public JSONObject update(@RequestBody @Valid SysUser sysUser) {
|
||||
if (StringUtils.isEmpty(sysUser.getId()))
|
||||
@@ -77,7 +81,7 @@ public class SysUserControl {
|
||||
}
|
||||
|
||||
@LogInfo("获取用户详情")
|
||||
@ApiOperation(value = "获取用户详情")
|
||||
@ApiOperation(value = "获取用户详情", response = SysUserVo.class)
|
||||
@GetMapping("getById")
|
||||
public JSONObject getById(@RequestParam String id) {
|
||||
if (StringUtils.isEmpty(id))
|
||||
@@ -89,7 +93,7 @@ public class SysUserControl {
|
||||
}
|
||||
|
||||
@LogInfo("列表查询所有用户")
|
||||
@ApiOperation(value = "列表查询所有用户")
|
||||
@ApiOperation(value = "列表查询所有用户", response = ListSysUserVo.class)
|
||||
@GetMapping("listAll")
|
||||
public JSONObject listAll() {
|
||||
List<SysUser> list = sysUserService.listAll();
|
||||
@@ -97,7 +101,7 @@ public class SysUserControl {
|
||||
}
|
||||
|
||||
@LogInfo("登录")
|
||||
@ApiOperation(value = "登录")
|
||||
@ApiOperation(value = "登录", response = RestMessage.class)
|
||||
@PostMapping("login")
|
||||
public JSONObject login(HttpServletRequest request, @RequestParam String userName, @RequestParam String passWord, @RequestParam String checkCode) {
|
||||
if (StringUtils.isEmpty(userName) || StringUtils.isEmpty(passWord))
|
||||
@@ -109,7 +113,7 @@ public class SysUserControl {
|
||||
}
|
||||
|
||||
@LogInfo("登出")
|
||||
@ApiOperation(value = "登出")
|
||||
@ApiOperation(value = "登出", response = RestMessage.class)
|
||||
@GetMapping("logout")
|
||||
public JSONObject logout(HttpServletRequest request) {
|
||||
RestMessage logout = sysUserService.logout(request);
|
||||
@@ -117,7 +121,7 @@ public class SysUserControl {
|
||||
}
|
||||
|
||||
@LogInfo("修改密码")
|
||||
@ApiOperation(value = "修改密码")
|
||||
@ApiOperation(value = "修改密码", response = RestMessage.class)
|
||||
@PostMapping("updatePassWord")
|
||||
public JSONObject updatePassWord(@RequestParam String newPassWord, @RequestParam String oldPassWord, @RequestParam String id) {
|
||||
if (StringUtils.isEmpty(id))
|
||||
@@ -129,7 +133,7 @@ public class SysUserControl {
|
||||
}
|
||||
|
||||
@LogInfo("重置密码")
|
||||
@ApiOperation(value = "重置密码")
|
||||
@ApiOperation(value = "重置密码", response = RestMessage.class)
|
||||
@GetMapping("resetPassWord")
|
||||
public JSONObject resetPassWord(@RequestParam String id) {
|
||||
if (StringUtils.isEmpty(id))
|
||||
@@ -166,7 +170,7 @@ public class SysUserControl {
|
||||
}
|
||||
|
||||
@LogInfo("保存用户角色")
|
||||
@ApiOperation(value = "保存用户角色")
|
||||
@ApiOperation(value = "保存用户角色", response = RestMessage.class)
|
||||
@PostMapping("saveRole")
|
||||
public JSONObject saveRole(@RequestParam String roleIds, @RequestParam String userId) {
|
||||
if (StringUtils.isEmpty(roleIds))
|
||||
@@ -192,7 +196,7 @@ public class SysUserControl {
|
||||
}
|
||||
|
||||
@LogInfo("根据用户主键查找所拥有的角色")
|
||||
@ApiOperation(value = "根据用户主键查找所拥有的角色")
|
||||
@ApiOperation(value = "根据用户主键查找所拥有的角色", response = ListSysRoleVo.class)
|
||||
@ApiImplicitParam(name = "enable", value = "是否启用,格式Y|N", paramType = "query", dataType = "string")
|
||||
@PostMapping("listRoleByUserId")
|
||||
public JSONObject listRoleByUserId(@RequestParam String userId, String enable) {
|
||||
@@ -203,7 +207,7 @@ public class SysUserControl {
|
||||
}
|
||||
|
||||
@LogInfo("根据用户主键查找所拥有的权限")
|
||||
@ApiOperation(value = "根据用户主键查找所拥有的权限")
|
||||
@ApiOperation(value = "根据用户主键查找所拥有的权限", response = ListSysAuthorityVo.class)
|
||||
@ApiImplicitParam(name = "enable", value = "是否启用,格式Y|N", paramType = "query", dataType = "string")
|
||||
@PostMapping("listAuthorityByUserId")
|
||||
public JSONObject listAuthorityByUserId(@RequestParam String userId, String enable) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.xwbing.controller.sys;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.xwbing.annotation.LogInfo;
|
||||
import com.xwbing.domain.entity.sys.SysUserLoginInOut;
|
||||
import com.xwbing.domain.entity.vo.ListSysUserLoginInOutVo;
|
||||
import com.xwbing.service.sys.SysUserLoginInOutService;
|
||||
import com.xwbing.util.JSONObjResult;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -29,7 +30,7 @@ public class SysUserLoginInOutControl {
|
||||
private SysUserLoginInOutService inOutService;
|
||||
|
||||
@LogInfo("获取登录或登出信息")
|
||||
@ApiOperation(value = "获取登录或登出信息")
|
||||
@ApiOperation(value = "获取登录或登出信息", response = ListSysUserLoginInOutVo.class)
|
||||
@GetMapping("listByType")
|
||||
public JSONObject listByType(@RequestParam int inout) {
|
||||
List<SysUserLoginInOut> sysUserLoginInOuts = inOutService.listByType(inout);
|
||||
|
||||
Reference in New Issue
Block a user