mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 18:15:56 +08:00
Pre Merge pull request !428 from David Wei/update/r_method
This commit is contained in:
commit
284162c7cf
@ -99,7 +99,7 @@ public class AuthController {
|
||||
}
|
||||
AuthRequest authRequest = SocialUtils.getAuthRequest(source, socialProperties);
|
||||
String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
|
||||
return R.ok("操作成功", authorizeUrl);
|
||||
return R.ok(authorizeUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -140,7 +140,7 @@ public class AuthController {
|
||||
@PostMapping("/logout")
|
||||
public R<Void> logout() {
|
||||
loginService.logout();
|
||||
return R.ok("退出成功");
|
||||
return R.ok(null, "退出成功");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -43,11 +43,7 @@ public class R<T> implements Serializable {
|
||||
return restResult(data, SUCCESS, "操作成功");
|
||||
}
|
||||
|
||||
public static <T> R<T> ok(String msg) {
|
||||
return restResult(null, SUCCESS, msg);
|
||||
}
|
||||
|
||||
public static <T> R<T> ok(String msg, T data) {
|
||||
public static <T> R<T> ok(T data, String msg) {
|
||||
return restResult(data, SUCCESS, msg);
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ public class RedisCacheController {
|
||||
@Cacheable(cacheNames = "demo:cache#60s#10m#20", key = "#key", condition = "#key != null")
|
||||
@GetMapping("/test1")
|
||||
public R<String> test1(String key, String value) {
|
||||
return R.ok("操作成功", value);
|
||||
return R.ok(value);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -56,7 +56,7 @@ public class RedisCacheController {
|
||||
@CachePut(cacheNames = CacheNames.DEMO_CACHE, key = "#key", condition = "#key != null")
|
||||
@GetMapping("/test2")
|
||||
public R<String> test2(String key, String value) {
|
||||
return R.ok("操作成功", value);
|
||||
return R.ok(value);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,7 +70,7 @@ public class RedisCacheController {
|
||||
@CacheEvict(cacheNames = CacheNames.DEMO_CACHE, key = "#key", condition = "#key != null")
|
||||
@GetMapping("/test3")
|
||||
public R<String> test3(String key, String value) {
|
||||
return R.ok("操作成功", value);
|
||||
return R.ok(value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -40,7 +40,7 @@ public class RedisLockController {
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println("end :" + key + ",time:" + LocalTime.now().toString());
|
||||
return R.ok("操作成功", value);
|
||||
return R.ok(value);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,7 +65,7 @@ public class RedisLockController {
|
||||
lockTemplate.releaseLock(lockInfo);
|
||||
}
|
||||
//结束
|
||||
return R.ok("操作成功", value);
|
||||
return R.ok(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ public class RedisPubSubController {
|
||||
RedisUtils.publish(key, value, consumer -> {
|
||||
System.out.println("发布通道 => " + key + ", 发送值 => " + value);
|
||||
});
|
||||
return R.ok("操作成功");
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -41,7 +41,7 @@ public class RedisPubSubController {
|
||||
RedisUtils.subscribe(key, String.class, msg -> {
|
||||
System.out.println("订阅通道 => " + key + ", 接收值 => " + msg);
|
||||
});
|
||||
return R.ok("操作成功");
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ public class RedisRateLimiterController {
|
||||
@RateLimiter(count = 2, time = 10)
|
||||
@GetMapping("/test")
|
||||
public R<String> test(String value) {
|
||||
return R.ok("操作成功", value);
|
||||
return R.ok(value);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -36,7 +36,7 @@ public class RedisRateLimiterController {
|
||||
@RateLimiter(count = 2, time = 10, limitType = LimitType.IP)
|
||||
@GetMapping("/testip")
|
||||
public R<String> testip(String value) {
|
||||
return R.ok("操作成功", value);
|
||||
return R.ok(value);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -46,7 +46,7 @@ public class RedisRateLimiterController {
|
||||
@RateLimiter(count = 2, time = 10, limitType = LimitType.CLUSTER)
|
||||
@GetMapping("/testcluster")
|
||||
public R<String> testcluster(String value) {
|
||||
return R.ok("操作成功", value);
|
||||
return R.ok(value);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -58,7 +58,7 @@ public class RedisRateLimiterController {
|
||||
@RateLimiter(count = 2, time = 10, limitType = LimitType.IP, key = "#value")
|
||||
@GetMapping("/testObj")
|
||||
public R<String> testObj(String value) {
|
||||
return R.ok("操作成功", value);
|
||||
return R.ok(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ public class Swagger3DemoController {
|
||||
*/
|
||||
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public R<String> upload(@RequestPart("file") MultipartFile file) {
|
||||
return R.ok("操作成功", file.getOriginalFilename());
|
||||
return R.ok(file.getOriginalFilename());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ public class TestDemoController extends BaseController {
|
||||
@Log(title = "测试单表", businessType = BusinessType.IMPORT)
|
||||
@SaCheckPermission("demo:demo:import")
|
||||
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public R<Void> importData(@RequestPart("file") MultipartFile file) throws Exception {
|
||||
public R<String> importData(@RequestPart("file") MultipartFile file) throws Exception {
|
||||
ExcelResult<TestDemoImportVo> excelResult = ExcelUtil.importExcel(file.getInputStream(), TestDemoImportVo.class, true);
|
||||
List<TestDemo> list = MapstructUtils.convert(excelResult.getList(), TestDemo.class);
|
||||
testDemoService.saveBatch(list);
|
||||
|
||||
@ -32,7 +32,7 @@ public class TestI18nController {
|
||||
* @param code 国际化code
|
||||
*/
|
||||
@GetMapping()
|
||||
public R<Void> get(String code) {
|
||||
public R<String> get(String code) {
|
||||
return R.ok(MessageUtils.message(code));
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ public class TestI18nController {
|
||||
* 测试使用 not.null
|
||||
*/
|
||||
@GetMapping("/test1")
|
||||
public R<Void> test1(@NotBlank(message = "{not.null}") String str) {
|
||||
public R<String> test1(@NotBlank(message = "{not.null}") String str) {
|
||||
return R.ok(str);
|
||||
}
|
||||
|
||||
|
||||
@ -28,6 +28,6 @@ public class WeSocketController {
|
||||
@GetMapping("/send")
|
||||
public R<Void> send(WebSocketMessageDto dto) throws InterruptedException {
|
||||
WebSocketUtils.publishMessage(dto);
|
||||
return R.ok("操作成功");
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ public class BoundedQueueController {
|
||||
log.info("通道: {} , 发送数据: {}", queueName, data);
|
||||
}
|
||||
}
|
||||
return R.ok("操作成功");
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,7 +71,7 @@ public class BoundedQueueController {
|
||||
} else {
|
||||
return R.fail("操作失败");
|
||||
}
|
||||
return R.ok("操作成功");
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -86,7 +86,7 @@ public class BoundedQueueController {
|
||||
data = QueueUtils.getBoundedQueueObject(queueName);
|
||||
log.info("通道: {} , 获取数据: {}", queueName, data);
|
||||
} while (data != null);
|
||||
return R.ok("操作成功");
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ public class DelayedQueueController {
|
||||
// 观察接收时间
|
||||
log.info("通道: {}, 收到数据: {}", queueName, orderNum);
|
||||
});
|
||||
return R.ok("操作成功");
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -56,7 +56,7 @@ public class DelayedQueueController {
|
||||
QueueUtils.addDelayedQueueObject(queueName, orderNum, time, TimeUnit.SECONDS);
|
||||
// 观察发送时间
|
||||
log.info("通道: {} , 发送数据: {}", queueName, orderNum);
|
||||
return R.ok("操作成功");
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,7 +72,7 @@ public class DelayedQueueController {
|
||||
} else {
|
||||
return R.fail("操作失败");
|
||||
}
|
||||
return R.ok("操作成功");
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -84,7 +84,7 @@ public class DelayedQueueController {
|
||||
public R<Void> destroy(String queueName) {
|
||||
// 用完了一定要销毁 否则会一直存在
|
||||
QueueUtils.destroyDelayedQueue(queueName);
|
||||
return R.ok("操作成功");
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ public class PriorityQueueController {
|
||||
log.info("通道: {} , 发送数据: {}, 发送失败", queueName, data);
|
||||
}
|
||||
}
|
||||
return R.ok("操作成功");
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -68,7 +68,7 @@ public class PriorityQueueController {
|
||||
} else {
|
||||
return R.fail("操作失败");
|
||||
}
|
||||
return R.ok("操作成功");
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,7 +83,7 @@ public class PriorityQueueController {
|
||||
data = QueueUtils.getPriorityQueueObject(queueName);
|
||||
log.info("通道: {} , 获取数据: {}", queueName, data);
|
||||
} while (data != null);
|
||||
return R.ok("操作成功");
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ public class SysConfigController extends BaseController {
|
||||
* @param configKey 参数Key
|
||||
*/
|
||||
@GetMapping(value = "/configKey/{configKey}")
|
||||
public R<Void> getConfigKey(@PathVariable String configKey) {
|
||||
public R<String> getConfigKey(@PathVariable String configKey) {
|
||||
return R.ok(configService.selectConfigByKey(configKey));
|
||||
}
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ public class SysUserController extends BaseController {
|
||||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||
@SaCheckPermission("system:user:import")
|
||||
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public R<Void> importData(@RequestPart("file") MultipartFile file, boolean updateSupport) throws Exception {
|
||||
public R<String> importData(@RequestPart("file") MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelResult<SysUserImportVo> result = ExcelUtil.importExcel(file.getInputStream(), SysUserImportVo.class, new SysUserImportListener(updateSupport));
|
||||
return R.ok(result.getAnalysis());
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user