mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-17 16:56:39 +08:00
add 整合 springdoc 移除 knife4j
This commit is contained in:
parent
48cb0a1bb1
commit
0b07780619
18
pom.xml
18
pom.xml
@ -85,21 +85,9 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<groupId>io.swagger</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>${swagger-annotations.version}</version>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<version>1.6.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -19,9 +19,9 @@ import com.ruoyi.sms.config.properties.SmsProperties;
|
||||
import com.ruoyi.sms.core.SmsTemplate;
|
||||
import com.ruoyi.sms.entity.SmsResult;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -41,7 +41,7 @@ import java.util.Map;
|
||||
@Anonymous
|
||||
@Slf4j
|
||||
@Validated
|
||||
@Api(value = "验证码操作处理", tags = {"验证码管理"})
|
||||
@Tag(name ="验证码操作处理", description = "验证码管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
public class CaptchaController {
|
||||
@ -53,9 +53,9 @@ public class CaptchaController {
|
||||
/**
|
||||
* 短信验证码
|
||||
*/
|
||||
@ApiOperation("短信验证码")
|
||||
@Operation(summary = "短信验证码")
|
||||
@GetMapping("/captchaSms")
|
||||
public R<Void> smsCaptcha(@ApiParam("用户手机号")
|
||||
public R<Void> smsCaptcha(@Parameter(name = "用户手机号")
|
||||
@NotBlank(message = "{user.phonenumber.not.blank}")
|
||||
String phonenumber) {
|
||||
if (smsProperties.getEnabled()) {
|
||||
@ -80,7 +80,7 @@ public class CaptchaController {
|
||||
/**
|
||||
* 生成验证码
|
||||
*/
|
||||
@ApiOperation("生成验证码")
|
||||
@Operation(summary = "生成验证码")
|
||||
@GetMapping("/captchaImage")
|
||||
public R<Map<String, Object>> getCode() {
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
|
@ -5,8 +5,8 @@ import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.domain.SysCache;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.redis.connection.RedisServerCommands;
|
||||
import org.springframework.data.redis.core.RedisCallback;
|
||||
@ -20,7 +20,7 @@ import java.util.*;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Api(value = "缓存监控", tags = {"缓存监控管理"})
|
||||
@Tag(name ="缓存监控", description = "缓存监控管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/monitor/cache")
|
||||
@ -41,7 +41,7 @@ public class CacheController {
|
||||
CACHES.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
|
||||
}
|
||||
|
||||
@ApiOperation("获取缓存监控详细信息")
|
||||
@Operation(summary = "获取缓存监控详细信息")
|
||||
@SaCheckPermission("monitor:cache:list")
|
||||
@GetMapping()
|
||||
public R<Map<String, Object>> getInfo() throws Exception {
|
||||
@ -67,14 +67,14 @@ public class CacheController {
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
@ApiOperation("获取缓存名称列表")
|
||||
@Operation(summary = "获取缓存名称列表")
|
||||
@SaCheckPermission("monitor:cache:list")
|
||||
@GetMapping("/getNames")
|
||||
public R<List<SysCache>> cache() {
|
||||
return R.ok(CACHES);
|
||||
}
|
||||
|
||||
@ApiOperation("获取KEYS基于缓存名")
|
||||
@Operation(summary = "获取KEYS基于缓存名")
|
||||
@SaCheckPermission("monitor:cache:list")
|
||||
@GetMapping("/getKeys/{cacheName}")
|
||||
public R<Set<String>> getCacheKeys(@PathVariable String cacheName) {
|
||||
@ -82,7 +82,7 @@ public class CacheController {
|
||||
return R.ok(cacheKyes);
|
||||
}
|
||||
|
||||
@ApiOperation("获取值基于缓存名与KEY")
|
||||
@Operation(summary = "获取值基于缓存名与KEY")
|
||||
@SaCheckPermission("monitor:cache:list")
|
||||
@GetMapping("/getValue/{cacheName}/{cacheKey}")
|
||||
public R<SysCache> getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) {
|
||||
@ -91,7 +91,7 @@ public class CacheController {
|
||||
return R.ok(sysCache);
|
||||
}
|
||||
|
||||
@ApiOperation("清空缓存名")
|
||||
@Operation(summary = "清空缓存名")
|
||||
@SaCheckPermission("monitor:cache:list")
|
||||
@DeleteMapping("/clearCacheName/{cacheName}")
|
||||
public R<Void> clearCacheName(@PathVariable String cacheName) {
|
||||
@ -100,7 +100,7 @@ public class CacheController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("清空缓存KEY")
|
||||
@Operation(summary = "清空缓存KEY")
|
||||
@SaCheckPermission("monitor:cache:list")
|
||||
@DeleteMapping("/clearCacheKey/{cacheKey}")
|
||||
public R<Void> clearCacheKey(@PathVariable String cacheKey) {
|
||||
@ -108,7 +108,7 @@ public class CacheController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("清空所有缓存")
|
||||
@Operation(summary = "清空所有缓存")
|
||||
@SaCheckPermission("monitor:cache:list")
|
||||
@DeleteMapping("/clearCacheAll")
|
||||
public R<Void> clearCacheAll() {
|
||||
|
@ -3,15 +3,15 @@ package com.ruoyi.web.controller.monitor;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
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.SysLogininfor;
|
||||
import com.ruoyi.system.service.ISysLogininforService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -25,7 +25,7 @@ import java.util.List;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "系统访问记录", tags = {"系统访问记录管理"})
|
||||
@Tag(name ="系统访问记录", description = "系统访问记录管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/monitor/logininfor")
|
||||
@ -33,14 +33,14 @@ public class SysLogininforController extends BaseController {
|
||||
|
||||
private final ISysLogininforService logininforService;
|
||||
|
||||
@ApiOperation("查询系统访问记录列表")
|
||||
@Operation(summary = "查询系统访问记录列表")
|
||||
@SaCheckPermission("monitor:logininfor:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysLogininfor> list(SysLogininfor logininfor, PageQuery pageQuery) {
|
||||
return logininforService.selectPageLogininforList(logininfor, pageQuery);
|
||||
}
|
||||
|
||||
@ApiOperation("导出系统访问记录列表")
|
||||
@Operation(summary = "导出系统访问记录列表")
|
||||
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
||||
@SaCheckPermission("monitor:logininfor:export")
|
||||
@PostMapping("/export")
|
||||
@ -49,7 +49,7 @@ public class SysLogininforController extends BaseController {
|
||||
ExcelUtil.exportExcel(list, "登录日志", SysLogininfor.class, response);
|
||||
}
|
||||
|
||||
@ApiOperation("删除系统访问记录")
|
||||
@Operation(summary = "删除系统访问记录")
|
||||
@SaCheckPermission("monitor:logininfor:remove")
|
||||
@Log(title = "登录日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{infoIds}")
|
||||
@ -57,7 +57,7 @@ public class SysLogininforController extends BaseController {
|
||||
return toAjax(logininforService.deleteLogininforByIds(infoIds));
|
||||
}
|
||||
|
||||
@ApiOperation("清空系统访问记录")
|
||||
@Operation(summary = "清空系统访问记录")
|
||||
@SaCheckPermission("monitor:logininfor:remove")
|
||||
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/clean")
|
||||
|
@ -3,15 +3,15 @@ package com.ruoyi.web.controller.monitor;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
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.SysOperLog;
|
||||
import com.ruoyi.system.service.ISysOperLogService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -25,7 +25,7 @@ import java.util.List;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "操作日志记录", tags = {"操作日志记录管理"})
|
||||
@Tag(name ="操作日志记录", description = "操作日志记录管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/monitor/operlog")
|
||||
@ -33,14 +33,14 @@ public class SysOperlogController extends BaseController {
|
||||
|
||||
private final ISysOperLogService operLogService;
|
||||
|
||||
@ApiOperation("查询操作日志记录列表")
|
||||
@Operation(summary = "查询操作日志记录列表")
|
||||
@SaCheckPermission("monitor:operlog:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysOperLog> list(SysOperLog operLog, PageQuery pageQuery) {
|
||||
return operLogService.selectPageOperLogList(operLog, pageQuery);
|
||||
}
|
||||
|
||||
@ApiOperation("导出操作日志记录列表")
|
||||
@Operation(summary = "导出操作日志记录列表")
|
||||
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||
@SaCheckPermission("monitor:operlog:export")
|
||||
@PostMapping("/export")
|
||||
@ -49,7 +49,7 @@ public class SysOperlogController extends BaseController {
|
||||
ExcelUtil.exportExcel(list, "操作日志", SysOperLog.class, response);
|
||||
}
|
||||
|
||||
@ApiOperation("删除操作日志记录")
|
||||
@Operation(summary = "删除操作日志记录")
|
||||
@Log(title = "操作日志", businessType = BusinessType.DELETE)
|
||||
@SaCheckPermission("monitor:operlog:remove")
|
||||
@DeleteMapping("/{operIds}")
|
||||
@ -57,7 +57,7 @@ public class SysOperlogController extends BaseController {
|
||||
return toAjax(operLogService.deleteOperLogByIds(operIds));
|
||||
}
|
||||
|
||||
@ApiOperation("清空操作日志记录")
|
||||
@Operation(summary = "清空操作日志记录")
|
||||
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
||||
@SaCheckPermission("monitor:operlog:remove")
|
||||
@DeleteMapping("/clean")
|
||||
|
@ -15,8 +15,8 @@ import com.ruoyi.common.utils.StreamUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.system.domain.SysUserOnline;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -29,13 +29,13 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Api(value = "在线用户监控", tags = {"在线用户监控管理"})
|
||||
@Tag(name ="在线用户监控", description = "在线用户监控管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/monitor/online")
|
||||
public class SysUserOnlineController extends BaseController {
|
||||
|
||||
@ApiOperation("在线用户列表")
|
||||
@Operation(summary = "在线用户列表")
|
||||
@SaCheckPermission("monitor:online:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysUserOnline> list(String ipaddr, String userName) {
|
||||
@ -73,7 +73,7 @@ public class SysUserOnlineController extends BaseController {
|
||||
/**
|
||||
* 强退用户
|
||||
*/
|
||||
@ApiOperation("强退用户")
|
||||
@Operation(summary = "强退用户")
|
||||
@SaCheckPermission("monitor:online:forceLogout")
|
||||
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
||||
@DeleteMapping("/{tokenId}")
|
||||
|
@ -4,16 +4,16 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
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.SysConfig;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -27,7 +27,7 @@ import java.util.List;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "参数配置控制器", tags = {"参数配置管理"})
|
||||
@Tag(name ="参数配置控制器", description = "参数配置管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/config")
|
||||
@ -38,14 +38,14 @@ public class SysConfigController extends BaseController {
|
||||
/**
|
||||
* 获取参数配置列表
|
||||
*/
|
||||
@ApiOperation("获取参数配置列表")
|
||||
@Operation(summary = "获取参数配置列表")
|
||||
@SaCheckPermission("system:config:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysConfig> list(SysConfig config, PageQuery pageQuery) {
|
||||
return configService.selectPageConfigList(config, pageQuery);
|
||||
}
|
||||
|
||||
@ApiOperation("导出参数配置列表")
|
||||
@Operation(summary = "导出参数配置列表")
|
||||
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
||||
@SaCheckPermission("system:config:export")
|
||||
@PostMapping("/export")
|
||||
@ -57,26 +57,26 @@ public class SysConfigController extends BaseController {
|
||||
/**
|
||||
* 根据参数编号获取详细信息
|
||||
*/
|
||||
@ApiOperation("根据参数编号获取详细信息")
|
||||
@Operation(summary = "根据参数编号获取详细信息")
|
||||
@SaCheckPermission("system:config:query")
|
||||
@GetMapping(value = "/{configId}")
|
||||
public R<SysConfig> getInfo(@ApiParam("参数ID") @PathVariable Long configId) {
|
||||
public R<SysConfig> getInfo(@Parameter(name = "参数ID") @PathVariable Long configId) {
|
||||
return R.ok(configService.selectConfigById(configId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据参数键名查询参数值
|
||||
*/
|
||||
@ApiOperation("根据参数键名查询参数值")
|
||||
@Operation(summary = "根据参数键名查询参数值")
|
||||
@GetMapping(value = "/configKey/{configKey}")
|
||||
public R<Void> getConfigKey(@ApiParam("参数Key") @PathVariable String configKey) {
|
||||
public R<Void> getConfigKey(@Parameter(name = "参数Key") @PathVariable String configKey) {
|
||||
return R.ok(configService.selectConfigByKey(configKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*/
|
||||
@ApiOperation("新增参数配置")
|
||||
@Operation(summary = "新增参数配置")
|
||||
@SaCheckPermission("system:config:add")
|
||||
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ -90,7 +90,7 @@ public class SysConfigController extends BaseController {
|
||||
/**
|
||||
* 修改参数配置
|
||||
*/
|
||||
@ApiOperation("修改参数配置")
|
||||
@Operation(summary = "修改参数配置")
|
||||
@SaCheckPermission("system:config:edit")
|
||||
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ -104,7 +104,7 @@ public class SysConfigController extends BaseController {
|
||||
/**
|
||||
* 根据参数键名修改参数配置
|
||||
*/
|
||||
@ApiOperation("根据参数键名修改参数配置")
|
||||
@Operation(summary = "根据参数键名修改参数配置")
|
||||
@SaCheckPermission("system:config:edit")
|
||||
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/updateByKey")
|
||||
@ -115,11 +115,11 @@ public class SysConfigController extends BaseController {
|
||||
/**
|
||||
* 删除参数配置
|
||||
*/
|
||||
@ApiOperation("删除参数配置")
|
||||
@Operation(summary = "删除参数配置")
|
||||
@SaCheckPermission("system:config:remove")
|
||||
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{configIds}")
|
||||
public R<Void> remove(@ApiParam("参数ID串") @PathVariable Long[] configIds) {
|
||||
public R<Void> remove(@Parameter(name = "参数ID串") @PathVariable Long[] configIds) {
|
||||
configService.deleteConfigByIds(configIds);
|
||||
return R.ok();
|
||||
}
|
||||
@ -127,7 +127,7 @@ public class SysConfigController extends BaseController {
|
||||
/**
|
||||
* 刷新参数缓存
|
||||
*/
|
||||
@ApiOperation("刷新参数缓存")
|
||||
@Operation(summary = "刷新参数缓存")
|
||||
@SaCheckPermission("system:config:remove")
|
||||
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/refreshCache")
|
||||
|
@ -11,9 +11,9 @@ import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -28,7 +28,7 @@ import java.util.Map;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "部门控制器", tags = {"部门管理"})
|
||||
@Tag(name ="部门控制器", description = "部门管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/dept")
|
||||
@ -39,7 +39,7 @@ public class SysDeptController extends BaseController {
|
||||
/**
|
||||
* 获取部门列表
|
||||
*/
|
||||
@ApiOperation("获取部门列表")
|
||||
@Operation(summary = "获取部门列表")
|
||||
@SaCheckPermission("system:dept:list")
|
||||
@GetMapping("/list")
|
||||
public R<List<SysDept>> list(SysDept dept) {
|
||||
@ -50,10 +50,10 @@ public class SysDeptController extends BaseController {
|
||||
/**
|
||||
* 查询部门列表(排除节点)
|
||||
*/
|
||||
@ApiOperation("查询部门列表(排除节点)")
|
||||
@Operation(summary = "查询部门列表(排除节点)")
|
||||
@SaCheckPermission("system:dept:list")
|
||||
@GetMapping("/list/exclude/{deptId}")
|
||||
public R<List<SysDept>> excludeChild(@ApiParam("部门ID") @PathVariable(value = "deptId", required = false) Long deptId) {
|
||||
public R<List<SysDept>> excludeChild(@Parameter(name = "部门ID") @PathVariable(value = "deptId", required = false) Long deptId) {
|
||||
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
||||
depts.removeIf(d -> d.getDeptId().equals(deptId)
|
||||
|| ArrayUtil.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
|
||||
@ -63,10 +63,10 @@ public class SysDeptController extends BaseController {
|
||||
/**
|
||||
* 根据部门编号获取详细信息
|
||||
*/
|
||||
@ApiOperation("根据部门编号获取详细信息")
|
||||
@Operation(summary = "根据部门编号获取详细信息")
|
||||
@SaCheckPermission("system:dept:query")
|
||||
@GetMapping(value = "/{deptId}")
|
||||
public R<SysDept> getInfo(@ApiParam("部门ID") @PathVariable Long deptId) {
|
||||
public R<SysDept> getInfo(@Parameter(name = "部门ID") @PathVariable Long deptId) {
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
return R.ok(deptService.selectDeptById(deptId));
|
||||
}
|
||||
@ -74,7 +74,7 @@ public class SysDeptController extends BaseController {
|
||||
/**
|
||||
* 获取部门下拉树列表
|
||||
*/
|
||||
@ApiOperation("获取部门下拉树列表")
|
||||
@Operation(summary = "获取部门下拉树列表")
|
||||
@GetMapping("/treeselect")
|
||||
public R<List<Tree<Long>>> treeselect(SysDept dept) {
|
||||
List<SysDept> depts = deptService.selectDeptList(dept);
|
||||
@ -84,9 +84,9 @@ public class SysDeptController extends BaseController {
|
||||
/**
|
||||
* 加载对应角色部门列表树
|
||||
*/
|
||||
@ApiOperation("加载对应角色部门列表树")
|
||||
@Operation(summary = "加载对应角色部门列表树")
|
||||
@GetMapping(value = "/roleDeptTreeselect/{roleId}")
|
||||
public R<Map<String, Object>> roleDeptTreeselect(@ApiParam("角色ID") @PathVariable("roleId") Long roleId) {
|
||||
public R<Map<String, Object>> roleDeptTreeselect(@Parameter(name = "角色ID") @PathVariable("roleId") Long roleId) {
|
||||
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
||||
@ -97,7 +97,7 @@ public class SysDeptController extends BaseController {
|
||||
/**
|
||||
* 新增部门
|
||||
*/
|
||||
@ApiOperation("新增部门")
|
||||
@Operation(summary = "新增部门")
|
||||
@SaCheckPermission("system:dept:add")
|
||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ -111,7 +111,7 @@ public class SysDeptController extends BaseController {
|
||||
/**
|
||||
* 修改部门
|
||||
*/
|
||||
@ApiOperation("修改部门")
|
||||
@Operation(summary = "修改部门")
|
||||
@SaCheckPermission("system:dept:edit")
|
||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ -132,11 +132,11 @@ public class SysDeptController extends BaseController {
|
||||
/**
|
||||
* 删除部门
|
||||
*/
|
||||
@ApiOperation("删除部门")
|
||||
@Operation(summary = "删除部门")
|
||||
@SaCheckPermission("system:dept:remove")
|
||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{deptId}")
|
||||
public R<Void> remove(@ApiParam("部门ID串") @PathVariable Long deptId) {
|
||||
public R<Void> remove(@Parameter(name = "部门ID串") @PathVariable Long deptId) {
|
||||
if (deptService.hasChildByDeptId(deptId)) {
|
||||
return R.fail("存在下级部门,不允许删除");
|
||||
}
|
||||
|
@ -4,17 +4,17 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -29,7 +29,7 @@ import java.util.List;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "数据字典信息控制器", tags = {"数据字典信息管理"})
|
||||
@Tag(name ="数据字典信息控制器", description = "数据字典信息管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/dict/data")
|
||||
@ -38,14 +38,14 @@ public class SysDictDataController extends BaseController {
|
||||
private final ISysDictDataService dictDataService;
|
||||
private final ISysDictTypeService dictTypeService;
|
||||
|
||||
@ApiOperation("查询字典数据列表")
|
||||
@Operation(summary = "查询字典数据列表")
|
||||
@SaCheckPermission("system:dict:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysDictData> list(SysDictData dictData, PageQuery pageQuery) {
|
||||
return dictDataService.selectPageDictDataList(dictData, pageQuery);
|
||||
}
|
||||
|
||||
@ApiOperation("导出字典数据列表")
|
||||
@Operation(summary = "导出字典数据列表")
|
||||
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
||||
@SaCheckPermission("system:dict:export")
|
||||
@PostMapping("/export")
|
||||
@ -57,19 +57,19 @@ public class SysDictDataController extends BaseController {
|
||||
/**
|
||||
* 查询字典数据详细
|
||||
*/
|
||||
@ApiOperation("查询字典数据详细")
|
||||
@Operation(summary = "查询字典数据详细")
|
||||
@SaCheckPermission("system:dict:query")
|
||||
@GetMapping(value = "/{dictCode}")
|
||||
public R<SysDictData> getInfo(@ApiParam("字典code") @PathVariable Long dictCode) {
|
||||
public R<SysDictData> getInfo(@Parameter(name = "字典code") @PathVariable Long dictCode) {
|
||||
return R.ok(dictDataService.selectDictDataById(dictCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型查询字典数据信息
|
||||
*/
|
||||
@ApiOperation("根据字典类型查询字典数据信息")
|
||||
@Operation(summary = "根据字典类型查询字典数据信息")
|
||||
@GetMapping(value = "/type/{dictType}")
|
||||
public R<List<SysDictData>> dictType(@ApiParam("字典类型") @PathVariable String dictType) {
|
||||
public R<List<SysDictData>> dictType(@Parameter(name = "字典类型") @PathVariable String dictType) {
|
||||
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
||||
if (ObjectUtil.isNull(data)) {
|
||||
data = new ArrayList<>();
|
||||
@ -80,7 +80,7 @@ public class SysDictDataController extends BaseController {
|
||||
/**
|
||||
* 新增字典类型
|
||||
*/
|
||||
@ApiOperation("新增字典类型")
|
||||
@Operation(summary = "新增字典类型")
|
||||
@SaCheckPermission("system:dict:add")
|
||||
@Log(title = "字典数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ -91,7 +91,7 @@ public class SysDictDataController extends BaseController {
|
||||
/**
|
||||
* 修改保存字典类型
|
||||
*/
|
||||
@ApiOperation("修改保存字典类型")
|
||||
@Operation(summary = "修改保存字典类型")
|
||||
@SaCheckPermission("system:dict:edit")
|
||||
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ -102,11 +102,11 @@ public class SysDictDataController extends BaseController {
|
||||
/**
|
||||
* 删除字典类型
|
||||
*/
|
||||
@ApiOperation("删除字典类型")
|
||||
@Operation(summary = "删除字典类型")
|
||||
@SaCheckPermission("system:dict:remove")
|
||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictCodes}")
|
||||
public R<Void> remove(@ApiParam("字典code串") @PathVariable Long[] dictCodes) {
|
||||
public R<Void> remove(@Parameter(name = "字典code串") @PathVariable Long[] dictCodes) {
|
||||
dictDataService.deleteDictDataByIds(dictCodes);
|
||||
return R.ok();
|
||||
}
|
||||
|
@ -4,16 +4,16 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictType;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -27,7 +27,7 @@ import java.util.List;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "数据字典信息控制器", tags = {"数据字典信息管理"})
|
||||
@Tag(name ="数据字典信息控制器", description = "数据字典信息管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/dict/type")
|
||||
@ -35,14 +35,14 @@ public class SysDictTypeController extends BaseController {
|
||||
|
||||
private final ISysDictTypeService dictTypeService;
|
||||
|
||||
@ApiOperation("查询字典类型列表")
|
||||
@Operation(summary = "查询字典类型列表")
|
||||
@SaCheckPermission("system:dict:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysDictType> list(SysDictType dictType, PageQuery pageQuery) {
|
||||
return dictTypeService.selectPageDictTypeList(dictType, pageQuery);
|
||||
}
|
||||
|
||||
@ApiOperation("导出字典类型列表")
|
||||
@Operation(summary = "导出字典类型列表")
|
||||
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
||||
@SaCheckPermission("system:dict:export")
|
||||
@PostMapping("/export")
|
||||
@ -54,17 +54,17 @@ public class SysDictTypeController extends BaseController {
|
||||
/**
|
||||
* 查询字典类型详细
|
||||
*/
|
||||
@ApiOperation("查询字典类型详细")
|
||||
@Operation(summary = "查询字典类型详细")
|
||||
@SaCheckPermission("system:dict:query")
|
||||
@GetMapping(value = "/{dictId}")
|
||||
public R<SysDictType> getInfo(@ApiParam("字典ID") @PathVariable Long dictId) {
|
||||
public R<SysDictType> getInfo(@Parameter(name = "字典ID") @PathVariable Long dictId) {
|
||||
return R.ok(dictTypeService.selectDictTypeById(dictId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增字典类型
|
||||
*/
|
||||
@ApiOperation("新增字典类型")
|
||||
@Operation(summary = "新增字典类型")
|
||||
@SaCheckPermission("system:dict:add")
|
||||
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ -78,7 +78,7 @@ public class SysDictTypeController extends BaseController {
|
||||
/**
|
||||
* 修改字典类型
|
||||
*/
|
||||
@ApiOperation("修改字典类型")
|
||||
@Operation(summary = "修改字典类型")
|
||||
@SaCheckPermission("system:dict:edit")
|
||||
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ -92,11 +92,11 @@ public class SysDictTypeController extends BaseController {
|
||||
/**
|
||||
* 删除字典类型
|
||||
*/
|
||||
@ApiOperation("删除字典类型")
|
||||
@Operation(summary = "删除字典类型")
|
||||
@SaCheckPermission("system:dict:remove")
|
||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictIds}")
|
||||
public R<Void> remove(@ApiParam("字典ID串") @PathVariable Long[] dictIds) {
|
||||
public R<Void> remove(@Parameter(name = "字典ID串") @PathVariable Long[] dictIds) {
|
||||
dictTypeService.deleteDictTypeByIds(dictIds);
|
||||
return R.ok();
|
||||
}
|
||||
@ -104,7 +104,7 @@ public class SysDictTypeController extends BaseController {
|
||||
/**
|
||||
* 刷新字典缓存
|
||||
*/
|
||||
@ApiOperation("刷新字典缓存")
|
||||
@Operation(summary = "刷新字典缓存")
|
||||
@SaCheckPermission("system:dict:remove")
|
||||
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/refreshCache")
|
||||
@ -116,7 +116,7 @@ public class SysDictTypeController extends BaseController {
|
||||
/**
|
||||
* 获取字典选择框列表
|
||||
*/
|
||||
@ApiOperation("获取字典选择框列表")
|
||||
@Operation(summary = "获取字典选择框列表")
|
||||
@GetMapping("/optionselect")
|
||||
public R<List<SysDictType>> optionselect() {
|
||||
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
|
||||
|
@ -2,8 +2,8 @@ package com.ruoyi.web.controller.system;
|
||||
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Api(value = "首页控制器", tags = {"首页管理"})
|
||||
@Tag(name ="首页控制器", description = "首页管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
public class SysIndexController {
|
||||
@ -26,7 +26,7 @@ public class SysIndexController {
|
||||
/**
|
||||
* 访问首页,提示语
|
||||
*/
|
||||
@ApiOperation("访问首页,提示语")
|
||||
@Operation(summary = "访问首页,提示语")
|
||||
@GetMapping("/")
|
||||
public String index() {
|
||||
return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
|
||||
|
@ -13,8 +13,8 @@ import com.ruoyi.system.service.ISysMenuService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import com.ruoyi.system.service.SysLoginService;
|
||||
import com.ruoyi.system.service.SysPermissionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -34,7 +34,7 @@ import java.util.Set;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "登录验证控制器", tags = {"登录验证管理"})
|
||||
@Tag(name ="登录验证控制器", description = "登录验证管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
public class SysLoginController {
|
||||
@ -51,7 +51,7 @@ public class SysLoginController {
|
||||
* @return 结果
|
||||
*/
|
||||
@Anonymous
|
||||
@ApiOperation("登录方法")
|
||||
@Operation(summary = "登录方法")
|
||||
@PostMapping("/login")
|
||||
public R<Map<String, Object>> login(@Validated @RequestBody LoginBody loginBody) {
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
@ -69,7 +69,7 @@ public class SysLoginController {
|
||||
* @return 结果
|
||||
*/
|
||||
@Anonymous
|
||||
@ApiOperation("短信登录(示例)")
|
||||
@Operation(summary = "短信登录(示例)")
|
||||
@PostMapping("/smsLogin")
|
||||
public R<Map<String, Object>> smsLogin(@Validated @RequestBody SmsLoginBody smsLoginBody) {
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
@ -86,7 +86,7 @@ public class SysLoginController {
|
||||
* @return 结果
|
||||
*/
|
||||
@Anonymous
|
||||
@ApiOperation("小程序登录(示例)")
|
||||
@Operation(summary = "小程序登录(示例)")
|
||||
@PostMapping("/xcxLogin")
|
||||
public R<Map<String, Object>> xcxLogin(@NotBlank(message = "{xcx.code.not.blank}") String xcxCode) {
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
@ -97,7 +97,7 @@ public class SysLoginController {
|
||||
}
|
||||
|
||||
@Anonymous
|
||||
@ApiOperation("登出方法")
|
||||
@Operation(summary = "登出方法")
|
||||
@PostMapping("/logout")
|
||||
public R<Void> logout() {
|
||||
loginService.logout();
|
||||
@ -109,7 +109,7 @@ public class SysLoginController {
|
||||
*
|
||||
* @return 用户信息
|
||||
*/
|
||||
@ApiOperation("获取用户信息")
|
||||
@Operation(summary = "获取用户信息")
|
||||
@GetMapping("getInfo")
|
||||
public R<Map<String, Object>> getInfo() {
|
||||
SysUser user = userService.selectUserById(LoginHelper.getUserId());
|
||||
@ -129,7 +129,7 @@ public class SysLoginController {
|
||||
*
|
||||
* @return 路由信息
|
||||
*/
|
||||
@ApiOperation("获取路由信息")
|
||||
@Operation(summary = "获取路由信息")
|
||||
@GetMapping("getRouters")
|
||||
public R<List<RouterVo>> getRouters() {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
|
@ -10,9 +10,9 @@ import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -27,7 +27,7 @@ import java.util.Map;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "菜单信息控制器", tags = {"菜单信息管理"})
|
||||
@Tag(name ="菜单信息控制器", description = "菜单信息管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/menu")
|
||||
@ -38,7 +38,7 @@ public class SysMenuController extends BaseController {
|
||||
/**
|
||||
* 获取菜单列表
|
||||
*/
|
||||
@ApiOperation("获取菜单列表")
|
||||
@Operation(summary = "获取菜单列表")
|
||||
@SaCheckPermission("system:menu:list")
|
||||
@GetMapping("/list")
|
||||
public R<List<SysMenu>> list(SysMenu menu) {
|
||||
@ -49,17 +49,17 @@ public class SysMenuController extends BaseController {
|
||||
/**
|
||||
* 根据菜单编号获取详细信息
|
||||
*/
|
||||
@ApiOperation("根据菜单编号获取详细信息")
|
||||
@Operation(summary = "根据菜单编号获取详细信息")
|
||||
@SaCheckPermission("system:menu:query")
|
||||
@GetMapping(value = "/{menuId}")
|
||||
public R<SysMenu> getInfo(@ApiParam("菜单ID") @PathVariable Long menuId) {
|
||||
public R<SysMenu> getInfo(@Parameter(name = "菜单ID") @PathVariable Long menuId) {
|
||||
return R.ok(menuService.selectMenuById(menuId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单下拉树列表
|
||||
*/
|
||||
@ApiOperation("获取菜单下拉树列表")
|
||||
@Operation(summary = "获取菜单下拉树列表")
|
||||
@GetMapping("/treeselect")
|
||||
public R<List<Tree<Long>>> treeselect(SysMenu menu) {
|
||||
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
||||
@ -69,9 +69,9 @@ public class SysMenuController extends BaseController {
|
||||
/**
|
||||
* 加载对应角色菜单列表树
|
||||
*/
|
||||
@ApiOperation("加载对应角色菜单列表树")
|
||||
@Operation(summary = "加载对应角色菜单列表树")
|
||||
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
||||
public R<Map<String, Object>> roleMenuTreeselect(@ApiParam("角色ID") @PathVariable("roleId") Long roleId) {
|
||||
public R<Map<String, Object>> roleMenuTreeselect(@Parameter(name = "角色ID") @PathVariable("roleId") Long roleId) {
|
||||
List<SysMenu> menus = menuService.selectMenuList(getUserId());
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
|
||||
@ -82,7 +82,7 @@ public class SysMenuController extends BaseController {
|
||||
/**
|
||||
* 新增菜单
|
||||
*/
|
||||
@ApiOperation("新增菜单")
|
||||
@Operation(summary = "新增菜单")
|
||||
@SaCheckPermission("system:menu:add")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ -98,7 +98,7 @@ public class SysMenuController extends BaseController {
|
||||
/**
|
||||
* 修改菜单
|
||||
*/
|
||||
@ApiOperation("修改菜单")
|
||||
@Operation(summary = "修改菜单")
|
||||
@SaCheckPermission("system:menu:edit")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ -116,11 +116,11 @@ public class SysMenuController extends BaseController {
|
||||
/**
|
||||
* 删除菜单
|
||||
*/
|
||||
@ApiOperation("删除菜单")
|
||||
@Operation(summary = "删除菜单")
|
||||
@SaCheckPermission("system:menu:remove")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{menuId}")
|
||||
public R<Void> remove(@ApiParam("菜单ID") @PathVariable("menuId") Long menuId) {
|
||||
public R<Void> remove(@Parameter(name = "菜单ID") @PathVariable("menuId") Long menuId) {
|
||||
if (menuService.hasChildByMenuId(menuId)) {
|
||||
return R.fail("存在子菜单,不允许删除");
|
||||
}
|
||||
|
@ -3,15 +3,15 @@ package com.ruoyi.web.controller.system;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
import com.ruoyi.system.service.ISysNoticeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "公告信息控制器", tags = {"公告信息管理"})
|
||||
@Tag(name ="公告信息控制器", description = "公告信息管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/notice")
|
||||
@ -33,7 +33,7 @@ public class SysNoticeController extends BaseController {
|
||||
/**
|
||||
* 获取通知公告列表
|
||||
*/
|
||||
@ApiOperation("获取通知公告列表")
|
||||
@Operation(summary = "获取通知公告列表")
|
||||
@SaCheckPermission("system:notice:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysNotice> list(SysNotice notice, PageQuery pageQuery) {
|
||||
@ -43,17 +43,17 @@ public class SysNoticeController extends BaseController {
|
||||
/**
|
||||
* 根据通知公告编号获取详细信息
|
||||
*/
|
||||
@ApiOperation("根据通知公告编号获取详细信息")
|
||||
@Operation(summary = "根据通知公告编号获取详细信息")
|
||||
@SaCheckPermission("system:notice:query")
|
||||
@GetMapping(value = "/{noticeId}")
|
||||
public R<SysNotice> getInfo(@ApiParam("公告ID") @PathVariable Long noticeId) {
|
||||
public R<SysNotice> getInfo(@Parameter(name = "公告ID") @PathVariable Long noticeId) {
|
||||
return R.ok(noticeService.selectNoticeById(noticeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增通知公告
|
||||
*/
|
||||
@ApiOperation("新增通知公告")
|
||||
@Operation(summary = "新增通知公告")
|
||||
@SaCheckPermission("system:notice:add")
|
||||
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ -64,7 +64,7 @@ public class SysNoticeController extends BaseController {
|
||||
/**
|
||||
* 修改通知公告
|
||||
*/
|
||||
@ApiOperation("修改通知公告")
|
||||
@Operation(summary = "修改通知公告")
|
||||
@SaCheckPermission("system:notice:edit")
|
||||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ -75,11 +75,11 @@ public class SysNoticeController extends BaseController {
|
||||
/**
|
||||
* 删除通知公告
|
||||
*/
|
||||
@ApiOperation("删除通知公告")
|
||||
@Operation(summary = "删除通知公告")
|
||||
@SaCheckPermission("system:notice:remove")
|
||||
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{noticeIds}")
|
||||
public R<Void> remove(@ApiParam("公告ID串") @PathVariable Long[] noticeIds) {
|
||||
public R<Void> remove(@Parameter(name = "公告ID串") @PathVariable Long[] noticeIds) {
|
||||
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
@ -14,9 +14,9 @@ import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.bo.SysOssConfigBo;
|
||||
import com.ruoyi.system.domain.vo.SysOssConfigVo;
|
||||
import com.ruoyi.system.service.ISysOssConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -33,7 +33,7 @@ import java.util.Arrays;
|
||||
* @date 2021-08-13
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "对象存储配置控制器", tags = {"对象存储配置管理"})
|
||||
@Tag(name ="对象存储配置控制器", description = "对象存储配置管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/oss/config")
|
||||
@ -44,7 +44,7 @@ public class SysOssConfigController extends BaseController {
|
||||
/**
|
||||
* 查询对象存储配置列表
|
||||
*/
|
||||
@ApiOperation("查询对象存储配置列表")
|
||||
@Operation(summary = "查询对象存储配置列表")
|
||||
@SaCheckPermission("system:oss:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysOssConfigVo> list(@Validated(QueryGroup.class) SysOssConfigBo bo, PageQuery pageQuery) {
|
||||
@ -54,10 +54,10 @@ public class SysOssConfigController extends BaseController {
|
||||
/**
|
||||
* 获取对象存储配置详细信息
|
||||
*/
|
||||
@ApiOperation("获取对象存储配置详细信息")
|
||||
@Operation(summary = "获取对象存储配置详细信息")
|
||||
@SaCheckPermission("system:oss:query")
|
||||
@GetMapping("/{ossConfigId}")
|
||||
public R<SysOssConfigVo> getInfo(@ApiParam("OSS配置ID")
|
||||
public R<SysOssConfigVo> getInfo(@Parameter(name = "OSS配置ID")
|
||||
@NotNull(message = "主键不能为空")
|
||||
@PathVariable("ossConfigId") Long ossConfigId) {
|
||||
return R.ok(iSysOssConfigService.queryById(ossConfigId));
|
||||
@ -66,7 +66,7 @@ public class SysOssConfigController extends BaseController {
|
||||
/**
|
||||
* 新增对象存储配置
|
||||
*/
|
||||
@ApiOperation("新增对象存储配置")
|
||||
@Operation(summary = "新增对象存储配置")
|
||||
@SaCheckPermission("system:oss:add")
|
||||
@Log(title = "对象存储配置", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@ -78,7 +78,7 @@ public class SysOssConfigController extends BaseController {
|
||||
/**
|
||||
* 修改对象存储配置
|
||||
*/
|
||||
@ApiOperation("修改对象存储配置")
|
||||
@Operation(summary = "修改对象存储配置")
|
||||
@SaCheckPermission("system:oss:edit")
|
||||
@Log(title = "对象存储配置", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@ -90,11 +90,11 @@ public class SysOssConfigController extends BaseController {
|
||||
/**
|
||||
* 删除对象存储配置
|
||||
*/
|
||||
@ApiOperation("删除对象存储配置")
|
||||
@Operation(summary = "删除对象存储配置")
|
||||
@SaCheckPermission("system:oss:remove")
|
||||
@Log(title = "对象存储配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ossConfigIds}")
|
||||
public R<Void> remove(@ApiParam("OSS配置ID串")
|
||||
public R<Void> remove(@Parameter(name = "OSS配置ID串")
|
||||
@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ossConfigIds) {
|
||||
return toAjax(iSysOssConfigService.deleteWithValidByIds(Arrays.asList(ossConfigIds), true) ? 1 : 0);
|
||||
@ -103,7 +103,7 @@ public class SysOssConfigController extends BaseController {
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
@ApiOperation("状态修改")
|
||||
@Operation(summary = "状态修改")
|
||||
@SaCheckPermission("system:oss:edit")
|
||||
@Log(title = "对象存储状态修改", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
|
@ -19,7 +19,11 @@ import com.ruoyi.system.domain.SysOss;
|
||||
import com.ruoyi.system.domain.bo.SysOssBo;
|
||||
import com.ruoyi.system.domain.vo.SysOssVo;
|
||||
import com.ruoyi.system.service.ISysOssService;
|
||||
import io.swagger.annotations.*;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -28,7 +32,6 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@ -41,7 +44,7 @@ import java.util.Map;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "对象存储控制器", tags = {"对象存储管理"})
|
||||
@Tag(name ="对象存储控制器", description = "对象存储管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/oss")
|
||||
@ -52,7 +55,7 @@ public class SysOssController extends BaseController {
|
||||
/**
|
||||
* 查询OSS对象存储列表
|
||||
*/
|
||||
@ApiOperation("查询OSS对象存储列表")
|
||||
@Operation(summary = "查询OSS对象存储列表")
|
||||
@SaCheckPermission("system:oss:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysOssVo> list(@Validated(QueryGroup.class) SysOssBo bo, PageQuery pageQuery) {
|
||||
@ -62,10 +65,10 @@ public class SysOssController extends BaseController {
|
||||
/**
|
||||
* 查询OSS对象基于id串
|
||||
*/
|
||||
@ApiOperation("查询OSS对象基于ID")
|
||||
@Operation(summary = "查询OSS对象基于ID")
|
||||
@SaCheckPermission("system:oss:list")
|
||||
@GetMapping("/listByIds/{ossIds}")
|
||||
public R<List<SysOssVo>> listByIds(@ApiParam("OSS对象ID串")
|
||||
public R<List<SysOssVo>> listByIds(@Parameter(name = "OSS对象ID串")
|
||||
@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ossIds) {
|
||||
List<SysOssVo> list = iSysOssService.listByIds(Arrays.asList(ossIds));
|
||||
@ -75,9 +78,9 @@ public class SysOssController extends BaseController {
|
||||
/**
|
||||
* 上传OSS对象存储
|
||||
*/
|
||||
@ApiOperation("上传OSS对象存储")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "file", value = "文件", paramType = "query", dataTypeClass = File.class, required = true)
|
||||
@Operation(summary = "上传OSS对象存储")
|
||||
@Parameters({
|
||||
@Parameter(name = "file", description = "文件", in = ParameterIn.QUERY, required = true)
|
||||
})
|
||||
@SaCheckPermission("system:oss:upload")
|
||||
@Log(title = "OSS对象存储", businessType = BusinessType.INSERT)
|
||||
@ -94,10 +97,10 @@ public class SysOssController extends BaseController {
|
||||
return R.ok(map);
|
||||
}
|
||||
|
||||
@ApiOperation("下载OSS对象存储")
|
||||
@Operation(summary = "下载OSS对象存储")
|
||||
@SaCheckPermission("system:oss:download")
|
||||
@GetMapping("/download/{ossId}")
|
||||
public void download(@ApiParam("OSS对象ID") @PathVariable Long ossId, HttpServletResponse response) throws IOException {
|
||||
public void download(@Parameter(name = "OSS对象ID") @PathVariable Long ossId, HttpServletResponse response) throws IOException {
|
||||
SysOss sysOss = iSysOssService.getById(ossId);
|
||||
if (ObjectUtil.isNull(sysOss)) {
|
||||
throw new ServiceException("文件数据不存在!");
|
||||
@ -121,11 +124,11 @@ public class SysOssController extends BaseController {
|
||||
/**
|
||||
* 删除OSS对象存储
|
||||
*/
|
||||
@ApiOperation("删除OSS对象存储")
|
||||
@Operation(summary = "删除OSS对象存储")
|
||||
@SaCheckPermission("system:oss:remove")
|
||||
@Log(title = "OSS对象存储", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ossIds}")
|
||||
public R<Void> remove(@ApiParam("OSS对象ID串")
|
||||
public R<Void> remove(@Parameter(name = "OSS对象ID串")
|
||||
@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ossIds) {
|
||||
return toAjax(iSysOssService.deleteWithValidByIds(Arrays.asList(ossIds), true) ? 1 : 0);
|
||||
|
@ -4,16 +4,16 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
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.system.service.ISysPostService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -27,7 +27,7 @@ import java.util.List;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "岗位信息控制器", tags = {"岗位信息管理"})
|
||||
@Tag(name ="岗位信息控制器", description = "岗位信息管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/post")
|
||||
@ -38,14 +38,14 @@ public class SysPostController extends BaseController {
|
||||
/**
|
||||
* 获取岗位列表
|
||||
*/
|
||||
@ApiOperation("获取岗位列表")
|
||||
@Operation(summary = "获取岗位列表")
|
||||
@SaCheckPermission("system:post:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysPost> list(SysPost post, PageQuery pageQuery) {
|
||||
return postService.selectPagePostList(post, pageQuery);
|
||||
}
|
||||
|
||||
@ApiOperation("导出岗位列表")
|
||||
@Operation(summary = "导出岗位列表")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
||||
@SaCheckPermission("system:post:export")
|
||||
@PostMapping("/export")
|
||||
@ -57,17 +57,17 @@ public class SysPostController extends BaseController {
|
||||
/**
|
||||
* 根据岗位编号获取详细信息
|
||||
*/
|
||||
@ApiOperation("根据岗位编号获取详细信息")
|
||||
@Operation(summary = "根据岗位编号获取详细信息")
|
||||
@SaCheckPermission("system:post:query")
|
||||
@GetMapping(value = "/{postId}")
|
||||
public R<SysPost> getInfo(@ApiParam("岗位ID") @PathVariable Long postId) {
|
||||
public R<SysPost> getInfo(@Parameter(name = "岗位ID") @PathVariable Long postId) {
|
||||
return R.ok(postService.selectPostById(postId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增岗位
|
||||
*/
|
||||
@ApiOperation("新增岗位")
|
||||
@Operation(summary = "新增岗位")
|
||||
@SaCheckPermission("system:post:add")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ -83,7 +83,7 @@ public class SysPostController extends BaseController {
|
||||
/**
|
||||
* 修改岗位
|
||||
*/
|
||||
@ApiOperation("修改岗位")
|
||||
@Operation(summary = "修改岗位")
|
||||
@SaCheckPermission("system:post:edit")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ -99,18 +99,18 @@ public class SysPostController extends BaseController {
|
||||
/**
|
||||
* 删除岗位
|
||||
*/
|
||||
@ApiOperation("删除岗位")
|
||||
@Operation(summary = "删除岗位")
|
||||
@SaCheckPermission("system:post:remove")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{postIds}")
|
||||
public R<Void> remove(@ApiParam("岗位ID串") @PathVariable Long[] postIds) {
|
||||
public R<Void> remove(@Parameter(name = "岗位ID串") @PathVariable Long[] postIds) {
|
||||
return toAjax(postService.deletePostByIds(postIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取岗位选择框列表
|
||||
*/
|
||||
@ApiOperation("获取岗位选择框列表")
|
||||
@Operation(summary = "获取岗位选择框列表")
|
||||
@GetMapping("/optionselect")
|
||||
public R<List<SysPost>> optionselect() {
|
||||
List<SysPost> posts = postService.selectPostAll();
|
||||
|
@ -14,16 +14,16 @@ import com.ruoyi.common.utils.file.MimeTypeUtils;
|
||||
import com.ruoyi.system.domain.SysOss;
|
||||
import com.ruoyi.system.service.ISysOssService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -34,7 +34,7 @@ import java.util.Map;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "个人信息控制器", tags = {"个人信息管理"})
|
||||
@Tag(name ="个人信息控制器", description = "个人信息管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/user/profile")
|
||||
@ -46,7 +46,7 @@ public class SysProfileController extends BaseController {
|
||||
/**
|
||||
* 个人信息
|
||||
*/
|
||||
@ApiOperation("个人信息")
|
||||
@Operation(summary = "个人信息")
|
||||
@GetMapping
|
||||
public R<Map<String, Object>> profile() {
|
||||
SysUser user = userService.selectUserById(getUserId());
|
||||
@ -60,7 +60,7 @@ public class SysProfileController extends BaseController {
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@ApiOperation("修改用户")
|
||||
@Operation(summary = "修改用户")
|
||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> updateProfile(@RequestBody SysUser user) {
|
||||
@ -84,10 +84,10 @@ public class SysProfileController extends BaseController {
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
@ApiOperation("重置密码")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "oldPassword", value = "旧密码", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "newPassword", value = "新密码", paramType = "query", dataTypeClass = String.class)
|
||||
@Operation(summary = "重置密码")
|
||||
@Parameters({
|
||||
@Parameter(name = "oldPassword", description = "旧密码", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "newPassword", description = "新密码", in = ParameterIn.QUERY)
|
||||
})
|
||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/updatePwd")
|
||||
@ -111,9 +111,9 @@ public class SysProfileController extends BaseController {
|
||||
/**
|
||||
* 头像上传
|
||||
*/
|
||||
@ApiOperation("头像上传")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "avatarfile", value = "用户头像", paramType = "query", dataTypeClass = File.class, required = true)
|
||||
@Operation(summary = "头像上传")
|
||||
@Parameters({
|
||||
@Parameter(name = "avatarfile", description = "用户头像", in = ParameterIn.QUERY, required = true)
|
||||
})
|
||||
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/avatar")
|
||||
|
@ -6,8 +6,8 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.model.RegisterBody;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.system.service.SysRegisterService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "注册验证控制器", tags = {"注册验证管理"})
|
||||
@Tag(name ="注册验证控制器", description = "注册验证管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
public class SysRegisterController extends BaseController {
|
||||
@ -29,7 +29,7 @@ public class SysRegisterController extends BaseController {
|
||||
private final ISysConfigService configService;
|
||||
|
||||
@Anonymous
|
||||
@ApiOperation("用户注册")
|
||||
@Operation(summary = "用户注册")
|
||||
@PostMapping("/register")
|
||||
public R<Void> register(@Validated @RequestBody RegisterBody user) {
|
||||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) {
|
||||
|
@ -5,8 +5,8 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
@ -18,7 +18,11 @@ import com.ruoyi.system.domain.SysUserRole;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import com.ruoyi.system.service.SysPermissionService;
|
||||
import io.swagger.annotations.*;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -32,7 +36,7 @@ import java.util.List;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "角色信息控制器", tags = {"角色信息管理"})
|
||||
@Tag(name ="角色信息控制器", description = "角色信息管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/role")
|
||||
@ -42,14 +46,14 @@ public class SysRoleController extends BaseController {
|
||||
private final ISysUserService userService;
|
||||
private final SysPermissionService permissionService;
|
||||
|
||||
@ApiOperation("查询角色信息列表")
|
||||
@Operation(summary = "查询角色信息列表")
|
||||
@SaCheckPermission("system:role:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysRole> list(SysRole role, PageQuery pageQuery) {
|
||||
return roleService.selectPageRoleList(role, pageQuery);
|
||||
}
|
||||
|
||||
@ApiOperation("导出角色信息列表")
|
||||
@Operation(summary = "导出角色信息列表")
|
||||
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
||||
@SaCheckPermission("system:role:export")
|
||||
@PostMapping("/export")
|
||||
@ -61,10 +65,10 @@ public class SysRoleController extends BaseController {
|
||||
/**
|
||||
* 根据角色编号获取详细信息
|
||||
*/
|
||||
@ApiOperation("根据角色编号获取详细信息")
|
||||
@Operation(summary = "根据角色编号获取详细信息")
|
||||
@SaCheckPermission("system:role:query")
|
||||
@GetMapping(value = "/{roleId}")
|
||||
public R<SysRole> getInfo(@ApiParam("角色ID") @PathVariable Long roleId) {
|
||||
public R<SysRole> getInfo(@Parameter(name = "角色ID") @PathVariable Long roleId) {
|
||||
roleService.checkRoleDataScope(roleId);
|
||||
return R.ok(roleService.selectRoleById(roleId));
|
||||
}
|
||||
@ -72,7 +76,7 @@ public class SysRoleController extends BaseController {
|
||||
/**
|
||||
* 新增角色
|
||||
*/
|
||||
@ApiOperation("新增角色")
|
||||
@Operation(summary = "新增角色")
|
||||
@SaCheckPermission("system:role:add")
|
||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ -89,7 +93,7 @@ public class SysRoleController extends BaseController {
|
||||
/**
|
||||
* 修改保存角色
|
||||
*/
|
||||
@ApiOperation("修改保存角色")
|
||||
@Operation(summary = "修改保存角色")
|
||||
@SaCheckPermission("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ -118,7 +122,7 @@ public class SysRoleController extends BaseController {
|
||||
/**
|
||||
* 修改保存数据权限
|
||||
*/
|
||||
@ApiOperation("修改保存数据权限")
|
||||
@Operation(summary = "修改保存数据权限")
|
||||
@SaCheckPermission("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/dataScope")
|
||||
@ -131,7 +135,7 @@ public class SysRoleController extends BaseController {
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
@ApiOperation("状态修改")
|
||||
@Operation(summary = "状态修改")
|
||||
@SaCheckPermission("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
@ -144,18 +148,18 @@ public class SysRoleController extends BaseController {
|
||||
/**
|
||||
* 删除角色
|
||||
*/
|
||||
@ApiOperation("删除角色")
|
||||
@Operation(summary = "删除角色")
|
||||
@SaCheckPermission("system:role:remove")
|
||||
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{roleIds}")
|
||||
public R<Void> remove(@ApiParam("角色ID串") @PathVariable Long[] roleIds) {
|
||||
public R<Void> remove(@Parameter(name = "角色ID串") @PathVariable Long[] roleIds) {
|
||||
return toAjax(roleService.deleteRoleByIds(roleIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色选择框列表
|
||||
*/
|
||||
@ApiOperation("获取角色选择框列表")
|
||||
@Operation(summary = "获取角色选择框列表")
|
||||
@SaCheckPermission("system:role:query")
|
||||
@GetMapping("/optionselect")
|
||||
public R<List<SysRole>> optionselect() {
|
||||
@ -165,7 +169,7 @@ public class SysRoleController extends BaseController {
|
||||
/**
|
||||
* 查询已分配用户角色列表
|
||||
*/
|
||||
@ApiOperation("查询已分配用户角色列表")
|
||||
@Operation(summary = "查询已分配用户角色列表")
|
||||
@SaCheckPermission("system:role:list")
|
||||
@GetMapping("/authUser/allocatedList")
|
||||
public TableDataInfo<SysUser> allocatedList(SysUser user, PageQuery pageQuery) {
|
||||
@ -175,7 +179,7 @@ public class SysRoleController extends BaseController {
|
||||
/**
|
||||
* 查询未分配用户角色列表
|
||||
*/
|
||||
@ApiOperation("查询未分配用户角色列表")
|
||||
@Operation(summary = "查询未分配用户角色列表")
|
||||
@SaCheckPermission("system:role:list")
|
||||
@GetMapping("/authUser/unallocatedList")
|
||||
public TableDataInfo<SysUser> unallocatedList(SysUser user, PageQuery pageQuery) {
|
||||
@ -185,7 +189,7 @@ public class SysRoleController extends BaseController {
|
||||
/**
|
||||
* 取消授权用户
|
||||
*/
|
||||
@ApiOperation("取消授权用户")
|
||||
@Operation(summary = "取消授权用户")
|
||||
@SaCheckPermission("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/cancel")
|
||||
@ -196,10 +200,10 @@ public class SysRoleController extends BaseController {
|
||||
/**
|
||||
* 批量取消授权用户
|
||||
*/
|
||||
@ApiOperation("批量取消授权用户")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "roleId", value = "角色ID", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "userIds", value = "用户ID串", paramType = "query", dataTypeClass = String.class)
|
||||
@Operation(summary = "批量取消授权用户")
|
||||
@Parameters({
|
||||
@Parameter(name = "roleId", description = "角色ID", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "userIds", description = "用户ID串", in = ParameterIn.QUERY)
|
||||
})
|
||||
@SaCheckPermission("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@ -211,10 +215,10 @@ public class SysRoleController extends BaseController {
|
||||
/**
|
||||
* 批量选择用户授权
|
||||
*/
|
||||
@ApiOperation("批量选择用户授权")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "roleId", value = "角色ID", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "userIds", value = "用户ID串", paramType = "query", dataTypeClass = String.class)
|
||||
@Operation(summary = "批量选择用户授权")
|
||||
@Parameters({
|
||||
@Parameter(name = "roleId", description = "角色ID", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "userIds", description = "用户ID串", in = ParameterIn.QUERY)
|
||||
})
|
||||
@SaCheckPermission("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
|
@ -26,7 +26,11 @@ import com.ruoyi.system.listener.SysUserImportListener;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import io.swagger.annotations.*;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -44,7 +48,7 @@ import java.util.Map;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "用户信息控制器", tags = {"用户信息管理"})
|
||||
@Tag(name ="用户信息控制器", description = "用户信息管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/user")
|
||||
@ -57,14 +61,14 @@ public class SysUserController extends BaseController {
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@ApiOperation("获取用户列表")
|
||||
@Operation(summary = "获取用户列表")
|
||||
@SaCheckPermission("system:user:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysUser> list(SysUser user, PageQuery pageQuery) {
|
||||
return userService.selectPageUserList(user, pageQuery);
|
||||
}
|
||||
|
||||
@ApiOperation("导出用户列表")
|
||||
@Operation(summary = "导出用户列表")
|
||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||
@SaCheckPermission("system:user:export")
|
||||
@PostMapping("/export")
|
||||
@ -82,9 +86,9 @@ public class SysUserController extends BaseController {
|
||||
ExcelUtil.exportExcel(listVo, "用户数据", SysUserExportVo.class, response);
|
||||
}
|
||||
|
||||
@ApiOperation("导入用户列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "file", value = "导入文件", dataType = "java.io.File", required = true),
|
||||
@Operation(summary = "导入用户列表")
|
||||
@Parameters({
|
||||
@Parameter(name = "file", description = "导入文件", required = true),
|
||||
})
|
||||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||
@SaCheckPermission("system:user:import")
|
||||
@ -94,7 +98,7 @@ public class SysUserController extends BaseController {
|
||||
return R.ok(result.getAnalysis());
|
||||
}
|
||||
|
||||
@ApiOperation("下载导入模板")
|
||||
@Operation(summary = "下载导入模板")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil.exportExcel(new ArrayList<>(), "用户数据", SysUserImportVo.class, response);
|
||||
@ -103,10 +107,10 @@ public class SysUserController extends BaseController {
|
||||
/**
|
||||
* 根据用户编号获取详细信息
|
||||
*/
|
||||
@ApiOperation("根据用户编号获取详细信息")
|
||||
@Operation(summary = "根据用户编号获取详细信息")
|
||||
@SaCheckPermission("system:user:query")
|
||||
@GetMapping(value = {"/", "/{userId}"})
|
||||
public R<Map<String, Object>> getInfo(@ApiParam("用户ID") @PathVariable(value = "userId", required = false) Long userId) {
|
||||
public R<Map<String, Object>> getInfo(@Parameter(name = "用户ID") @PathVariable(value = "userId", required = false) Long userId) {
|
||||
userService.checkUserDataScope(userId);
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
List<SysRole> roles = roleService.selectRoleAll();
|
||||
@ -124,7 +128,7 @@ public class SysUserController extends BaseController {
|
||||
/**
|
||||
* 新增用户
|
||||
*/
|
||||
@ApiOperation("新增用户")
|
||||
@Operation(summary = "新增用户")
|
||||
@SaCheckPermission("system:user:add")
|
||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ -145,7 +149,7 @@ public class SysUserController extends BaseController {
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@ApiOperation("修改用户")
|
||||
@Operation(summary = "修改用户")
|
||||
@SaCheckPermission("system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ -165,11 +169,11 @@ public class SysUserController extends BaseController {
|
||||
/**
|
||||
* 删除用户
|
||||
*/
|
||||
@ApiOperation("删除用户")
|
||||
@Operation(summary = "删除用户")
|
||||
@SaCheckPermission("system:user:remove")
|
||||
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{userIds}")
|
||||
public R<Void> remove(@ApiParam("角色ID串") @PathVariable Long[] userIds) {
|
||||
public R<Void> remove(@Parameter(name = "角色ID串") @PathVariable Long[] userIds) {
|
||||
if (ArrayUtil.contains(userIds, getUserId())) {
|
||||
return R.fail("当前用户不能删除");
|
||||
}
|
||||
@ -179,7 +183,7 @@ public class SysUserController extends BaseController {
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
@ApiOperation("重置密码")
|
||||
@Operation(summary = "重置密码")
|
||||
@SaCheckPermission("system:user:resetPwd")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/resetPwd")
|
||||
@ -193,7 +197,7 @@ public class SysUserController extends BaseController {
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
@ApiOperation("状态修改")
|
||||
@Operation(summary = "状态修改")
|
||||
@SaCheckPermission("system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
@ -206,10 +210,10 @@ public class SysUserController extends BaseController {
|
||||
/**
|
||||
* 根据用户编号获取授权角色
|
||||
*/
|
||||
@ApiOperation("根据用户编号获取授权角色")
|
||||
@Operation(summary = "根据用户编号获取授权角色")
|
||||
@SaCheckPermission("system:user:query")
|
||||
@GetMapping("/authRole/{userId}")
|
||||
public R<Map<String, Object>> authRole(@ApiParam("用户ID") @PathVariable("userId") Long userId) {
|
||||
public R<Map<String, Object>> authRole(@Parameter(name = "用户ID") @PathVariable("userId") Long userId) {
|
||||
SysUser user = userService.selectUserById(userId);
|
||||
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
@ -221,10 +225,10 @@ public class SysUserController extends BaseController {
|
||||
/**
|
||||
* 用户授权角色
|
||||
*/
|
||||
@ApiOperation("用户授权角色")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "用户Id", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "roleIds", value = "角色ID串", paramType = "query", dataTypeClass = String.class)
|
||||
@Operation(summary = "用户授权角色")
|
||||
@Parameters({
|
||||
@Parameter(name = "userId", description = "用户Id", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "roleIds", description = "角色ID串", in = ParameterIn.QUERY)
|
||||
})
|
||||
@SaCheckPermission("system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
||||
|
@ -126,9 +126,8 @@ security:
|
||||
# swagger 文档配置
|
||||
- /favicon.ico
|
||||
- /doc.html
|
||||
- /swagger-resources/**
|
||||
- /webjars/**
|
||||
- /*/api-docs
|
||||
- /swagger-ui/**
|
||||
- /*/api-docs/**
|
||||
# druid 监控配置
|
||||
- /druid/**
|
||||
# actuator 监控配置
|
||||
@ -183,8 +182,7 @@ mybatis-plus:
|
||||
swagger:
|
||||
# 是否开启swagger
|
||||
enabled: true
|
||||
# 请求前缀
|
||||
pathMapping: /dev-api
|
||||
info:
|
||||
# 标题
|
||||
title: '标题:${ruoyi.name}后台管理系统_接口文档'
|
||||
# 描述
|
||||
@ -196,33 +194,33 @@ swagger:
|
||||
name: Lion Li
|
||||
email: crazylionli@163.com
|
||||
url: https://gitee.com/JavaLionLi/RuoYi-Vue-Plus
|
||||
groups:
|
||||
- name: 1.演示案例
|
||||
basePackage: com.ruoyi.demo
|
||||
- name: 2.系统模块
|
||||
basePackage: com.ruoyi.web
|
||||
- name: 3.代码生成模块
|
||||
basePackage: com.ruoyi.generator
|
||||
components:
|
||||
# 鉴权方式配置
|
||||
security-schemes:
|
||||
apiKey:
|
||||
type: APIKEY
|
||||
in: HEADER
|
||||
name: ${sa-token.token-name}
|
||||
|
||||
knife4j:
|
||||
# 是否开启Knife4j增强模式
|
||||
enable: true
|
||||
# 是否开启生产环境保护策略
|
||||
production: @knife4j.production@
|
||||
basic:
|
||||
enable: true
|
||||
username: ruoyi
|
||||
password: 123456
|
||||
# 前端Ui的个性化配置属性
|
||||
setting:
|
||||
# 默认语言
|
||||
language: zh-CN
|
||||
# 是否显示Footer
|
||||
enableFooter: false
|
||||
# 是否开启动态参数调试功能
|
||||
enableDynamicParameter: true
|
||||
# 是否在每个Debug调试栏后显示刷新变量按钮
|
||||
enableReloadCacheParameter: true
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
# 修改Swagger UI路径
|
||||
path: /doc.html
|
||||
# 开启Swagger UI界面
|
||||
enabled: true
|
||||
api-docs:
|
||||
# 修改api-docs路径
|
||||
path: /v3/api-docs
|
||||
# 开启api-docs
|
||||
enabled: true
|
||||
#这里定义了两个分组,可定义多个,也可以不定义
|
||||
group-configs:
|
||||
- group: 演示模块
|
||||
packages-to-scan: com.ruoyi.demo
|
||||
- group: 系统模块
|
||||
packages-to-scan: com.ruoyi.web
|
||||
- group: 代码生成模块
|
||||
packages-to-scan: com.ruoyi.generator
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
|
@ -126,13 +126,8 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 自动生成YML配置关联JSON文件 -->
|
||||
|
@ -2,7 +2,7 @@ package com.ruoyi.common.core.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -24,42 +24,42 @@ public class BaseEntity implements Serializable {
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
@ApiModelProperty(value = "搜索值")
|
||||
@Schema(name = "搜索值")
|
||||
@TableField(exist = false)
|
||||
private String searchValue;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@ApiModelProperty(value = "创建者")
|
||||
@Schema(name = "创建者")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Schema(name = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@ApiModelProperty(value = "更新者")
|
||||
@Schema(name = "更新者")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@Schema(name = "更新时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@ApiModelProperty(value = "请求参数")
|
||||
@Schema(name = "请求参数")
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
|
||||
|
@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.sql.SqlUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -24,25 +24,25 @@ public class PageQuery implements Serializable {
|
||||
/**
|
||||
* 分页大小
|
||||
*/
|
||||
@ApiModelProperty("分页大小")
|
||||
@Schema(name = "分页大小")
|
||||
private Integer pageSize;
|
||||
|
||||
/**
|
||||
* 当前页数
|
||||
*/
|
||||
@ApiModelProperty("当前页数")
|
||||
@Schema(name = "当前页数")
|
||||
private Integer pageNum;
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
@ApiModelProperty("排序列")
|
||||
@Schema(name = "排序列")
|
||||
private String orderByColumn;
|
||||
|
||||
/**
|
||||
* 排序的方向desc或者asc
|
||||
*/
|
||||
@ApiModelProperty(value = "排序的方向", example = "asc,desc")
|
||||
@Schema(name = "排序的方向", example = "asc,desc")
|
||||
private String isAsc;
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.ruoyi.common.core.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@ -14,7 +13,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@ApiModel("请求响应对象")
|
||||
@Schema(name = "请求响应对象")
|
||||
public class R<T> implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -28,13 +27,13 @@ public class R<T> implements Serializable {
|
||||
*/
|
||||
public static final int FAIL = 500;
|
||||
|
||||
@ApiModelProperty("消息状态码")
|
||||
@Schema(name = "消息状态码")
|
||||
private int code;
|
||||
|
||||
@ApiModelProperty("消息内容")
|
||||
@Schema(name = "消息内容")
|
||||
private String msg;
|
||||
|
||||
@ApiModelProperty("数据对象")
|
||||
@Schema(name = "数据对象")
|
||||
private T data;
|
||||
|
||||
public static <T> R<T> ok() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.ruoyi.common.core.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -24,20 +24,20 @@ public class TreeEntity<T> extends BaseEntity {
|
||||
* 父菜单名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "父菜单名称")
|
||||
@Schema(name = "父菜单名称")
|
||||
private String parentName;
|
||||
|
||||
/**
|
||||
* 父菜单ID
|
||||
*/
|
||||
@ApiModelProperty(value = "父菜单ID")
|
||||
@Schema(name = "父菜单ID")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 子部门
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "子部门")
|
||||
@Schema(name = "子部门")
|
||||
private List<T> children = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
@ -4,8 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.core.domain.TreeEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -23,21 +22,21 @@ import javax.validation.constraints.Size;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_dept")
|
||||
@ApiModel("部门业务对象")
|
||||
@Schema(name = "部门业务对象")
|
||||
public class SysDept extends TreeEntity<SysDept> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@ApiModelProperty(value = "部门id")
|
||||
@Schema(name = "部门id")
|
||||
@TableId(value = "dept_id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
@Schema(name = "部门名称")
|
||||
@NotBlank(message = "部门名称不能为空")
|
||||
@Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
|
||||
private String deptName;
|
||||
@ -45,27 +44,27 @@ public class SysDept extends TreeEntity<SysDept> {
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
@Schema(name = "显示顺序")
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
@ApiModelProperty(value = "负责人")
|
||||
@Schema(name = "负责人")
|
||||
private String leader;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
@Schema(name = "联系电话")
|
||||
@Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
@Schema(name = "邮箱")
|
||||
@Email(message = "邮箱格式不正确")
|
||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
||||
private String email;
|
||||
@ -73,20 +72,20 @@ public class SysDept extends TreeEntity<SysDept> {
|
||||
/**
|
||||
* 部门状态:0正常,1停用
|
||||
*/
|
||||
@ApiModelProperty(value = "部门状态:0正常,1停用")
|
||||
@Schema(name = "部门状态:0正常,1停用")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
@ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
|
||||
@Schema(name = "删除标志(0代表存在 2代表删除)")
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
@ApiModelProperty(value = "祖级列表")
|
||||
@Schema(name = "祖级列表")
|
||||
private String ancestors;
|
||||
|
||||
}
|
||||
|
@ -8,8 +8,7 @@ import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -26,13 +25,13 @@ import javax.validation.constraints.Size;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_dict_data")
|
||||
@ExcelIgnoreUnannotated
|
||||
@ApiModel("字典数据业务对象")
|
||||
@Schema(name = "字典数据业务对象")
|
||||
public class SysDictData extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 字典编码
|
||||
*/
|
||||
@ApiModelProperty(value = "字典编码")
|
||||
@Schema(name = "字典编码")
|
||||
@ExcelProperty(value = "字典编码")
|
||||
@TableId(value = "dict_code")
|
||||
private Long dictCode;
|
||||
@ -40,14 +39,14 @@ public class SysDictData extends BaseEntity {
|
||||
/**
|
||||
* 字典排序
|
||||
*/
|
||||
@ApiModelProperty(value = "字典排序")
|
||||
@Schema(name = "字典排序")
|
||||
@ExcelProperty(value = "字典排序")
|
||||
private Integer dictSort;
|
||||
|
||||
/**
|
||||
* 字典标签
|
||||
*/
|
||||
@ApiModelProperty(value = "字典标签")
|
||||
@Schema(name = "字典标签")
|
||||
@ExcelProperty(value = "字典标签")
|
||||
@NotBlank(message = "字典标签不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
|
||||
@ -56,7 +55,7 @@ public class SysDictData extends BaseEntity {
|
||||
/**
|
||||
* 字典键值
|
||||
*/
|
||||
@ApiModelProperty(value = "字典键值")
|
||||
@Schema(name = "字典键值")
|
||||
@ExcelProperty(value = "字典键值")
|
||||
@NotBlank(message = "字典键值不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
|
||||
@ -65,7 +64,7 @@ public class SysDictData extends BaseEntity {
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
@ApiModelProperty(value = "字典类型")
|
||||
@Schema(name = "字典类型")
|
||||
@ExcelProperty(value = "字典类型")
|
||||
@NotBlank(message = "字典类型不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
|
||||
@ -74,20 +73,20 @@ public class SysDictData extends BaseEntity {
|
||||
/**
|
||||
* 样式属性(其他样式扩展)
|
||||
*/
|
||||
@ApiModelProperty(value = "样式属性(其他样式扩展)")
|
||||
@Schema(name = "样式属性(其他样式扩展)")
|
||||
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
|
||||
private String cssClass;
|
||||
|
||||
/**
|
||||
* 表格字典样式
|
||||
*/
|
||||
@ApiModelProperty(value = "表格字典样式")
|
||||
@Schema(name = "表格字典样式")
|
||||
private String listClass;
|
||||
|
||||
/**
|
||||
* 是否默认(Y是 N否)
|
||||
*/
|
||||
@ApiModelProperty(value = "是否默认(Y是 N否)")
|
||||
@Schema(name = "是否默认(Y是 N否)")
|
||||
@ExcelProperty(value = "是否默认", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_yes_no")
|
||||
private String isDefault;
|
||||
@ -95,7 +94,7 @@ public class SysDictData extends BaseEntity {
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@ApiModelProperty(value = "状态(0正常 1停用)")
|
||||
@Schema(name = "状态(0正常 1停用)")
|
||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_normal_disable")
|
||||
private String status;
|
||||
@ -103,7 +102,7 @@ public class SysDictData extends BaseEntity {
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(name = "备注")
|
||||
private String remark;
|
||||
|
||||
public boolean getDefault() {
|
||||
|
@ -7,11 +7,9 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
@ -27,13 +25,13 @@ import javax.validation.constraints.Size;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_dict_type")
|
||||
@ExcelIgnoreUnannotated
|
||||
@ApiModel("字典类型业务对象")
|
||||
@Schema(name = "字典类型业务对象")
|
||||
public class SysDictType extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 字典主键
|
||||
*/
|
||||
@ApiModelProperty(value = "字典主键")
|
||||
@Schema(name = "字典主键")
|
||||
@ExcelProperty(value = "字典主键")
|
||||
@TableId(value = "dict_id")
|
||||
private Long dictId;
|
||||
@ -41,7 +39,7 @@ public class SysDictType extends BaseEntity {
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
@ApiModelProperty(value = "字典名称")
|
||||
@Schema(name = "字典名称")
|
||||
@ExcelProperty(value = "字典名称")
|
||||
@NotBlank(message = "字典名称不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
|
||||
@ -50,7 +48,7 @@ public class SysDictType extends BaseEntity {
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
@ApiModelProperty(value = "字典类型")
|
||||
@Schema(name = "字典类型")
|
||||
@ExcelProperty(value = "字典类型")
|
||||
@NotBlank(message = "字典类型不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
|
||||
@ -60,7 +58,7 @@ public class SysDictType extends BaseEntity {
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@ApiModelProperty(value = "状态(0正常 1停用)")
|
||||
@Schema(name = "状态(0正常 1停用)")
|
||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_normal_disable")
|
||||
private String status;
|
||||
@ -68,7 +66,7 @@ public class SysDictType extends BaseEntity {
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(name = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@ -4,8 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.ruoyi.common.core.domain.TreeEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -22,20 +21,20 @@ import javax.validation.constraints.Size;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_menu")
|
||||
@ApiModel("菜单权限业务对象")
|
||||
@Schema(name = "菜单权限业务对象")
|
||||
public class SysMenu extends TreeEntity<SysMenu> {
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单ID")
|
||||
@Schema(name = "菜单ID")
|
||||
@TableId(value = "menu_id")
|
||||
private Long menuId;
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单名称")
|
||||
@Schema(name = "菜单名称")
|
||||
@NotBlank(message = "菜单名称不能为空")
|
||||
@Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符")
|
||||
private String menuName;
|
||||
@ -43,65 +42,65 @@ public class SysMenu extends TreeEntity<SysMenu> {
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
@Schema(name = "显示顺序")
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
@ApiModelProperty(value = "路由地址")
|
||||
@Schema(name = "路由地址")
|
||||
@Size(min = 0, max = 200, message = "路由地址不能超过200个字符")
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 组件路径
|
||||
*/
|
||||
@ApiModelProperty(value = "组件路径")
|
||||
@Schema(name = "组件路径")
|
||||
@Size(min = 0, max = 200, message = "组件路径不能超过255个字符")
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 路由参数
|
||||
*/
|
||||
@ApiModelProperty(value = "路由参数")
|
||||
@Schema(name = "路由参数")
|
||||
private String queryParam;
|
||||
|
||||
/**
|
||||
* 是否为外链(0是 1否)
|
||||
*/
|
||||
@ApiModelProperty(value = "是否为外链(0是 1否)")
|
||||
@Schema(name = "是否为外链(0是 1否)")
|
||||
private String isFrame;
|
||||
|
||||
/**
|
||||
* 是否缓存(0缓存 1不缓存)
|
||||
*/
|
||||
@ApiModelProperty(value = "是否缓存(0缓存 1不缓存)")
|
||||
@Schema(name = "是否缓存(0缓存 1不缓存)")
|
||||
private String isCache;
|
||||
|
||||
/**
|
||||
* 类型(M目录 C菜单 F按钮)
|
||||
*/
|
||||
@ApiModelProperty(value = "类型(M目录 C菜单 F按钮)")
|
||||
@Schema(name = "类型(M目录 C菜单 F按钮)")
|
||||
@NotBlank(message = "菜单类型不能为空")
|
||||
private String menuType;
|
||||
|
||||
/**
|
||||
* 显示状态(0显示 1隐藏)
|
||||
*/
|
||||
@ApiModelProperty(value = "显示状态(0显示 1隐藏)")
|
||||
@Schema(name = "显示状态(0显示 1隐藏)")
|
||||
private String visible;
|
||||
|
||||
/**
|
||||
* 菜单状态(0显示 1隐藏)
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单状态(0显示 1隐藏)")
|
||||
@Schema(name = "菜单状态(0显示 1隐藏)")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 权限字符串
|
||||
*/
|
||||
@ApiModelProperty(value = "权限字符串")
|
||||
@Schema(name = "权限字符串")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符")
|
||||
private String perms;
|
||||
@ -109,13 +108,13 @@ public class SysMenu extends TreeEntity<SysMenu> {
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单图标")
|
||||
@Schema(name = "菜单图标")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(name = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -35,7 +35,7 @@ public class SysRole extends BaseEntity {
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
@Schema(name = "角色ID")
|
||||
@ExcelProperty(value = "角色序号")
|
||||
@TableId(value = "role_id")
|
||||
private Long roleId;
|
||||
@ -43,7 +43,7 @@ public class SysRole extends BaseEntity {
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
@ApiModelProperty(value = "角色名称")
|
||||
@Schema(name = "角色名称")
|
||||
@ExcelProperty(value = "角色名称")
|
||||
@NotBlank(message = "角色名称不能为空")
|
||||
@Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符")
|
||||
@ -52,7 +52,7 @@ public class SysRole extends BaseEntity {
|
||||
/**
|
||||
* 角色权限
|
||||
*/
|
||||
@ApiModelProperty(value = "角色权限")
|
||||
@Schema(name = "角色权限")
|
||||
@ExcelProperty(value = "角色权限")
|
||||
@NotBlank(message = "权限字符不能为空")
|
||||
@Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符")
|
||||
@ -61,7 +61,7 @@ public class SysRole extends BaseEntity {
|
||||
/**
|
||||
* 角色排序
|
||||
*/
|
||||
@ApiModelProperty(value = "角色排序")
|
||||
@Schema(name = "角色排序")
|
||||
@ExcelProperty(value = "角色排序")
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer roleSort;
|
||||
@ -69,7 +69,7 @@ public class SysRole extends BaseEntity {
|
||||
/**
|
||||
* 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限)
|
||||
*/
|
||||
@ApiModelProperty(value = "数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限)")
|
||||
@Schema(name = "数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限)")
|
||||
@ExcelProperty(value = "数据范围", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
|
||||
private String dataScope;
|
||||
@ -77,19 +77,19 @@ public class SysRole extends BaseEntity {
|
||||
/**
|
||||
* 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示)
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示)")
|
||||
@Schema(name = "菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示)")
|
||||
private Boolean menuCheckStrictly;
|
||||
|
||||
/**
|
||||
* 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 )
|
||||
*/
|
||||
@ApiModelProperty(value = "部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 )")
|
||||
@Schema(name = "部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 )")
|
||||
private Boolean deptCheckStrictly;
|
||||
|
||||
/**
|
||||
* 角色状态(0正常 1停用)
|
||||
*/
|
||||
@ApiModelProperty(value = "角色状态(0正常 1停用)")
|
||||
@Schema(name = "角色状态(0正常 1停用)")
|
||||
@ExcelProperty(value = "角色状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_common_status")
|
||||
private String status;
|
||||
@ -97,34 +97,34 @@ public class SysRole extends BaseEntity {
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
@ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
|
||||
@Schema(name = "删除标志(0代表存在 2代表删除)")
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(name = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 用户是否存在此角色标识 默认不存在
|
||||
*/
|
||||
@ApiModelProperty(value = "用户是否存在此角色标识 默认不存在")
|
||||
@Schema(name = "用户是否存在此角色标识 默认不存在")
|
||||
@TableField(exist = false)
|
||||
private boolean flag = false;
|
||||
|
||||
/**
|
||||
* 菜单组
|
||||
*/
|
||||
@ApiModelProperty(value = "菜单组")
|
||||
@Schema(name = "菜单组")
|
||||
@TableField(exist = false)
|
||||
private Long[] menuIds;
|
||||
|
||||
/**
|
||||
* 部门组(数据权限)
|
||||
*/
|
||||
@ApiModelProperty(value = "部门组(数据权限)")
|
||||
@Schema(name = "部门组(数据权限)")
|
||||
@TableField(exist = false)
|
||||
private Long[] deptIds;
|
||||
|
||||
@ -132,7 +132,7 @@ public class SysRole extends BaseEntity {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
@ApiModelProperty(value = "是否管理员")
|
||||
@Schema(name = "是否管理员")
|
||||
public boolean isAdmin() {
|
||||
return UserConstants.ADMIN_ID.equals(this.roleId);
|
||||
}
|
||||
|
@ -1,15 +1,12 @@
|
||||
package com.ruoyi.common.core.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.ruoyi.common.annotation.Sensitive;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.enums.SensitiveStrategy;
|
||||
import com.ruoyi.common.xss.Xss;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -30,26 +27,26 @@ import java.util.List;
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_user")
|
||||
@ApiModel("用户信息业务对象")
|
||||
@Schema(name = "用户信息业务对象")
|
||||
public class SysUser extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@Schema(name = "用户ID")
|
||||
@TableId(value = "user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@ApiModelProperty(value = "部门ID")
|
||||
@Schema(name = "部门ID")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@ApiModelProperty(value = "用户账号")
|
||||
@Schema(name = "用户账号")
|
||||
@Xss(message = "用户账号不能包含脚本字符")
|
||||
@NotBlank(message = "用户账号不能为空")
|
||||
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
||||
@ -58,7 +55,7 @@ public class SysUser extends BaseEntity {
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@ApiModelProperty(value = "用户昵称")
|
||||
@Schema(name = "用户昵称")
|
||||
@Xss(message = "用户昵称不能包含脚本字符")
|
||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||
private String nickName;
|
||||
@ -66,14 +63,14 @@ public class SysUser extends BaseEntity {
|
||||
/**
|
||||
* 用户类型(sys_user系统用户)
|
||||
*/
|
||||
@ApiModelProperty(value = "用户类型")
|
||||
@Schema(name = "用户类型")
|
||||
private String userType;
|
||||
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
@Sensitive(strategy = SensitiveStrategy.EMAIL)
|
||||
@ApiModelProperty(value = "用户邮箱")
|
||||
@Schema(name = "用户邮箱")
|
||||
@Email(message = "邮箱格式不正确")
|
||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
||||
private String email;
|
||||
@ -82,25 +79,25 @@ public class SysUser extends BaseEntity {
|
||||
* 手机号码
|
||||
*/
|
||||
@Sensitive(strategy = SensitiveStrategy.PHONE)
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
@Schema(name = "手机号码")
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 用户性别
|
||||
*/
|
||||
@ApiModelProperty(value = "用户性别")
|
||||
@Schema(name = "用户性别")
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
@ApiModelProperty(value = "用户头像")
|
||||
@Schema(name = "用户头像")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@ApiModelProperty(value = "密码")
|
||||
@Schema(name = "密码")
|
||||
@TableField(
|
||||
insertStrategy = FieldStrategy.NOT_EMPTY,
|
||||
updateStrategy = FieldStrategy.NOT_EMPTY,
|
||||
@ -111,66 +108,66 @@ public class SysUser extends BaseEntity {
|
||||
/**
|
||||
* 帐号状态(0正常 1停用)
|
||||
*/
|
||||
@ApiModelProperty(value = "帐号状态(0正常 1停用)")
|
||||
@Schema(name = "帐号状态(0正常 1停用)")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
@ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
|
||||
@Schema(name = "删除标志(0代表存在 2代表删除)")
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
@ApiModelProperty(value = "最后登录IP")
|
||||
@Schema(name = "最后登录IP")
|
||||
private String loginIp;
|
||||
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
@ApiModelProperty(value = "最后登录时间")
|
||||
@Schema(name = "最后登录时间")
|
||||
private Date loginDate;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(name = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 部门对象
|
||||
*/
|
||||
@ApiModelProperty(value = "部门对象")
|
||||
@Schema(name = "部门对象")
|
||||
@TableField(exist = false)
|
||||
private SysDept dept;
|
||||
|
||||
/**
|
||||
* 角色对象
|
||||
*/
|
||||
@ApiModelProperty(value = "角色对象")
|
||||
@Schema(name = "角色对象")
|
||||
@TableField(exist = false)
|
||||
private List<SysRole> roles;
|
||||
|
||||
/**
|
||||
* 角色组
|
||||
*/
|
||||
@ApiModelProperty(value = "角色组")
|
||||
@Schema(name = "角色组")
|
||||
@TableField(exist = false)
|
||||
private Long[] roleIds;
|
||||
|
||||
/**
|
||||
* 岗位组
|
||||
*/
|
||||
@ApiModelProperty(value = "岗位组")
|
||||
@Schema(name = "岗位组")
|
||||
@TableField(exist = false)
|
||||
private Long[] postIds;
|
||||
|
||||
/**
|
||||
* 数据权限 当前角色ID
|
||||
*/
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
@Schema(name = "角色ID")
|
||||
@TableField(exist = false)
|
||||
private Long roleId;
|
||||
|
||||
@ -178,7 +175,7 @@ public class SysUser extends BaseEntity {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
@ApiModelProperty(value = "是否管理员")
|
||||
@Schema(name = "是否管理员")
|
||||
public boolean isAdmin() {
|
||||
return UserConstants.ADMIN_ID.equals(this.userId);
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
@ -15,7 +14,7 @@ import javax.validation.constraints.NotBlank;
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel("用户登录对象")
|
||||
@Schema(name = "用户登录对象")
|
||||
public class LoginBody {
|
||||
|
||||
/**
|
||||
@ -23,7 +22,7 @@ public class LoginBody {
|
||||
*/
|
||||
@NotBlank(message = "{user.username.not.blank}")
|
||||
@Length(min = UserConstants.USERNAME_MIN_LENGTH, max = UserConstants.USERNAME_MAX_LENGTH, message = "{user.username.length.valid}")
|
||||
@ApiModelProperty(value = "用户名")
|
||||
@Schema(name = "用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
@ -31,19 +30,19 @@ public class LoginBody {
|
||||
*/
|
||||
@NotBlank(message = "{user.password.not.blank}")
|
||||
@Length(min = UserConstants.PASSWORD_MIN_LENGTH, max = UserConstants.PASSWORD_MAX_LENGTH, message = "{user.password.length.valid}")
|
||||
@ApiModelProperty(value = "用户密码")
|
||||
@Schema(name = "用户密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 验证码
|
||||
*/
|
||||
@ApiModelProperty(value = "验证码")
|
||||
@Schema(name = "验证码")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 唯一标识
|
||||
*/
|
||||
@ApiModelProperty(value = "唯一标识")
|
||||
@Schema(name = "唯一标识")
|
||||
private String uuid;
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -12,10 +11,10 @@ import lombok.EqualsAndHashCode;
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("用户注册对象")
|
||||
@Schema(name = "用户注册对象")
|
||||
public class RegisterBody extends LoginBody {
|
||||
|
||||
@ApiModelProperty(value = "用户类型")
|
||||
@Schema(name = "用户类型")
|
||||
private String userType;
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.ruoyi.common.core.domain.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@ -13,21 +12,21 @@ import javax.validation.constraints.NotBlank;
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel("短信登录对象")
|
||||
@Schema(name = "短信登录对象")
|
||||
public class SmsLoginBody {
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@NotBlank(message = "{user.phonenumber.not.blank}")
|
||||
@ApiModelProperty(value = "用户手机号")
|
||||
@Schema(name = "用户手机号")
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 用户密码
|
||||
*/
|
||||
@NotBlank(message = "{sms.code.not.blank}")
|
||||
@ApiModelProperty(value = "短信验证码")
|
||||
@Schema(name = "短信验证码")
|
||||
private String smsCode;
|
||||
|
||||
}
|
||||
|
@ -2,11 +2,9 @@ package com.ruoyi.common.core.page;
|
||||
|
||||
import cn.hutool.http.HttpStatus;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@ -19,32 +17,32 @@ import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@ApiModel("分页响应对象")
|
||||
@Schema(name = "分页响应对象")
|
||||
public class TableDataInfo<T> implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 总记录数
|
||||
*/
|
||||
@ApiModelProperty("总记录数")
|
||||
@Schema(name = "总记录数")
|
||||
private long total;
|
||||
|
||||
/**
|
||||
* 列表数据
|
||||
*/
|
||||
@ApiModelProperty("列表数据")
|
||||
@Schema(name = "列表数据")
|
||||
private List<T> rows;
|
||||
|
||||
/**
|
||||
* 消息状态码
|
||||
*/
|
||||
@ApiModelProperty("消息状态码")
|
||||
@Schema(name = "消息状态码")
|
||||
private int code;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
@ApiModelProperty("消息内容")
|
||||
@Schema(name = "消息内容")
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
|
@ -2,9 +2,9 @@ package com.ruoyi.demo.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.email.MailUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -20,27 +20,27 @@ import java.io.File;
|
||||
* @author Michelle.Chung
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "邮件发送案例", tags = {"邮件发送案例"})
|
||||
@Tag(name ="邮件发送案例", description = "邮件发送案例")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/mail")
|
||||
public class MailController {
|
||||
|
||||
@ApiOperation("发送邮件")
|
||||
@Operation(summary = "发送邮件")
|
||||
@GetMapping("/sendSimpleMessage")
|
||||
public R<Void> sendSimpleMessage(@ApiParam("接收人") String to,
|
||||
@ApiParam("标题") String subject,
|
||||
@ApiParam("内容") String text) {
|
||||
public R<Void> sendSimpleMessage(@Parameter(name = "接收人") String to,
|
||||
@Parameter(name = "标题") String subject,
|
||||
@Parameter(name = "内容") String text) {
|
||||
MailUtils.sendText(to, subject, text);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("发送邮件(带附件)")
|
||||
@Operation(summary = "发送邮件(带附件)")
|
||||
@GetMapping("/sendMessageWithAttachment")
|
||||
public R<Void> sendMessageWithAttachment(@ApiParam("接收人") String to,
|
||||
@ApiParam("标题") String subject,
|
||||
@ApiParam("内容") String text,
|
||||
@ApiParam("附件路径") String filePath) {
|
||||
public R<Void> sendMessageWithAttachment(@Parameter(name = "接收人") String to,
|
||||
@Parameter(name = "标题") String subject,
|
||||
@Parameter(name = "内容") String text,
|
||||
@Parameter(name = "附件路径") String filePath) {
|
||||
MailUtils.sendText(to, subject, text, new File(filePath));
|
||||
return R.ok();
|
||||
}
|
||||
|
@ -2,8 +2,8 @@ package com.ruoyi.demo.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.CachePut;
|
||||
@ -21,7 +21,7 @@ import java.time.Duration;
|
||||
*/
|
||||
// 类级别 缓存统一配置
|
||||
//@CacheConfig(cacheNames = "redissonCacheMap")
|
||||
@Api(value = "spring-cache 演示案例", tags = {"spring-cache 演示案例"})
|
||||
@Tag(name ="spring-cache 演示案例", description = "spring-cache 演示案例")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/cache")
|
||||
@ -41,7 +41,7 @@ public class RedisCacheController {
|
||||
* <p>
|
||||
* cacheNames 为配置文件内 groupId
|
||||
*/
|
||||
@ApiOperation("测试 @Cacheable")
|
||||
@Operation(summary = "测试 @Cacheable")
|
||||
@Cacheable(cacheNames = "redissonCacheMap", key = "#key", condition = "#key != null")
|
||||
@GetMapping("/test1")
|
||||
public R<String> test1(String key, String value) {
|
||||
@ -56,7 +56,7 @@ public class RedisCacheController {
|
||||
* <p>
|
||||
* cacheNames 为 配置文件内 groupId
|
||||
*/
|
||||
@ApiOperation("测试 @CachePut")
|
||||
@Operation(summary = "测试 @CachePut")
|
||||
@CachePut(cacheNames = "redissonCacheMap", key = "#key", condition = "#key != null")
|
||||
@GetMapping("/test2")
|
||||
public R<String> test2(String key, String value) {
|
||||
@ -71,7 +71,7 @@ public class RedisCacheController {
|
||||
* <p>
|
||||
* cacheNames 为 配置文件内 groupId
|
||||
*/
|
||||
@ApiOperation("测试 @CacheEvict")
|
||||
@Operation(summary = "测试 @CacheEvict")
|
||||
@CacheEvict(cacheNames = "redissonCacheMap", key = "#key", condition = "#key != null")
|
||||
@GetMapping("/test3")
|
||||
public R<String> test3(String key, String value) {
|
||||
@ -83,7 +83,7 @@ public class RedisCacheController {
|
||||
* 手动设置过期时间10秒
|
||||
* 11秒后获取 判断是否相等
|
||||
*/
|
||||
@ApiOperation("测试设置过期时间")
|
||||
@Operation(summary = "测试设置过期时间")
|
||||
@GetMapping("/test6")
|
||||
public R<Boolean> test6(String key, String value) {
|
||||
RedisUtils.setCacheObject(key, value);
|
||||
|
@ -5,8 +5,8 @@ import com.baomidou.lock.LockTemplate;
|
||||
import com.baomidou.lock.annotation.Lock4j;
|
||||
import com.baomidou.lock.executor.RedissonLockExecutor;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -21,7 +21,7 @@ import java.time.LocalTime;
|
||||
*
|
||||
* @author shenxinquan
|
||||
*/
|
||||
@Api(value = "测试分布式锁的样例", tags = {"测试分布式锁的样例"})
|
||||
@Tag(name ="测试分布式锁的样例", description = "测试分布式锁的样例")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/demo/redisLock")
|
||||
@ -33,7 +33,7 @@ public class RedisLockController {
|
||||
/**
|
||||
* 测试lock4j 注解
|
||||
*/
|
||||
@ApiOperation("测试lock4j 注解")
|
||||
@Operation(summary = "测试lock4j 注解")
|
||||
@Lock4j(keys = {"#key"})
|
||||
@GetMapping("/testLock4j")
|
||||
public R<String> testLock4j(String key, String value) {
|
||||
@ -50,7 +50,7 @@ public class RedisLockController {
|
||||
/**
|
||||
* 测试lock4j 工具
|
||||
*/
|
||||
@ApiOperation("测试lock4j 工具")
|
||||
@Operation(summary = "测试lock4j 工具")
|
||||
@GetMapping("/testLock4jLockTemplate")
|
||||
public R<String> testLock4jLockTemplate(String key, String value) {
|
||||
final LockInfo lockInfo = lockTemplate.lock(key, 30000L, 5000L, RedissonLockExecutor.class);
|
||||
|
@ -2,9 +2,9 @@ package com.ruoyi.demo.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -15,24 +15,24 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Api(value = "Redis发布订阅 演示案例", tags = {"Redis发布订阅"})
|
||||
@Tag(name ="Redis发布订阅 演示案例", description = "Redis发布订阅")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/redis/pubsub")
|
||||
public class RedisPubSubController {
|
||||
|
||||
@ApiOperation("发布消息")
|
||||
@Operation(summary = "发布消息")
|
||||
@GetMapping("/pub")
|
||||
public R<Void> pub(@ApiParam("通道Key") String key, @ApiParam("发送内容") String value) {
|
||||
public R<Void> pub(@Parameter(name = "通道Key") String key, @Parameter(name = "发送内容") String value) {
|
||||
RedisUtils.publish(key, value, consumer -> {
|
||||
System.out.println("发布通道 => " + key + ", 发送值 => " + value);
|
||||
});
|
||||
return R.ok("操作成功");
|
||||
}
|
||||
|
||||
@ApiOperation("订阅消息")
|
||||
@Operation(summary = "订阅消息")
|
||||
@GetMapping("/sub")
|
||||
public R<Void> sub(@ApiParam("通道Key") String key) {
|
||||
public R<Void> sub(@Parameter(name = "通道Key") String key) {
|
||||
RedisUtils.subscribe(key, String.class, msg -> {
|
||||
System.out.println("订阅通道 => " + key + ", 接收值 => " + msg);
|
||||
});
|
||||
|
@ -3,8 +3,8 @@ package com.ruoyi.demo.controller;
|
||||
import com.ruoyi.common.annotation.RateLimiter;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.enums.LimitType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Api(value = "测试分布式限流样例", tags = {"测试分布式限流样例"})
|
||||
@Tag(name ="测试分布式限流样例", description = "测试分布式限流样例")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/demo/rateLimiter")
|
||||
@ -26,7 +26,7 @@ public class RedisRateLimiterController {
|
||||
* 测试全局限流
|
||||
* 全局影响
|
||||
*/
|
||||
@ApiOperation("测试全局限流")
|
||||
@Operation(summary = "测试全局限流")
|
||||
@RateLimiter(count = 2, time = 10)
|
||||
@GetMapping("/test")
|
||||
public R<String> test(String value) {
|
||||
@ -37,7 +37,7 @@ public class RedisRateLimiterController {
|
||||
* 测试请求IP限流
|
||||
* 同一IP请求受影响
|
||||
*/
|
||||
@ApiOperation("测试请求IP限流")
|
||||
@Operation(summary = "测试请求IP限流")
|
||||
@RateLimiter(count = 2, time = 10, limitType = LimitType.IP)
|
||||
@GetMapping("/testip")
|
||||
public R<String> testip(String value) {
|
||||
@ -48,7 +48,7 @@ public class RedisRateLimiterController {
|
||||
* 测试集群实例限流
|
||||
* 启动两个后端服务互不影响
|
||||
*/
|
||||
@ApiOperation("测试集群实例限流")
|
||||
@Operation(summary = "测试集群实例限流")
|
||||
@RateLimiter(count = 2, time = 10, limitType = LimitType.CLUSTER)
|
||||
@GetMapping("/testcluster")
|
||||
public R<String> testcluster(String value) {
|
||||
|
@ -4,9 +4,9 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.sms.config.properties.SmsProperties;
|
||||
import com.ruoyi.sms.core.SmsTemplate;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -24,7 +24,7 @@ import java.util.Map;
|
||||
* @version 4.2.0
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "短信演示案例", tags = {"短信演示案例"})
|
||||
@Tag(name ="短信演示案例", description = "短信演示案例")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/sms")
|
||||
@ -34,10 +34,10 @@ public class SmsController {
|
||||
// private final SmsTemplate smsTemplate; // 可以使用spring注入
|
||||
// private final AliyunSmsTemplate smsTemplate; // 也可以注入某个厂家的模板工具
|
||||
|
||||
@ApiOperation("发送短信Aliyun")
|
||||
@Operation(summary = "发送短信Aliyun")
|
||||
@GetMapping("/sendAliyun")
|
||||
public R<Object> sendAliyun(@ApiParam("电话号") String phones,
|
||||
@ApiParam("模板ID") String templateId) {
|
||||
public R<Object> sendAliyun(@Parameter(name = "电话号") String phones,
|
||||
@Parameter(name = "模板ID") String templateId) {
|
||||
if (!smsProperties.getEnabled()) {
|
||||
return R.fail("当前系统没有开启短信功能!");
|
||||
}
|
||||
@ -51,10 +51,10 @@ public class SmsController {
|
||||
return R.ok(send);
|
||||
}
|
||||
|
||||
@ApiOperation("发送短信Tencent")
|
||||
@Operation(summary = "发送短信Tencent")
|
||||
@GetMapping("/sendTencent")
|
||||
public R<Object> sendTencent(@ApiParam("电话号") String phones,
|
||||
@ApiParam("模板ID") String templateId) {
|
||||
public R<Object> sendTencent(@Parameter(name = "电话号") String phones,
|
||||
@Parameter(name = "模板ID") String templateId) {
|
||||
if (!smsProperties.getEnabled()) {
|
||||
return R.fail("当前系统没有开启短信功能!");
|
||||
}
|
||||
|
@ -1,24 +1,23 @@
|
||||
package com.ruoyi.demo.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* swagger3 用法示例
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Api(value = "演示swagger3控制器", tags = {"演示swagger3接口"})
|
||||
@Tag(name ="演示swagger3控制器", description = "演示swagger3接口")
|
||||
@RestController
|
||||
@RequestMapping("/swagger/demo")
|
||||
public class Swagger3DemoController {
|
||||
@ -27,9 +26,9 @@ public class Swagger3DemoController {
|
||||
* 上传请求
|
||||
* 必须使用 @RequestPart 注解标注为文件
|
||||
*/
|
||||
@ApiOperation(value = "通用上传请求")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "file", value = "文件", paramType = "query", dataTypeClass = File.class, required = true)
|
||||
@Operation(summary = "通用上传请求")
|
||||
@Parameters({
|
||||
@Parameter(name = "file", description = "文件", in = ParameterIn.QUERY, required = true)
|
||||
})
|
||||
@PostMapping(value = "/upload")
|
||||
public R<String> upload(@RequestPart("file") MultipartFile file) {
|
||||
|
@ -5,8 +5,8 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.demo.domain.TestDemo;
|
||||
import com.ruoyi.demo.mapper.TestDemoMapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -22,7 +22,7 @@ import java.util.List;
|
||||
* @author Lion Li
|
||||
* @date 2021-05-30
|
||||
*/
|
||||
@Api(value = "测试批量方法", tags = {"测试批量方法"})
|
||||
@Tag(name ="测试批量方法", description = "测试批量方法")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/batch")
|
||||
@ -38,7 +38,7 @@ public class TestBatchController extends BaseController {
|
||||
* <p>
|
||||
* 3.5.0 版本 增加 rewriteBatchedStatements=true 批处理参数 使 MP 原生批处理可以达到同样的速度
|
||||
*/
|
||||
@ApiOperation(value = "新增批量方法")
|
||||
@Operation(summary = "新增批量方法")
|
||||
@PostMapping("/add")
|
||||
// @DS("slave")
|
||||
public R<Void> add() {
|
||||
@ -58,7 +58,7 @@ public class TestBatchController extends BaseController {
|
||||
* <p>
|
||||
* 3.5.0 版本 增加 rewriteBatchedStatements=true 批处理参数 使 MP 原生批处理可以达到同样的速度
|
||||
*/
|
||||
@ApiOperation(value = "新增或更新批量方法")
|
||||
@Operation(summary = "新增或更新批量方法")
|
||||
@PostMapping("/addOrUpdate")
|
||||
// @DS("slave")
|
||||
public R<Void> addOrUpdate() {
|
||||
@ -84,7 +84,7 @@ public class TestBatchController extends BaseController {
|
||||
/**
|
||||
* 删除批量方法
|
||||
*/
|
||||
@ApiOperation(value = "删除批量方法")
|
||||
@Operation(summary = "删除批量方法")
|
||||
@DeleteMapping()
|
||||
// @DS("slave")
|
||||
public R<Void> remove() {
|
||||
|
@ -5,8 +5,8 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
@ -20,7 +20,11 @@ import com.ruoyi.demo.domain.bo.TestDemoBo;
|
||||
import com.ruoyi.demo.domain.bo.TestDemoImportVo;
|
||||
import com.ruoyi.demo.domain.vo.TestDemoVo;
|
||||
import com.ruoyi.demo.service.ITestDemoService;
|
||||
import io.swagger.annotations.*;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -29,7 +33,6 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@ -41,7 +44,7 @@ import java.util.concurrent.TimeUnit;
|
||||
* @date 2021-07-26
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "测试单表控制器", tags = {"测试单表管理"})
|
||||
@Tag(name ="测试单表控制器", description = "测试单表管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/demo")
|
||||
@ -52,7 +55,7 @@ public class TestDemoController extends BaseController {
|
||||
/**
|
||||
* 查询测试单表列表
|
||||
*/
|
||||
@ApiOperation("查询测试单表列表")
|
||||
@Operation(summary = "查询测试单表列表")
|
||||
@SaCheckPermission("demo:demo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<TestDemoVo> list(@Validated(QueryGroup.class) TestDemoBo bo, PageQuery pageQuery) {
|
||||
@ -62,16 +65,16 @@ public class TestDemoController extends BaseController {
|
||||
/**
|
||||
* 自定义分页查询
|
||||
*/
|
||||
@ApiOperation("自定义分页查询")
|
||||
@Operation(summary = "自定义分页查询")
|
||||
@SaCheckPermission("demo:demo:list")
|
||||
@GetMapping("/page")
|
||||
public TableDataInfo<TestDemoVo> page(@Validated(QueryGroup.class) TestDemoBo bo, PageQuery pageQuery) {
|
||||
return iTestDemoService.customPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
@ApiOperation("导入测试-校验")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "file", value = "导入文件", paramType = "query", dataTypeClass = File.class, required = true),
|
||||
@Operation(summary = "导入测试-校验")
|
||||
@Parameters({
|
||||
@Parameter(name = "file", description = "导入文件", in = ParameterIn.QUERY, required = true),
|
||||
})
|
||||
@Log(title = "测试单表", businessType = BusinessType.IMPORT)
|
||||
@SaCheckPermission("demo:demo:import")
|
||||
@ -87,7 +90,7 @@ public class TestDemoController extends BaseController {
|
||||
/**
|
||||
* 导出测试单表列表
|
||||
*/
|
||||
@ApiOperation("导出测试单表列表")
|
||||
@Operation(summary = "导出测试单表列表")
|
||||
@SaCheckPermission("demo:demo:export")
|
||||
@Log(title = "测试单表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ -103,10 +106,10 @@ public class TestDemoController extends BaseController {
|
||||
/**
|
||||
* 获取测试单表详细信息
|
||||
*/
|
||||
@ApiOperation("获取测试单表详细信息")
|
||||
@Operation(summary = "获取测试单表详细信息")
|
||||
@SaCheckPermission("demo:demo:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<TestDemoVo> getInfo(@ApiParam("测试ID")
|
||||
public R<TestDemoVo> getInfo(@Parameter(name = "测试ID")
|
||||
@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(iTestDemoService.queryById(id));
|
||||
@ -115,7 +118,7 @@ public class TestDemoController extends BaseController {
|
||||
/**
|
||||
* 新增测试单表
|
||||
*/
|
||||
@ApiOperation("新增测试单表")
|
||||
@Operation(summary = "新增测试单表")
|
||||
@SaCheckPermission("demo:demo:add")
|
||||
@Log(title = "测试单表", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit(interval = 2, timeUnit = TimeUnit.SECONDS, message = "{repeat.submit.message}")
|
||||
@ -130,7 +133,7 @@ public class TestDemoController extends BaseController {
|
||||
/**
|
||||
* 修改测试单表
|
||||
*/
|
||||
@ApiOperation("修改测试单表")
|
||||
@Operation(summary = "修改测试单表")
|
||||
@SaCheckPermission("demo:demo:edit")
|
||||
@Log(title = "测试单表", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@ -142,11 +145,11 @@ public class TestDemoController extends BaseController {
|
||||
/**
|
||||
* 删除测试单表
|
||||
*/
|
||||
@ApiOperation("删除测试单表")
|
||||
@Operation(summary = "删除测试单表")
|
||||
@SaCheckPermission("demo:demo:remove")
|
||||
@Log(title = "测试单表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@ApiParam("测试ID串")
|
||||
public R<Void> remove(@Parameter(name = "测试ID串")
|
||||
@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iTestDemoService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
||||
|
@ -2,8 +2,8 @@ package com.ruoyi.demo.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -21,7 +21,7 @@ import java.util.Map;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Api(value = "测试Excel功能", tags = {"测试Excel功能"})
|
||||
@Tag(name ="测试Excel功能", description = "测试Excel功能")
|
||||
@RestController
|
||||
@RequestMapping("/demo/excel")
|
||||
public class TestExcelController {
|
||||
@ -29,7 +29,7 @@ public class TestExcelController {
|
||||
/**
|
||||
* 单列表多数据
|
||||
*/
|
||||
@ApiOperation(value = "单列表多数据")
|
||||
@Operation(summary = "单列表多数据")
|
||||
@GetMapping("/exportTemplateOne")
|
||||
public void exportTemplateOne(HttpServletResponse response) {
|
||||
Map<String,String> map = new HashMap<>();
|
||||
@ -49,7 +49,7 @@ public class TestExcelController {
|
||||
/**
|
||||
* 多列表多数据
|
||||
*/
|
||||
@ApiOperation(value = "多列表多数据")
|
||||
@Operation(summary = "多列表多数据")
|
||||
@GetMapping("/exportTemplateMuliti")
|
||||
public void exportTemplateMuliti(HttpServletResponse response) {
|
||||
Map<String,String> map = new HashMap<>();
|
||||
|
@ -2,9 +2,9 @@ package com.ruoyi.demo.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.MessageUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -22,7 +22,7 @@ import javax.validation.constraints.NotNull;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "测试国际化控制器", tags = {"测试国际化管理"})
|
||||
@Tag(name ="测试国际化控制器", description = "测试国际化管理")
|
||||
@RestController
|
||||
@RequestMapping("/demo/i18n")
|
||||
public class TestI18nController {
|
||||
@ -33,9 +33,9 @@ public class TestI18nController {
|
||||
* <p>
|
||||
* 测试使用 user.register.success
|
||||
*/
|
||||
@ApiOperation("通过code获取国际化内容")
|
||||
@Operation(summary = "通过code获取国际化内容")
|
||||
@GetMapping()
|
||||
public R<Void> get(@ApiParam("国际化code") String code) {
|
||||
public R<Void> get(@Parameter(name = "国际化code") String code) {
|
||||
return R.ok(MessageUtils.message(code));
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ public class TestI18nController {
|
||||
* <p>
|
||||
* 测试使用 not.null
|
||||
*/
|
||||
@ApiOperation("Validator 校验国际化")
|
||||
@Operation(summary = "Validator 校验国际化")
|
||||
@GetMapping("/test1")
|
||||
public R<Void> test1(@NotBlank(message = "{not.null}") String str) {
|
||||
return R.ok(str);
|
||||
@ -57,7 +57,7 @@ public class TestI18nController {
|
||||
* <p>
|
||||
* 测试使用 not.null
|
||||
*/
|
||||
@ApiOperation("Bean 校验国际化")
|
||||
@Operation(summary = "Bean 校验国际化")
|
||||
@GetMapping("/test2")
|
||||
public R<TestI18nBo> test2(@Validated TestI18nBo bo) {
|
||||
return R.ok(bo);
|
||||
|
@ -4,8 +4,8 @@ import com.ruoyi.common.annotation.Sensitive;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.enums.SensitiveStrategy;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @version 3.6.0
|
||||
* @see com.ruoyi.common.core.service.SensitiveService
|
||||
*/
|
||||
@Api(value = "测试数据脱敏控制器", tags = {"测试数据脱敏管理"})
|
||||
@Tag(name ="测试数据脱敏控制器", description = "测试数据脱敏管理")
|
||||
@RestController
|
||||
@RequestMapping("/demo/sensitive")
|
||||
public class TestSensitiveController extends BaseController {
|
||||
@ -29,7 +29,7 @@ public class TestSensitiveController extends BaseController {
|
||||
/**
|
||||
* 测试数据脱敏
|
||||
*/
|
||||
@ApiOperation("查询测试单表列表")
|
||||
@Operation(summary = "查询测试单表列表")
|
||||
@GetMapping("/test")
|
||||
public R<TestSensitive> test() {
|
||||
TestSensitive testSensitive = new TestSensitive();
|
||||
|
@ -13,9 +13,9 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.demo.domain.bo.TestTreeBo;
|
||||
import com.ruoyi.demo.domain.vo.TestTreeVo;
|
||||
import com.ruoyi.demo.service.ITestTreeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -33,7 +33,7 @@ import java.util.List;
|
||||
* @date 2021-07-26
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "测试树表控制器", tags = {"测试树表管理"})
|
||||
@Tag(name ="测试树表控制器", description = "测试树表管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/tree")
|
||||
@ -44,7 +44,7 @@ public class TestTreeController extends BaseController {
|
||||
/**
|
||||
* 查询测试树表列表
|
||||
*/
|
||||
@ApiOperation("查询测试树表列表")
|
||||
@Operation(summary = "查询测试树表列表")
|
||||
@SaCheckPermission("demo:tree:list")
|
||||
@GetMapping("/list")
|
||||
public R<List<TestTreeVo>> list(@Validated(QueryGroup.class) TestTreeBo bo) {
|
||||
@ -55,7 +55,7 @@ public class TestTreeController extends BaseController {
|
||||
/**
|
||||
* 导出测试树表列表
|
||||
*/
|
||||
@ApiOperation("导出测试树表列表")
|
||||
@Operation(summary = "导出测试树表列表")
|
||||
@SaCheckPermission("demo:tree:export")
|
||||
@Log(title = "测试树表", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
@ -67,10 +67,10 @@ public class TestTreeController extends BaseController {
|
||||
/**
|
||||
* 获取测试树表详细信息
|
||||
*/
|
||||
@ApiOperation("获取测试树表详细信息")
|
||||
@Operation(summary = "获取测试树表详细信息")
|
||||
@SaCheckPermission("demo:tree:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<TestTreeVo> getInfo(@ApiParam("测试树ID")
|
||||
public R<TestTreeVo> getInfo(@Parameter(name = "测试树ID")
|
||||
@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(iTestTreeService.queryById(id));
|
||||
@ -79,7 +79,7 @@ public class TestTreeController extends BaseController {
|
||||
/**
|
||||
* 新增测试树表
|
||||
*/
|
||||
@ApiOperation("新增测试树表")
|
||||
@Operation(summary = "新增测试树表")
|
||||
@SaCheckPermission("demo:tree:add")
|
||||
@Log(title = "测试树表", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit
|
||||
@ -91,7 +91,7 @@ public class TestTreeController extends BaseController {
|
||||
/**
|
||||
* 修改测试树表
|
||||
*/
|
||||
@ApiOperation("修改测试树表")
|
||||
@Operation(summary = "修改测试树表")
|
||||
@SaCheckPermission("demo:tree:edit")
|
||||
@Log(title = "测试树表", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@ -103,11 +103,11 @@ public class TestTreeController extends BaseController {
|
||||
/**
|
||||
* 删除测试树表
|
||||
*/
|
||||
@ApiOperation("删除测试树表")
|
||||
@Operation(summary = "删除测试树表")
|
||||
@SaCheckPermission("demo:tree:remove")
|
||||
@Log(title = "测试树表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@ApiParam("测试树ID串")
|
||||
public R<Void> remove(@Parameter(name = "测试树ID串")
|
||||
@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iTestTreeService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
||||
|
@ -2,9 +2,9 @@ package com.ruoyi.demo.controller.queue;
|
||||
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.redis.QueueUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -23,17 +23,17 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @version 3.6.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(value = "有界队列 演示案例", tags = {"有界队列"})
|
||||
@Tag(name ="有界队列 演示案例", description = "有界队列")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/queue/bounded")
|
||||
public class BoundedQueueController {
|
||||
|
||||
|
||||
@ApiOperation("添加队列数据")
|
||||
@Operation(summary = "添加队列数据")
|
||||
@GetMapping("/add")
|
||||
public R<Void> add(@ApiParam("队列名") String queueName,
|
||||
@ApiParam("容量") int capacity) {
|
||||
public R<Void> add(@Parameter(name = "队列名") String queueName,
|
||||
@Parameter(name = "容量") int capacity) {
|
||||
// 用完了一定要销毁 否则会一直存在
|
||||
boolean b = QueueUtils.destroyBoundedQueueObject(queueName);
|
||||
log.info("通道: {} , 删除: {}", queueName, b);
|
||||
@ -56,9 +56,9 @@ public class BoundedQueueController {
|
||||
return R.ok("操作成功");
|
||||
}
|
||||
|
||||
@ApiOperation("删除队列数据")
|
||||
@Operation(summary = "删除队列数据")
|
||||
@GetMapping("/remove")
|
||||
public R<Void> remove(@ApiParam("队列名") String queueName) {
|
||||
public R<Void> remove(@Parameter(name = "队列名") String queueName) {
|
||||
String data = "data-" + 5;
|
||||
if (QueueUtils.removeBoundedQueueObject(queueName, data)) {
|
||||
log.info("通道: {} , 删除数据: {}", queueName, data);
|
||||
@ -68,9 +68,9 @@ public class BoundedQueueController {
|
||||
return R.ok("操作成功");
|
||||
}
|
||||
|
||||
@ApiOperation("获取队列数据")
|
||||
@Operation(summary = "获取队列数据")
|
||||
@GetMapping("/get")
|
||||
public R<Void> get(@ApiParam("队列名") String queueName) {
|
||||
public R<Void> get(@Parameter(name = "队列名") String queueName) {
|
||||
String data;
|
||||
do {
|
||||
data = QueueUtils.getBoundedQueueObject(queueName);
|
||||
|
@ -2,9 +2,9 @@ package com.ruoyi.demo.controller.queue;
|
||||
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.redis.QueueUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -26,15 +26,15 @@ import java.util.concurrent.TimeUnit;
|
||||
* @version 3.6.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(value = "延迟队列 演示案例", tags = {"延迟队列"})
|
||||
@Tag(name ="延迟队列 演示案例", description = "延迟队列")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/queue/delayed")
|
||||
public class DelayedQueueController {
|
||||
|
||||
@ApiOperation("订阅队列")
|
||||
@Operation(summary = "订阅队列")
|
||||
@GetMapping("/subscribe")
|
||||
public R<Void> subscribe(@ApiParam("队列名") String queueName) {
|
||||
public R<Void> subscribe(@Parameter(name = "队列名") String queueName) {
|
||||
log.info("通道: {} 监听中......", queueName);
|
||||
// 项目初始化设置一次即可
|
||||
QueueUtils.subscribeBlockingQueue(queueName, (String orderNum) -> {
|
||||
@ -44,21 +44,21 @@ public class DelayedQueueController {
|
||||
return R.ok("操作成功");
|
||||
}
|
||||
|
||||
@ApiOperation("添加队列数据")
|
||||
@Operation(summary = "添加队列数据")
|
||||
@GetMapping("/add")
|
||||
public R<Void> add(@ApiParam("队列名") String queueName,
|
||||
@ApiParam("订单号") String orderNum,
|
||||
@ApiParam("延迟时间(秒)") Long time) {
|
||||
public R<Void> add(@Parameter(name = "队列名") String queueName,
|
||||
@Parameter(name = "订单号") String orderNum,
|
||||
@Parameter(name = "延迟时间(秒)") Long time) {
|
||||
QueueUtils.addDelayedQueueObject(queueName, orderNum, time, TimeUnit.SECONDS);
|
||||
// 观察发送时间
|
||||
log.info("通道: {} , 发送数据: {}", queueName, orderNum);
|
||||
return R.ok("操作成功");
|
||||
}
|
||||
|
||||
@ApiOperation("删除队列数据")
|
||||
@Operation(summary = "删除队列数据")
|
||||
@GetMapping("/remove")
|
||||
public R<Void> remove(@ApiParam("队列名") String queueName,
|
||||
@ApiParam("订单号") String orderNum) {
|
||||
public R<Void> remove(@Parameter(name = "队列名") String queueName,
|
||||
@Parameter(name = "订单号") String orderNum) {
|
||||
if (QueueUtils.removeDelayedQueueObject(queueName, orderNum)) {
|
||||
log.info("通道: {} , 删除数据: {}", queueName, orderNum);
|
||||
} else {
|
||||
@ -67,9 +67,9 @@ public class DelayedQueueController {
|
||||
return R.ok("操作成功");
|
||||
}
|
||||
|
||||
@ApiOperation("销毁队列")
|
||||
@Operation(summary = "销毁队列")
|
||||
@GetMapping("/destroy")
|
||||
public R<Void> destroy(@ApiParam("队列名") String queueName) {
|
||||
public R<Void> destroy(@Parameter(name = "队列名") String queueName) {
|
||||
// 用完了一定要销毁 否则会一直存在
|
||||
QueueUtils.destroyDelayedQueue(queueName);
|
||||
return R.ok("操作成功");
|
||||
|
@ -3,9 +3,9 @@ package com.ruoyi.demo.controller.queue;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.redis.QueueUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -24,15 +24,15 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @version 3.6.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(value = "优先队列 演示案例", tags = {"优先队列"})
|
||||
@Tag(name ="优先队列 演示案例", description = "优先队列")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/queue/priority")
|
||||
public class PriorityQueueController {
|
||||
|
||||
@ApiOperation("添加队列数据")
|
||||
@Operation(summary = "添加队列数据")
|
||||
@GetMapping("/add")
|
||||
public R<Void> add(@ApiParam("队列名") String queueName) {
|
||||
public R<Void> add(@Parameter(name = "队列名") String queueName) {
|
||||
// 用完了一定要销毁 否则会一直存在
|
||||
boolean b = QueueUtils.destroyPriorityQueueObject(queueName);
|
||||
log.info("通道: {} , 删除: {}", queueName, b);
|
||||
@ -58,11 +58,11 @@ public class PriorityQueueController {
|
||||
return R.ok("操作成功");
|
||||
}
|
||||
|
||||
@ApiOperation("删除队列数据")
|
||||
@Operation(summary = "删除队列数据")
|
||||
@GetMapping("/remove")
|
||||
public R<Void> remove(@ApiParam("队列名") String queueName,
|
||||
@ApiParam("对象名") String name,
|
||||
@ApiParam("排序号") Integer orderNum) {
|
||||
public R<Void> remove(@Parameter(name = "队列名") String queueName,
|
||||
@Parameter(name = "对象名") String name,
|
||||
@Parameter(name = "排序号") Integer orderNum) {
|
||||
PriorityDemo data = new PriorityDemo();
|
||||
data.setName(name);
|
||||
data.setOrderNum(orderNum);
|
||||
@ -74,9 +74,9 @@ public class PriorityQueueController {
|
||||
return R.ok("操作成功");
|
||||
}
|
||||
|
||||
@ApiOperation("获取队列数据")
|
||||
@Operation(summary = "获取队列数据")
|
||||
@GetMapping("/get")
|
||||
public R<Void> get(@ApiParam("队列名") String queueName) {
|
||||
public R<Void> get(@Parameter(name = "队列名") String queueName) {
|
||||
PriorityDemo data;
|
||||
do {
|
||||
data = QueueUtils.getPriorityQueueObject(queueName);
|
||||
|
@ -3,8 +3,7 @@ package com.ruoyi.demo.domain.bo;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -20,48 +19,48 @@ import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("测试单表业务对象")
|
||||
@Schema(name = "测试单表业务对象")
|
||||
public class TestDemoBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
@Schema(name = "主键")
|
||||
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ApiModelProperty("部门id")
|
||||
@Schema(name = "部门id")
|
||||
@NotNull(message = "部门id不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ApiModelProperty("用户id")
|
||||
@Schema(name = "用户id")
|
||||
@NotNull(message = "用户id不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@ApiModelProperty("排序号")
|
||||
@Schema(name = "排序号")
|
||||
@NotNull(message = "排序号不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* key键
|
||||
*/
|
||||
@ApiModelProperty("key键")
|
||||
@Schema(name = "key键")
|
||||
@NotBlank(message = "key键不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String testKey;
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
@ApiModelProperty("值")
|
||||
@Schema(name = "值")
|
||||
@NotBlank(message = "值不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String value;
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
package com.ruoyi.demo.domain.bo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@ -15,13 +14,13 @@ import javax.validation.constraints.NotNull;
|
||||
* @date 2021-07-26
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("测试单表业务对象")
|
||||
@Schema(name = "测试单表业务对象")
|
||||
public class TestDemoImportVo {
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ApiModelProperty("部门id")
|
||||
@Schema(name = "部门id")
|
||||
@NotNull(message = "部门id不能为空")
|
||||
@ExcelProperty(value = "部门id")
|
||||
private Long deptId;
|
||||
@ -29,7 +28,7 @@ public class TestDemoImportVo {
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ApiModelProperty("用户id")
|
||||
@Schema(name = "用户id")
|
||||
@NotNull(message = "用户id不能为空")
|
||||
@ExcelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
@ -37,7 +36,7 @@ public class TestDemoImportVo {
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@ApiModelProperty("排序号")
|
||||
@Schema(name = "排序号")
|
||||
@NotNull(message = "排序号不能为空")
|
||||
@ExcelProperty(value = "排序号")
|
||||
private Long orderNum;
|
||||
@ -45,7 +44,7 @@ public class TestDemoImportVo {
|
||||
/**
|
||||
* key键
|
||||
*/
|
||||
@ApiModelProperty("key键")
|
||||
@Schema(name = "key键")
|
||||
@NotBlank(message = "key键不能为空")
|
||||
@ExcelProperty(value = "key键")
|
||||
private String testKey;
|
||||
@ -53,7 +52,7 @@ public class TestDemoImportVo {
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
@ApiModelProperty("值")
|
||||
@Schema(name = "值")
|
||||
@NotBlank(message = "值不能为空")
|
||||
@ExcelProperty(value = "值")
|
||||
private String value;
|
||||
|
@ -3,8 +3,7 @@ package com.ruoyi.demo.domain.bo;
|
||||
import com.ruoyi.common.core.domain.TreeEntity;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -20,34 +19,34 @@ import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("测试树表业务对象")
|
||||
@Schema(name = "测试树表业务对象")
|
||||
public class TestTreeBo extends TreeEntity<TestTreeBo> {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
@Schema(name = "主键")
|
||||
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ApiModelProperty("部门id")
|
||||
@Schema(name = "部门id")
|
||||
@NotNull(message = "部门id不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ApiModelProperty("用户id")
|
||||
@Schema(name = "用户id")
|
||||
@NotNull(message = "用户id不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 树节点名
|
||||
*/
|
||||
@ApiModelProperty("树节点名")
|
||||
@Schema(name = "树节点名")
|
||||
@NotBlank(message = "树节点名不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String treeName;
|
||||
|
||||
|
@ -2,8 +2,7 @@ package com.ruoyi.demo.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@ -16,7 +15,7 @@ import java.util.Date;
|
||||
* @date 2021-07-26
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("测试单表视图对象")
|
||||
@Schema(name = "测试单表视图对象")
|
||||
@ExcelIgnoreUnannotated
|
||||
public class TestDemoVo {
|
||||
|
||||
@ -26,70 +25,70 @@ public class TestDemoVo {
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
@ApiModelProperty("主键")
|
||||
@Schema(name = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ExcelProperty(value = "部门id")
|
||||
@ApiModelProperty("部门id")
|
||||
@Schema(name = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ExcelProperty(value = "用户id")
|
||||
@ApiModelProperty("用户id")
|
||||
@Schema(name = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@ExcelProperty(value = "排序号")
|
||||
@ApiModelProperty("排序号")
|
||||
@Schema(name = "排序号")
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* key键
|
||||
*/
|
||||
@ExcelProperty(value = "key键")
|
||||
@ApiModelProperty("key键")
|
||||
@Schema(name = "key键")
|
||||
private String testKey;
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
@ExcelProperty(value = "值")
|
||||
@ApiModelProperty("值")
|
||||
@Schema(name = "值")
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
@ApiModelProperty("创建时间")
|
||||
@Schema(name = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ExcelProperty(value = "创建人")
|
||||
@ApiModelProperty("创建人")
|
||||
@Schema(name = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ExcelProperty(value = "更新时间")
|
||||
@ApiModelProperty("更新时间")
|
||||
@Schema(name = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ExcelProperty(value = "更新人")
|
||||
@ApiModelProperty("更新人")
|
||||
@Schema(name = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
|
||||
|
@ -2,8 +2,7 @@ package com.ruoyi.demo.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@ -16,7 +15,7 @@ import java.util.Date;
|
||||
* @date 2021-07-26
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("测试树表视图对象")
|
||||
@Schema(name = "测试树表视图对象")
|
||||
@ExcelIgnoreUnannotated
|
||||
public class TestTreeVo {
|
||||
|
||||
@ -25,42 +24,42 @@ public class TestTreeVo {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
@Schema(name = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
@ExcelProperty(value = "父id")
|
||||
@ApiModelProperty("父id")
|
||||
@Schema(name = "父id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ExcelProperty(value = "部门id")
|
||||
@ApiModelProperty("部门id")
|
||||
@Schema(name = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ExcelProperty(value = "用户id")
|
||||
@ApiModelProperty("用户id")
|
||||
@Schema(name = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 树节点名
|
||||
*/
|
||||
@ExcelProperty(value = "树节点名")
|
||||
@ApiModelProperty("树节点名")
|
||||
@Schema(name = "树节点名")
|
||||
private String treeName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
@ApiModelProperty("创建时间")
|
||||
@Schema(name = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
|
@ -1,33 +1,15 @@
|
||||
package com.ruoyi.framework.config;
|
||||
|
||||
import cn.dev33.satoken.config.SaTokenConfig;
|
||||
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
||||
import com.github.xiaoymin.knife4j.spring.extension.OpenApiExtensionResolver;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.framework.config.properties.SwaggerProperties;
|
||||
import io.swagger.models.auth.In;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springdoc.core.SpringDocConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.*;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spi.service.contexts.SecurityContext;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.spring.web.plugins.WebFluxRequestHandlerProvider;
|
||||
import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Swagger 文档配置
|
||||
@ -36,125 +18,36 @@ import java.util.List;
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Configuration
|
||||
@EnableKnife4j
|
||||
@AutoConfigureBefore(SpringDocConfiguration.class)
|
||||
@ConditionalOnProperty(name = "swagger.enabled", havingValue = "true", matchIfMissing = true)
|
||||
public class SwaggerConfig {
|
||||
|
||||
private final SwaggerProperties swaggerProperties;
|
||||
private final SaTokenConfig saTokenConfig;
|
||||
private final OpenApiExtensionResolver openApiExtensionResolver;
|
||||
|
||||
/**
|
||||
* 用于适配springboot 2.6
|
||||
*/
|
||||
@Bean
|
||||
@SuppressWarnings("all")
|
||||
public BeanPostProcessor springfoxHandlerProviderBeanPostProcessor() {
|
||||
return new BeanPostProcessor() {
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
||||
if (bean instanceof WebMvcRequestHandlerProvider || bean instanceof WebFluxRequestHandlerProvider) {
|
||||
customizeSpringfoxHandlerMappings(getHandlerMappings(bean));
|
||||
}
|
||||
return bean;
|
||||
@ConditionalOnMissingBean(OpenAPI.class)
|
||||
public OpenAPI openApi() {
|
||||
OpenAPI openApi = new OpenAPI();
|
||||
// 文档基本信息
|
||||
SwaggerProperties.InfoProperties infoProperties = swaggerProperties.getInfo();
|
||||
Info info = convertInfo(infoProperties);
|
||||
openApi.info(info);
|
||||
// 扩展文档信息
|
||||
openApi.externalDocs(swaggerProperties.getExternalDocs());
|
||||
openApi.tags(swaggerProperties.getTags());
|
||||
openApi.paths(swaggerProperties.getPaths());
|
||||
openApi.components(swaggerProperties.getComponents());
|
||||
|
||||
return openApi;
|
||||
}
|
||||
|
||||
private <T extends RequestMappingInfoHandlerMapping> void customizeSpringfoxHandlerMappings(List<T> mappings) {
|
||||
mappings.removeIf(mapping -> mapping.getPatternParser() != null);
|
||||
}
|
||||
|
||||
private List<RequestMappingInfoHandlerMapping> getHandlerMappings(Object bean) {
|
||||
try {
|
||||
Field field = ReflectionUtils.findField(bean.getClass(), "handlerMappings");
|
||||
field.setAccessible(true);
|
||||
return (List<RequestMappingInfoHandlerMapping>) field.get(bean);
|
||||
} catch (IllegalArgumentException | IllegalAccessException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建API
|
||||
*/
|
||||
@PostConstruct
|
||||
public void createRestApi() {
|
||||
for (SwaggerProperties.Groups group : swaggerProperties.getGroups()) {
|
||||
String basePackage = group.getBasePackage();
|
||||
Docket docket = new Docket(DocumentationType.OAS_30)
|
||||
.enable(swaggerProperties.getEnabled())
|
||||
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
||||
.apiInfo(apiInfo())
|
||||
// 设置哪些接口暴露给Swagger展示
|
||||
.select()
|
||||
// 扫描所有有注解的api,用这种方式更灵活
|
||||
//.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||
// 扫描指定包中的swagger注解
|
||||
.apis(RequestHandlerSelectors.basePackage(basePackage))
|
||||
// 扫描所有 .apis(RequestHandlerSelectors.any())
|
||||
.paths(PathSelectors.any())
|
||||
.build()
|
||||
.groupName(group.getName())
|
||||
// 设置安全模式,swagger可以设置访问token
|
||||
.securitySchemes(securitySchemes())
|
||||
.securityContexts(securityContexts())
|
||||
.extensions(openApiExtensionResolver.buildExtensions(group.getName()))
|
||||
.pathMapping(swaggerProperties.getPathMapping());
|
||||
String beanName = StringUtils.substringAfterLast(basePackage, ".") + "Docket";
|
||||
SpringUtils.registerBean(beanName, docket);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全模式,这里指定token通过Authorization头请求头传递
|
||||
*/
|
||||
private List<SecurityScheme> securitySchemes() {
|
||||
List<SecurityScheme> apiKeyList = new ArrayList<>();
|
||||
String header = saTokenConfig.getTokenName();
|
||||
apiKeyList.add(new ApiKey(header, header, In.HEADER.toValue()));
|
||||
return apiKeyList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全上下文
|
||||
*/
|
||||
private List<SecurityContext> securityContexts() {
|
||||
List<SecurityContext> securityContexts = new ArrayList<>();
|
||||
securityContexts.add(
|
||||
SecurityContext.builder()
|
||||
.securityReferences(defaultAuth())
|
||||
.operationSelector(o -> o.requestMappingPattern().matches("/.*"))
|
||||
.build());
|
||||
return securityContexts;
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认的安全上引用
|
||||
*/
|
||||
private List<SecurityReference> defaultAuth() {
|
||||
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
|
||||
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
|
||||
authorizationScopes[0] = authorizationScope;
|
||||
List<SecurityReference> securityReferences = new ArrayList<>();
|
||||
securityReferences.add(new SecurityReference(saTokenConfig.getTokenName(), authorizationScopes));
|
||||
return securityReferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加摘要信息
|
||||
*/
|
||||
private ApiInfo apiInfo() {
|
||||
// 用ApiInfoBuilder进行定制
|
||||
SwaggerProperties.Contact contact = swaggerProperties.getContact();
|
||||
return new ApiInfoBuilder()
|
||||
// 设置标题
|
||||
.title(swaggerProperties.getTitle())
|
||||
// 描述
|
||||
.description(swaggerProperties.getDescription())
|
||||
// 作者信息
|
||||
.contact(new Contact(contact.getName(), contact.getUrl(), contact.getEmail()))
|
||||
// 版本
|
||||
.version(swaggerProperties.getVersion())
|
||||
.build();
|
||||
private Info convertInfo(SwaggerProperties.InfoProperties infoProperties) {
|
||||
Info info = new Info();
|
||||
info.setTitle(infoProperties.getTitle());
|
||||
info.setDescription(infoProperties.getDescription());
|
||||
info.setContact(infoProperties.getContact());
|
||||
info.setLicense(infoProperties.getLicense());
|
||||
info.setVersion(infoProperties.getVersion());
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,14 @@
|
||||
package com.ruoyi.framework.config.properties;
|
||||
|
||||
import io.swagger.v3.oas.models.Components;
|
||||
import io.swagger.v3.oas.models.ExternalDocumentation;
|
||||
import io.swagger.v3.oas.models.Paths;
|
||||
import io.swagger.v3.oas.models.info.Contact;
|
||||
import io.swagger.v3.oas.models.info.License;
|
||||
import io.swagger.v3.oas.models.tags.Tag;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
@ -18,74 +24,77 @@ import java.util.List;
|
||||
public class SwaggerProperties {
|
||||
|
||||
/**
|
||||
* 文档开关
|
||||
* 是否开启 openApi 文档
|
||||
*/
|
||||
private Boolean enabled;
|
||||
private Boolean enabled = true;
|
||||
|
||||
/**
|
||||
* 设置请求的统一前缀
|
||||
* 文档基本信息
|
||||
*/
|
||||
private String pathMapping;
|
||||
@NestedConfigurationProperty
|
||||
private InfoProperties info = new InfoProperties();
|
||||
|
||||
/**
|
||||
* 标头
|
||||
* 扩展文档地址
|
||||
*/
|
||||
private String title;
|
||||
@NestedConfigurationProperty
|
||||
private ExternalDocumentation externalDocs;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private List<Tag> tags = null;
|
||||
|
||||
/**
|
||||
* 路径
|
||||
*/
|
||||
@NestedConfigurationProperty
|
||||
private Paths paths = null;
|
||||
|
||||
/**
|
||||
* 组件
|
||||
*/
|
||||
@NestedConfigurationProperty
|
||||
private Components components = null;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 文档的基础属性信息
|
||||
* </p>
|
||||
*
|
||||
* @see io.swagger.v3.oas.models.info.Info
|
||||
*
|
||||
* 为了 springboot 自动生产配置提示信息,所以这里复制一个类出来
|
||||
*/
|
||||
@Data
|
||||
public static class InfoProperties {
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title = null;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
private String description = null;
|
||||
|
||||
/**
|
||||
* 项目版本
|
||||
* 联系人信息
|
||||
*/
|
||||
private String version;
|
||||
@NestedConfigurationProperty
|
||||
private Contact contact = null;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
* 许可证
|
||||
*/
|
||||
private Contact contact;
|
||||
@NestedConfigurationProperty
|
||||
private License license = null;
|
||||
|
||||
/**
|
||||
* 组配置
|
||||
* 版本
|
||||
*/
|
||||
private List<Groups> groups;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class Contact {
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 联系人url
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 联系人email
|
||||
*/
|
||||
private String email;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public static class Groups {
|
||||
|
||||
/**
|
||||
* 组名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 基础包路径
|
||||
*/
|
||||
private String basePackage;
|
||||
private String version = null;
|
||||
|
||||
}
|
||||
|
||||
|
@ -12,8 +12,8 @@ import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.generator.domain.GenTable;
|
||||
import com.ruoyi.generator.domain.GenTableColumn;
|
||||
import com.ruoyi.generator.service.IGenTableService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -30,7 +30,7 @@ import java.util.Map;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "代码生成", tags = {"代码生成管理"})
|
||||
@Tag(name = "代码生成", description = "代码生成管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/tool/gen")
|
||||
@ -41,7 +41,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 查询代码生成列表
|
||||
*/
|
||||
@ApiOperation("查询代码生成列表")
|
||||
@Operation(summary = "查询代码生成列表")
|
||||
@SaCheckPermission("tool:gen:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<GenTable> genList(GenTable genTable, PageQuery pageQuery) {
|
||||
@ -51,7 +51,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 修改代码生成业务
|
||||
*/
|
||||
@ApiOperation("修改代码生成业务")
|
||||
@Operation(summary = "修改代码生成业务")
|
||||
@SaCheckPermission("tool:gen:query")
|
||||
@GetMapping(value = "/{tableId}")
|
||||
public R<Map<String, Object>> getInfo(@PathVariable Long tableId) {
|
||||
@ -68,7 +68,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 查询数据库列表
|
||||
*/
|
||||
@ApiOperation("查询数据库列表")
|
||||
@Operation(summary = "查询数据库列表")
|
||||
@SaCheckPermission("tool:gen:list")
|
||||
@GetMapping("/db/list")
|
||||
public TableDataInfo<GenTable> dataList(GenTable genTable, PageQuery pageQuery) {
|
||||
@ -78,7 +78,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 查询数据表字段列表
|
||||
*/
|
||||
@ApiOperation("查询数据表字段列表")
|
||||
@Operation(summary = "查询数据表字段列表")
|
||||
@SaCheckPermission("tool:gen:list")
|
||||
@GetMapping(value = "/column/{tableId}")
|
||||
public TableDataInfo<GenTableColumn> columnList(Long tableId) {
|
||||
@ -92,7 +92,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 导入表结构(保存)
|
||||
*/
|
||||
@ApiOperation("导入表结构(保存)")
|
||||
@Operation(summary = "导入表结构(保存)")
|
||||
@SaCheckPermission("tool:gen:import")
|
||||
@Log(title = "代码生成", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importTable")
|
||||
@ -107,7 +107,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 修改保存代码生成业务
|
||||
*/
|
||||
@ApiOperation("修改保存代码生成业务")
|
||||
@Operation(summary = "修改保存代码生成业务")
|
||||
@SaCheckPermission("tool:gen:edit")
|
||||
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ -120,7 +120,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 删除代码生成
|
||||
*/
|
||||
@ApiOperation("删除代码生成")
|
||||
@Operation(summary = "删除代码生成")
|
||||
@SaCheckPermission("tool:gen:remove")
|
||||
@Log(title = "代码生成", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{tableIds}")
|
||||
@ -132,7 +132,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 预览代码
|
||||
*/
|
||||
@ApiOperation("预览代码")
|
||||
@Operation(summary = "预览代码")
|
||||
@SaCheckPermission("tool:gen:preview")
|
||||
@GetMapping("/preview/{tableId}")
|
||||
public R<Map<String, String>> preview(@PathVariable("tableId") Long tableId) throws IOException {
|
||||
@ -143,7 +143,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 生成代码(下载方式)
|
||||
*/
|
||||
@ApiOperation("生成代码(下载方式)")
|
||||
@Operation(summary = "生成代码(下载方式)")
|
||||
@SaCheckPermission("tool:gen:code")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/download/{tableName}")
|
||||
@ -155,7 +155,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 生成代码(自定义路径)
|
||||
*/
|
||||
@ApiOperation("生成代码(自定义路径)")
|
||||
@Operation(summary = "生成代码(自定义路径)")
|
||||
@SaCheckPermission("tool:gen:code")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/genCode/{tableName}")
|
||||
@ -167,7 +167,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 同步数据库
|
||||
*/
|
||||
@ApiOperation("同步数据库")
|
||||
@Operation(summary = "同步数据库")
|
||||
@SaCheckPermission("tool:gen:edit")
|
||||
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
||||
@GetMapping("/synchDb/{tableName}")
|
||||
@ -179,7 +179,7 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 批量生成代码
|
||||
*/
|
||||
@ApiOperation("批量生成代码")
|
||||
@Operation(summary = "批量生成代码")
|
||||
@SaCheckPermission("tool:gen:code")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/batchGenCode")
|
||||
|
@ -33,7 +33,7 @@ import com.ruoyi.common.core.domain.TreeEntity;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("${functionName}业务对象")
|
||||
@Schema(name = "${functionName}业务对象")
|
||||
public class ${ClassName}Bo extends ${Entity} {
|
||||
|
||||
#foreach ($column in $columns)
|
||||
@ -49,14 +49,14 @@ public class ${ClassName}Bo extends ${Entity} {
|
||||
#set($Group="EditGroup.class")
|
||||
#end
|
||||
#if($column.isRequired == 1)
|
||||
@ApiModelProperty(value = "$column.columnComment", required = true)
|
||||
@Schema(name = "$column.columnComment", required = true)
|
||||
#if($column.javaType == 'String')
|
||||
@NotBlank(message = "$column.columnComment不能为空", groups = { $Group })
|
||||
#else
|
||||
@NotNull(message = "$column.columnComment不能为空", groups = { $Group })
|
||||
#end
|
||||
#else
|
||||
@ApiModelProperty(value = "$column.columnComment")
|
||||
@Schema(name = "$column.columnComment")
|
||||
#end
|
||||
private $column.javaType $column.javaField;
|
||||
|
||||
|
@ -27,9 +27,8 @@ import ${packageName}.service.I${ClassName}Service;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
#elseif($table.tree)
|
||||
#end
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
/**
|
||||
* ${functionName}Controller
|
||||
@ -38,7 +37,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
* @date ${datetime}
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "${functionName}控制器", tags = {"${functionName}管理"})
|
||||
@Tag(name ="${functionName}控制器", description = "${functionName}管理")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/${moduleName}/${businessName}")
|
||||
@ -49,7 +48,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||
/**
|
||||
* 查询${functionName}列表
|
||||
*/
|
||||
@ApiOperation("查询${functionName}列表")
|
||||
@Operation(summary = "查询${functionName}列表")
|
||||
@SaCheckPermission("${permissionPrefix}:list")
|
||||
@GetMapping("/list")
|
||||
#if($table.crud || $table.sub)
|
||||
@ -66,7 +65,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||
/**
|
||||
* 导出${functionName}列表
|
||||
*/
|
||||
@ApiOperation("导出${functionName}列表")
|
||||
@Operation(summary = "导出${functionName}列表")
|
||||
@SaCheckPermission("${permissionPrefix}:export")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ -78,10 +77,10 @@ public class ${ClassName}Controller extends BaseController {
|
||||
/**
|
||||
* 获取${functionName}详细信息
|
||||
*/
|
||||
@ApiOperation("获取${functionName}详细信息")
|
||||
@Operation(summary = "获取${functionName}详细信息")
|
||||
@SaCheckPermission("${permissionPrefix}:query")
|
||||
@GetMapping("/{${pkColumn.javaField}}")
|
||||
public R<${ClassName}Vo> getInfo(@ApiParam("主键")
|
||||
public R<${ClassName}Vo> getInfo(@Parameter(name = "主键")
|
||||
@NotNull(message = "主键不能为空")
|
||||
@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) {
|
||||
return R.ok(i${ClassName}Service.queryById(${pkColumn.javaField}));
|
||||
@ -90,7 +89,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||
/**
|
||||
* 新增${functionName}
|
||||
*/
|
||||
@ApiOperation("新增${functionName}")
|
||||
@Operation(summary = "新增${functionName}")
|
||||
@SaCheckPermission("${permissionPrefix}:add")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@ -102,7 +101,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||
/**
|
||||
* 修改${functionName}
|
||||
*/
|
||||
@ApiOperation("修改${functionName}")
|
||||
@Operation(summary = "修改${functionName}")
|
||||
@SaCheckPermission("${permissionPrefix}:edit")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@ -114,11 +113,11 @@ public class ${ClassName}Controller extends BaseController {
|
||||
/**
|
||||
* 删除${functionName}
|
||||
*/
|
||||
@ApiOperation("删除${functionName}")
|
||||
@Operation(summary = "删除${functionName}")
|
||||
@SaCheckPermission("${permissionPrefix}:remove")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{${pkColumn.javaField}s}")
|
||||
public R<Void> remove(@ApiParam("主键串")
|
||||
public R<Void> remove(@Parameter(name = "主键串")
|
||||
@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) {
|
||||
return toAjax(i${ClassName}Service.deleteWithValidByIds(Arrays.asList(${pkColumn.javaField}s), true) ? 1 : 0);
|
||||
|
@ -21,7 +21,7 @@ import java.util.Date;
|
||||
* @date ${datetime}
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("${functionName}视图对象")
|
||||
@Schema(name = "${functionName}视图对象")
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ${ClassName}Vo {
|
||||
|
||||
@ -47,7 +47,7 @@ public class ${ClassName}Vo {
|
||||
#else
|
||||
@ExcelProperty(value = "${comment}")
|
||||
#end
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@Schema(name = "$column.columnComment")
|
||||
private $column.javaType $column.javaField;
|
||||
|
||||
#end
|
||||
|
@ -1,8 +1,7 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@ -13,31 +12,31 @@ import lombok.NoArgsConstructor;
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@ApiModel("缓存信息")
|
||||
@Schema(name = "缓存信息")
|
||||
public class SysCache {
|
||||
|
||||
/**
|
||||
* 缓存名称
|
||||
*/
|
||||
@ApiModelProperty(value = "缓存名称")
|
||||
@Schema(name = "缓存名称")
|
||||
private String cacheName = "";
|
||||
|
||||
/**
|
||||
* 缓存键名
|
||||
*/
|
||||
@ApiModelProperty(value = "缓存键名")
|
||||
@Schema(name = "缓存键名")
|
||||
private String cacheKey = "";
|
||||
|
||||
/**
|
||||
* 缓存内容
|
||||
*/
|
||||
@ApiModelProperty(value = "缓存内容")
|
||||
@Schema(name = "缓存内容")
|
||||
private String cacheValue = "";
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(name = "备注")
|
||||
private String remark = "";
|
||||
|
||||
public SysCache(String cacheName, String remark) {
|
||||
|
@ -7,8 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -25,13 +24,13 @@ import javax.validation.constraints.Size;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_config")
|
||||
@ExcelIgnoreUnannotated
|
||||
@ApiModel("参数配置业务对象")
|
||||
@Schema(name = "参数配置业务对象")
|
||||
public class SysConfig extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 参数主键
|
||||
*/
|
||||
@ApiModelProperty(value = "参数主键")
|
||||
@Schema(name = "参数主键")
|
||||
@ExcelProperty(value = "参数主键")
|
||||
@TableId(value = "config_id")
|
||||
private Long configId;
|
||||
@ -39,7 +38,7 @@ public class SysConfig extends BaseEntity {
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
@ApiModelProperty(value = "参数名称")
|
||||
@Schema(name = "参数名称")
|
||||
@ExcelProperty(value = "参数名称")
|
||||
@NotBlank(message = "参数名称不能为空")
|
||||
@Size(min = 0, max = 100, message = "参数名称不能超过100个字符")
|
||||
@ -48,7 +47,7 @@ public class SysConfig extends BaseEntity {
|
||||
/**
|
||||
* 参数键名
|
||||
*/
|
||||
@ApiModelProperty(value = "参数键名")
|
||||
@Schema(name = "参数键名")
|
||||
@ExcelProperty(value = "参数键名")
|
||||
@NotBlank(message = "参数键名长度不能为空")
|
||||
@Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符")
|
||||
@ -57,7 +56,7 @@ public class SysConfig extends BaseEntity {
|
||||
/**
|
||||
* 参数键值
|
||||
*/
|
||||
@ApiModelProperty(value = "参数键值")
|
||||
@Schema(name = "参数键值")
|
||||
@ExcelProperty(value = "参数键值")
|
||||
@NotBlank(message = "参数键值不能为空")
|
||||
@Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符")
|
||||
@ -66,7 +65,7 @@ public class SysConfig extends BaseEntity {
|
||||
/**
|
||||
* 系统内置(Y是 N否)
|
||||
*/
|
||||
@ApiModelProperty(value = "系统内置(Y是 N否)")
|
||||
@Schema(name = "系统内置(Y是 N否)")
|
||||
@ExcelProperty(value = "系统内置", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_yes_no")
|
||||
private String configType;
|
||||
@ -74,7 +73,7 @@ public class SysConfig extends BaseEntity {
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(name = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@ -7,8 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -25,14 +24,14 @@ import java.util.Map;
|
||||
@Data
|
||||
@TableName("sys_logininfor")
|
||||
@ExcelIgnoreUnannotated
|
||||
@ApiModel("系统访问记录业务对象")
|
||||
@Schema(name = "系统访问记录业务对象")
|
||||
public class SysLogininfor implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty(value = "访问ID")
|
||||
@Schema(name = "访问ID")
|
||||
@ExcelProperty(value = "序号")
|
||||
@TableId(value = "info_id")
|
||||
private Long infoId;
|
||||
@ -40,14 +39,14 @@ public class SysLogininfor implements Serializable {
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@ApiModelProperty(value = "用户账号")
|
||||
@Schema(name = "用户账号")
|
||||
@ExcelProperty(value = "用户账号")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 登录状态 0成功 1失败
|
||||
*/
|
||||
@ApiModelProperty(value = "登录状态 0成功 1失败")
|
||||
@Schema(name = "登录状态 0成功 1失败")
|
||||
@ExcelProperty(value = "登录状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_common_status")
|
||||
private String status;
|
||||
@ -55,49 +54,49 @@ public class SysLogininfor implements Serializable {
|
||||
/**
|
||||
* 登录IP地址
|
||||
*/
|
||||
@ApiModelProperty(value = "登录IP地址")
|
||||
@Schema(name = "登录IP地址")
|
||||
@ExcelProperty(value = "登录地址")
|
||||
private String ipaddr;
|
||||
|
||||
/**
|
||||
* 登录地点
|
||||
*/
|
||||
@ApiModelProperty(value = "登录地点")
|
||||
@Schema(name = "登录地点")
|
||||
@ExcelProperty(value = "登录地点")
|
||||
private String loginLocation;
|
||||
|
||||
/**
|
||||
* 浏览器类型
|
||||
*/
|
||||
@ApiModelProperty(value = "浏览器类型")
|
||||
@Schema(name = "浏览器类型")
|
||||
@ExcelProperty(value = "浏览器")
|
||||
private String browser;
|
||||
|
||||
/**
|
||||
* 操作系统
|
||||
*/
|
||||
@ApiModelProperty(value = "操作系统")
|
||||
@Schema(name = "操作系统")
|
||||
@ExcelProperty(value = "操作系统")
|
||||
private String os;
|
||||
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
@ApiModelProperty(value = "提示消息")
|
||||
@Schema(name = "提示消息")
|
||||
@ExcelProperty(value = "提示消息")
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 访问时间
|
||||
*/
|
||||
@ApiModelProperty(value = "访问时间")
|
||||
@Schema(name = "访问时间")
|
||||
@ExcelProperty(value = "访问时间")
|
||||
private Date loginTime;
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@ApiModelProperty(value = "请求参数")
|
||||
@Schema(name = "请求参数")
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
|
||||
|
@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.xss.Xss;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -25,7 +25,7 @@ public class SysNotice extends BaseEntity {
|
||||
/**
|
||||
* 公告ID
|
||||
*/
|
||||
@ApiModelProperty(value = "公告ID")
|
||||
@Schema(name = "公告ID")
|
||||
@TableId(value = "notice_id")
|
||||
private Long noticeId;
|
||||
|
||||
@ -33,7 +33,7 @@ public class SysNotice extends BaseEntity {
|
||||
* 公告标题
|
||||
*/
|
||||
@Xss(message = "公告标题不能包含脚本字符")
|
||||
@ApiModelProperty(value = "公告标题")
|
||||
@Schema(name = "公告标题")
|
||||
@NotBlank(message = "公告标题不能为空")
|
||||
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
|
||||
private String noticeTitle;
|
||||
@ -41,25 +41,25 @@ public class SysNotice extends BaseEntity {
|
||||
/**
|
||||
* 公告类型(1通知 2公告)
|
||||
*/
|
||||
@ApiModelProperty(value = "公告类型(1通知 2公告)")
|
||||
@Schema(name = "公告类型(1通知 2公告)")
|
||||
private String noticeType;
|
||||
|
||||
/**
|
||||
* 公告内容
|
||||
*/
|
||||
@ApiModelProperty(value = "公告内容")
|
||||
@Schema(name = "公告内容")
|
||||
private String noticeContent;
|
||||
|
||||
/**
|
||||
* 公告状态(0正常 1关闭)
|
||||
*/
|
||||
@ApiModelProperty(value = "公告状态(0正常 1关闭)")
|
||||
@Schema(name = "公告状态(0正常 1关闭)")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(name = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@ -7,8 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -25,7 +24,7 @@ import java.util.Map;
|
||||
@Data
|
||||
@TableName("sys_oper_log")
|
||||
@ExcelIgnoreUnannotated
|
||||
@ApiModel("操作日志记录业务对象")
|
||||
@Schema(name = "操作日志记录业务对象")
|
||||
public class SysOperLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -33,7 +32,7 @@ public class SysOperLog implements Serializable {
|
||||
/**
|
||||
* 日志主键
|
||||
*/
|
||||
@ApiModelProperty(value = "日志主键")
|
||||
@Schema(name = "日志主键")
|
||||
@ExcelProperty(value = "日志主键")
|
||||
@TableId(value = "oper_id")
|
||||
private Long operId;
|
||||
@ -41,14 +40,14 @@ public class SysOperLog implements Serializable {
|
||||
/**
|
||||
* 操作模块
|
||||
*/
|
||||
@ApiModelProperty(value = "操作模块")
|
||||
@Schema(name = "操作模块")
|
||||
@ExcelProperty(value = "操作模块")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 业务类型(0其它 1新增 2修改 3删除)
|
||||
*/
|
||||
@ApiModelProperty(value = "业务类型(0其它 1新增 2修改 3删除)")
|
||||
@Schema(name = "业务类型(0其它 1新增 2修改 3删除)")
|
||||
@ExcelProperty(value = "业务类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_oper_type")
|
||||
private Integer businessType;
|
||||
@ -56,28 +55,28 @@ public class SysOperLog implements Serializable {
|
||||
/**
|
||||
* 业务类型数组
|
||||
*/
|
||||
@ApiModelProperty(value = "业务类型数组")
|
||||
@Schema(name = "业务类型数组")
|
||||
@TableField(exist = false)
|
||||
private Integer[] businessTypes;
|
||||
|
||||
/**
|
||||
* 请求方法
|
||||
*/
|
||||
@ApiModelProperty(value = "请求方法")
|
||||
@Schema(name = "请求方法")
|
||||
@ExcelProperty(value = "请求方法")
|
||||
private String method;
|
||||
|
||||
/**
|
||||
* 请求方式
|
||||
*/
|
||||
@ApiModelProperty(value = "请求方式")
|
||||
@Schema(name = "请求方式")
|
||||
@ExcelProperty(value = "请求方式")
|
||||
private String requestMethod;
|
||||
|
||||
/**
|
||||
* 操作类别(0其它 1后台用户 2手机端用户)
|
||||
*/
|
||||
@ApiModelProperty(value = "操作类别(0其它 1后台用户 2手机端用户)")
|
||||
@Schema(name = "操作类别(0其它 1后台用户 2手机端用户)")
|
||||
@ExcelProperty(value = "操作类别", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=其它,1=后台用户,2=手机端用户")
|
||||
private Integer operatorType;
|
||||
@ -85,56 +84,56 @@ public class SysOperLog implements Serializable {
|
||||
/**
|
||||
* 操作人员
|
||||
*/
|
||||
@ApiModelProperty(value = "操作人员")
|
||||
@Schema(name = "操作人员")
|
||||
@ExcelProperty(value = "操作人员")
|
||||
private String operName;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
@Schema(name = "部门名称")
|
||||
@ExcelProperty(value = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 请求url
|
||||
*/
|
||||
@ApiModelProperty(value = "请求url")
|
||||
@Schema(name = "请求url")
|
||||
@ExcelProperty(value = "请求地址")
|
||||
private String operUrl;
|
||||
|
||||
/**
|
||||
* 操作地址
|
||||
*/
|
||||
@ApiModelProperty(value = "操作地址")
|
||||
@Schema(name = "操作地址")
|
||||
@ExcelProperty(value = "操作地址")
|
||||
private String operIp;
|
||||
|
||||
/**
|
||||
* 操作地点
|
||||
*/
|
||||
@ApiModelProperty(value = "操作地点")
|
||||
@Schema(name = "操作地点")
|
||||
@ExcelProperty(value = "操作地点")
|
||||
private String operLocation;
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@ApiModelProperty(value = "请求参数")
|
||||
@Schema(name = "请求参数")
|
||||
@ExcelProperty(value = "请求参数")
|
||||
private String operParam;
|
||||
|
||||
/**
|
||||
* 返回参数
|
||||
*/
|
||||
@ApiModelProperty(value = "返回参数")
|
||||
@Schema(name = "返回参数")
|
||||
@ExcelProperty(value = "返回参数")
|
||||
private String jsonResult;
|
||||
|
||||
/**
|
||||
* 操作状态(0正常 1异常)
|
||||
*/
|
||||
@ApiModelProperty(value = "操作状态(0正常 1异常)")
|
||||
@Schema(name = "操作状态(0正常 1异常)")
|
||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_common_status")
|
||||
private Integer status;
|
||||
@ -142,21 +141,21 @@ public class SysOperLog implements Serializable {
|
||||
/**
|
||||
* 错误消息
|
||||
*/
|
||||
@ApiModelProperty(value = "错误消息")
|
||||
@Schema(name = "错误消息")
|
||||
@ExcelProperty(value = "错误消息")
|
||||
private String errorMsg;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
@ApiModelProperty(value = "操作时间")
|
||||
@Schema(name = "操作时间")
|
||||
@ExcelProperty(value = "操作时间")
|
||||
private Date operTime;
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@ApiModelProperty(value = "请求参数")
|
||||
@Schema(name = "请求参数")
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
|
||||
|
@ -8,8 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -27,13 +26,13 @@ import javax.validation.constraints.Size;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_post")
|
||||
@ExcelIgnoreUnannotated
|
||||
@ApiModel("岗位信息业务对象")
|
||||
@Schema(name = "岗位信息业务对象")
|
||||
public class SysPost extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 岗位序号
|
||||
*/
|
||||
@ApiModelProperty(value = "岗位序号")
|
||||
@Schema(name = "岗位序号")
|
||||
@ExcelProperty(value = "岗位序号")
|
||||
@TableId(value = "post_id")
|
||||
private Long postId;
|
||||
@ -41,7 +40,7 @@ public class SysPost extends BaseEntity {
|
||||
/**
|
||||
* 岗位编码
|
||||
*/
|
||||
@ApiModelProperty(value = "岗位编码")
|
||||
@Schema(name = "岗位编码")
|
||||
@ExcelProperty(value = "岗位编码")
|
||||
@NotBlank(message = "岗位编码不能为空")
|
||||
@Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符")
|
||||
@ -50,7 +49,7 @@ public class SysPost extends BaseEntity {
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
@ApiModelProperty(value = "岗位名称")
|
||||
@Schema(name = "岗位名称")
|
||||
@ExcelProperty(value = "岗位名称")
|
||||
@NotBlank(message = "岗位名称不能为空")
|
||||
@Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符")
|
||||
@ -59,7 +58,7 @@ public class SysPost extends BaseEntity {
|
||||
/**
|
||||
* 岗位排序
|
||||
*/
|
||||
@ApiModelProperty(value = "岗位排序")
|
||||
@Schema(name = "岗位排序")
|
||||
@ExcelProperty(value = "岗位排序")
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer postSort;
|
||||
@ -67,7 +66,7 @@ public class SysPost extends BaseEntity {
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@ApiModelProperty(value = "状态(0正常 1停用)")
|
||||
@Schema(name = "状态(0正常 1停用)")
|
||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_common_status")
|
||||
private String status;
|
||||
@ -75,13 +74,13 @@ public class SysPost extends BaseEntity {
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(name = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 用户是否存在此岗位标识 默认不存在
|
||||
*/
|
||||
@ApiModelProperty(value = "用户是否存在此岗位标识 默认不存在")
|
||||
@Schema(name = "用户是否存在此岗位标识 默认不存在")
|
||||
@TableField(exist = false)
|
||||
private boolean flag = false;
|
||||
|
||||
|
@ -3,8 +3,7 @@ package com.ruoyi.system.domain;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@ -15,20 +14,20 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("sys_role_dept")
|
||||
@ApiModel("角色和部门关联")
|
||||
@Schema(name = "角色和部门关联")
|
||||
public class SysRoleDept {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
@Schema(name = "角色ID")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@ApiModelProperty(value = "部门ID")
|
||||
@Schema(name = "部门ID")
|
||||
private Long deptId;
|
||||
|
||||
}
|
||||
|
@ -3,8 +3,7 @@ package com.ruoyi.system.domain;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@ -15,20 +14,20 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("sys_role_menu")
|
||||
@ApiModel("角色和菜单关联")
|
||||
@Schema(name = "角色和菜单关联")
|
||||
public class SysRoleMenu {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
@Schema(name = "角色ID")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
@Schema(name = "角色ID")
|
||||
private Long menuId;
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@ -11,55 +10,55 @@ import lombok.Data;
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel("当前在线会话业务对象")
|
||||
@Schema(name = "当前在线会话业务对象")
|
||||
public class SysUserOnline {
|
||||
|
||||
/**
|
||||
* 会话编号
|
||||
*/
|
||||
@ApiModelProperty(value = "会话编号")
|
||||
@Schema(name = "会话编号")
|
||||
private String tokenId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
@Schema(name = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
@Schema(name = "用户名称")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 登录IP地址
|
||||
*/
|
||||
@ApiModelProperty(value = "登录IP地址")
|
||||
@Schema(name = "登录IP地址")
|
||||
private String ipaddr;
|
||||
|
||||
/**
|
||||
* 登录地址
|
||||
*/
|
||||
@ApiModelProperty(value = "登录地址")
|
||||
@Schema(name = "登录地址")
|
||||
private String loginLocation;
|
||||
|
||||
/**
|
||||
* 浏览器类型
|
||||
*/
|
||||
@ApiModelProperty(value = "浏览器类型")
|
||||
@Schema(name = "浏览器类型")
|
||||
private String browser;
|
||||
|
||||
/**
|
||||
* 操作系统
|
||||
*/
|
||||
@ApiModelProperty(value = "操作系统")
|
||||
@Schema(name = "操作系统")
|
||||
private String os;
|
||||
|
||||
/**
|
||||
* 登录时间
|
||||
*/
|
||||
@ApiModelProperty(value = "登录时间")
|
||||
@Schema(name = "登录时间")
|
||||
private Long loginTime;
|
||||
|
||||
}
|
||||
|
@ -3,8 +3,7 @@ package com.ruoyi.system.domain;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@ -15,20 +14,20 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("sys_user_post")
|
||||
@ApiModel("用户和岗位关联")
|
||||
@Schema(name = "用户和岗位关联")
|
||||
public class SysUserPost {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@Schema(name = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
@ApiModelProperty(value = "岗位ID")
|
||||
@Schema(name = "岗位ID")
|
||||
private Long postId;
|
||||
|
||||
}
|
||||
|
@ -3,8 +3,7 @@ package com.ruoyi.system.domain;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@ -15,20 +14,20 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("sys_user_role")
|
||||
@ApiModel("用户和角色关联")
|
||||
@Schema(name = "用户和角色关联")
|
||||
public class SysUserRole {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@Schema(name = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
@Schema(name = "角色ID")
|
||||
private Long roleId;
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
package com.ruoyi.system.domain.bo;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -13,33 +12,33 @@ import lombok.EqualsAndHashCode;
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("OSS对象存储分页查询对象")
|
||||
@Schema(name = "OSS对象存储分页查询对象")
|
||||
public class SysOssBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
@ApiModelProperty("文件名")
|
||||
@Schema(name = "文件名")
|
||||
private String fileName;
|
||||
/**
|
||||
* 原名
|
||||
*/
|
||||
@ApiModelProperty("原名")
|
||||
@Schema(name = "原名")
|
||||
private String originalName;
|
||||
/**
|
||||
* 文件后缀名
|
||||
*/
|
||||
@ApiModelProperty("文件后缀名")
|
||||
@Schema(name = "文件后缀名")
|
||||
private String fileSuffix;
|
||||
/**
|
||||
* URL地址
|
||||
*/
|
||||
@ApiModelProperty("URL地址")
|
||||
@Schema(name = "URL地址")
|
||||
private String url;
|
||||
/**
|
||||
* 服务商
|
||||
*/
|
||||
@ApiModelProperty("服务商")
|
||||
@Schema(name = "服务商")
|
||||
private String service;
|
||||
|
||||
}
|
||||
|
@ -3,8 +3,7 @@ package com.ruoyi.system.domain.bo;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -22,20 +21,20 @@ import javax.validation.constraints.Size;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("对象存储配置业务对象")
|
||||
@Schema(name = "对象存储配置业务对象")
|
||||
public class SysOssConfigBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主建
|
||||
*/
|
||||
@ApiModelProperty(value = "主建", required = true)
|
||||
@Schema(name = "主建", required = true)
|
||||
@NotNull(message = "主建不能为空", groups = {EditGroup.class})
|
||||
private Long ossConfigId;
|
||||
|
||||
/**
|
||||
* 配置key
|
||||
*/
|
||||
@ApiModelProperty(value = "配置key", required = true)
|
||||
@Schema(name = "配置key", required = true)
|
||||
@NotBlank(message = "配置key不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
@Size(min = 2, max = 100, message = "configKey长度必须介于2和20 之间")
|
||||
private String configKey;
|
||||
@ -43,7 +42,7 @@ public class SysOssConfigBo extends BaseEntity {
|
||||
/**
|
||||
* accessKey
|
||||
*/
|
||||
@ApiModelProperty(value = "accessKey", required = true)
|
||||
@Schema(name = "accessKey", required = true)
|
||||
@NotBlank(message = "accessKey不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
@Size(min = 2, max = 100, message = "accessKey长度必须介于2和100 之间")
|
||||
private String accessKey;
|
||||
@ -51,7 +50,7 @@ public class SysOssConfigBo extends BaseEntity {
|
||||
/**
|
||||
* 秘钥
|
||||
*/
|
||||
@ApiModelProperty(value = "secretKey", required = true)
|
||||
@Schema(name = "secretKey", required = true)
|
||||
@NotBlank(message = "secretKey不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
@Size(min = 2, max = 100, message = "secretKey长度必须介于2和100 之间")
|
||||
private String secretKey;
|
||||
@ -59,7 +58,7 @@ public class SysOssConfigBo extends BaseEntity {
|
||||
/**
|
||||
* 桶名称
|
||||
*/
|
||||
@ApiModelProperty(value = "桶名称", required = true)
|
||||
@Schema(name = "桶名称", required = true)
|
||||
@NotBlank(message = "桶名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
@Size(min = 2, max = 100, message = "bucketName长度必须介于2和100之间")
|
||||
private String bucketName;
|
||||
@ -67,13 +66,13 @@ public class SysOssConfigBo extends BaseEntity {
|
||||
/**
|
||||
* 前缀
|
||||
*/
|
||||
@ApiModelProperty(value = "前缀")
|
||||
@Schema(name = "前缀")
|
||||
private String prefix;
|
||||
|
||||
/**
|
||||
* 访问站点
|
||||
*/
|
||||
@ApiModelProperty(value = "访问站点", required = true)
|
||||
@Schema(name = "访问站点", required = true)
|
||||
@NotBlank(message = "访问站点不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
@Size(min = 2, max = 100, message = "endpoint长度必须介于2和100之间")
|
||||
private String endpoint;
|
||||
@ -81,37 +80,37 @@ public class SysOssConfigBo extends BaseEntity {
|
||||
/**
|
||||
* 自定义域名
|
||||
*/
|
||||
@ApiModelProperty("自定义域名")
|
||||
@Schema(name = "自定义域名")
|
||||
private String domain;
|
||||
|
||||
/**
|
||||
* 是否https(Y=是,N=否)
|
||||
*/
|
||||
@ApiModelProperty("是否https(Y=是,N=否)")
|
||||
@Schema(name = "是否https(Y=是,N=否)")
|
||||
private String isHttps;
|
||||
|
||||
/**
|
||||
* 状态(0=正常,1=停用)
|
||||
*/
|
||||
@ApiModelProperty("状态(0=正常,1=停用)")
|
||||
@Schema(name = "状态(0=正常,1=停用)")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 域
|
||||
*/
|
||||
@ApiModelProperty(value = "域")
|
||||
@Schema(name = "域")
|
||||
private String region;
|
||||
|
||||
/**
|
||||
* 扩展字段
|
||||
*/
|
||||
@ApiModelProperty(value = "扩展字段")
|
||||
@Schema(name = "扩展字段")
|
||||
private String ext1;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Schema(name = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
package com.ruoyi.system.domain.vo;
|
||||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@ -12,31 +11,31 @@ import lombok.Data;
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel("路由显示信息")
|
||||
@Schema(name = "路由显示信息")
|
||||
public class MetaVo {
|
||||
|
||||
/**
|
||||
* 设置该路由在侧边栏和面包屑中展示的名字
|
||||
*/
|
||||
@ApiModelProperty(value = "设置该路由在侧边栏和面包屑中展示的名字")
|
||||
@Schema(name = "设置该路由在侧边栏和面包屑中展示的名字")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 设置该路由的图标,对应路径src/assets/icons/svg
|
||||
*/
|
||||
@ApiModelProperty(value = "设置该路由的图标,对应路径src/assets/icons/svg")
|
||||
@Schema(name = "设置该路由的图标,对应路径src/assets/icons/svg")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 设置为true,则不会被 <keep-alive>缓存
|
||||
*/
|
||||
@ApiModelProperty(value = "设置为true,则不会被 <keep-alive>缓存")
|
||||
@Schema(name = "设置为true,则不会被 <keep-alive>缓存")
|
||||
private boolean noCache;
|
||||
|
||||
/**
|
||||
* 内链地址(http(s)://开头)
|
||||
*/
|
||||
@ApiModelProperty(value = "内链地址(http(s)://开头)")
|
||||
@Schema(name = "内链地址(http(s)://开头)")
|
||||
private String link;
|
||||
|
||||
public MetaVo(String title, String icon) {
|
||||
|
@ -1,8 +1,7 @@
|
||||
package com.ruoyi.system.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@ -14,61 +13,61 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
@ApiModel("路由配置信息")
|
||||
@Schema(name = "路由配置信息")
|
||||
public class RouterVo {
|
||||
|
||||
/**
|
||||
* 路由名字
|
||||
*/
|
||||
@ApiModelProperty(value = "路由名字")
|
||||
@Schema(name = "路由名字")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
@ApiModelProperty(value = "路由地址")
|
||||
@Schema(name = "路由地址")
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现
|
||||
*/
|
||||
@ApiModelProperty(value = "是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现")
|
||||
@Schema(name = "是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现")
|
||||
private boolean hidden;
|
||||
|
||||
/**
|
||||
* 重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
|
||||
*/
|
||||
@ApiModelProperty(value = "重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击")
|
||||
@Schema(name = "重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击")
|
||||
private String redirect;
|
||||
|
||||
/**
|
||||
* 组件地址
|
||||
*/
|
||||
@ApiModelProperty(value = "组件地址")
|
||||
@Schema(name = "组件地址")
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 路由参数:如 {"id": 1, "name": "ry"}
|
||||
*/
|
||||
@ApiModelProperty(value = "路由参数:如 {\"id\": 1, \"name\": \"ry\"}")
|
||||
@Schema(name = "路由参数:如 {\"id\": 1, \"name\": \"ry\"}")
|
||||
private String query;
|
||||
|
||||
/**
|
||||
* 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面
|
||||
*/
|
||||
@ApiModelProperty(value = "当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面")
|
||||
@Schema(name = "当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面")
|
||||
private Boolean alwaysShow;
|
||||
|
||||
/**
|
||||
* 其他元素
|
||||
*/
|
||||
@ApiModelProperty(value = "其他元素")
|
||||
@Schema(name = "其他元素")
|
||||
private MetaVo meta;
|
||||
|
||||
/**
|
||||
* 子路由
|
||||
*/
|
||||
@ApiModelProperty(value = "子路由")
|
||||
@Schema(name = "子路由")
|
||||
private List<RouterVo> children;
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
package com.ruoyi.system.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@ -14,7 +13,7 @@ import lombok.Data;
|
||||
* @date 2021-08-13
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("对象存储配置视图对象")
|
||||
@Schema(name = "对象存储配置视图对象")
|
||||
@ExcelIgnoreUnannotated
|
||||
public class SysOssConfigVo {
|
||||
|
||||
@ -23,79 +22,79 @@ public class SysOssConfigVo {
|
||||
/**
|
||||
* 主建
|
||||
*/
|
||||
@ApiModelProperty("主建")
|
||||
@Schema(name = "主建")
|
||||
private Long ossConfigId;
|
||||
|
||||
/**
|
||||
* 配置key
|
||||
*/
|
||||
@ApiModelProperty("配置key")
|
||||
@Schema(name = "配置key")
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* accessKey
|
||||
*/
|
||||
@ApiModelProperty("accessKey")
|
||||
@Schema(name = "accessKey")
|
||||
private String accessKey;
|
||||
|
||||
/**
|
||||
* 秘钥
|
||||
*/
|
||||
@ApiModelProperty("secretKey")
|
||||
@Schema(name = "secretKey")
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
* 桶名称
|
||||
*/
|
||||
@ApiModelProperty("桶名称")
|
||||
@Schema(name = "桶名称")
|
||||
private String bucketName;
|
||||
|
||||
/**
|
||||
* 前缀
|
||||
*/
|
||||
@ApiModelProperty("前缀")
|
||||
@Schema(name = "前缀")
|
||||
private String prefix;
|
||||
|
||||
/**
|
||||
* 访问站点
|
||||
*/
|
||||
@ApiModelProperty("访问站点")
|
||||
@Schema(name = "访问站点")
|
||||
private String endpoint;
|
||||
|
||||
/**
|
||||
* 自定义域名
|
||||
*/
|
||||
@ApiModelProperty("自定义域名")
|
||||
@Schema(name = "自定义域名")
|
||||
private String domain;
|
||||
|
||||
/**
|
||||
* 是否https(Y=是,N=否)
|
||||
*/
|
||||
@ApiModelProperty("是否https(Y=是,N=否)")
|
||||
@Schema(name = "是否https(Y=是,N=否)")
|
||||
private String isHttps;
|
||||
|
||||
/**
|
||||
* 域
|
||||
*/
|
||||
@ApiModelProperty("域")
|
||||
@Schema(name = "域")
|
||||
private String region;
|
||||
|
||||
/**
|
||||
* 状态(0=正常,1=停用)
|
||||
*/
|
||||
@ApiModelProperty("状态(0=正常,1=停用)")
|
||||
@Schema(name = "状态(0=正常,1=停用)")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 扩展字段
|
||||
*/
|
||||
@ApiModelProperty("扩展字段")
|
||||
@Schema(name = "扩展字段")
|
||||
private String ext1;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
@Schema(name = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.ruoyi.system.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@ -12,7 +11,7 @@ import java.util.Date;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("OSS对象存储视图对象")
|
||||
@Schema(name = "OSS对象存储视图对象")
|
||||
public class SysOssVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -20,49 +19,49 @@ public class SysOssVo {
|
||||
/**
|
||||
* 对象存储主键
|
||||
*/
|
||||
@ApiModelProperty("对象存储主键")
|
||||
@Schema(name = "对象存储主键")
|
||||
private Long ossId;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
@ApiModelProperty("文件名")
|
||||
@Schema(name = "文件名")
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 原名
|
||||
*/
|
||||
@ApiModelProperty("原名")
|
||||
@Schema(name = "原名")
|
||||
private String originalName;
|
||||
|
||||
/**
|
||||
* 文件后缀名
|
||||
*/
|
||||
@ApiModelProperty("文件后缀名")
|
||||
@Schema(name = "文件后缀名")
|
||||
private String fileSuffix;
|
||||
|
||||
/**
|
||||
* URL地址
|
||||
*/
|
||||
@ApiModelProperty("URL地址")
|
||||
@Schema(name = "URL地址")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
@Schema(name = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 上传人
|
||||
*/
|
||||
@ApiModelProperty("上传人")
|
||||
@Schema(name = "上传人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 服务商
|
||||
*/
|
||||
@ApiModelProperty("服务商")
|
||||
@Schema(name = "服务商")
|
||||
private String service;
|
||||
|
||||
|
||||
|
@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@ -120,7 +119,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
||||
throw new ServiceException("系统内置, 不可删除!");
|
||||
}
|
||||
}
|
||||
List<SysOssConfig> list = Lists.newArrayList();
|
||||
List<SysOssConfig> list = CollUtil.newArrayList();
|
||||
for (Long configId : ids) {
|
||||
SysOssConfig config = baseMapper.selectById(configId);
|
||||
list.add(config);
|
||||
|
Loading…
Reference in New Issue
Block a user