【7.1.6】更新控制器扫描

pull/83/MERGE
fengshuonan 2022-01-24 10:52:42 +08:00
parent 0c34de7eb3
commit 0ee6bec75d
3 changed files with 14 additions and 12 deletions

View File

@ -32,9 +32,9 @@ public class DemoController {
* @date 2021/1/24 10:59
*/
@GetResource(name = "示例方法", path = "/json/success")
public ResponseData renderSuccess() {
public ResponseData<?> renderSuccess() {
demoService.demoService();
return new SuccessResponseData();
return new SuccessResponseData<>();
}
/**
@ -47,8 +47,8 @@ public class DemoController {
* @date 2021/1/24 10:59
*/
@PostResource(name = "示例加密方法", path = "/encode", requiredPermission = false, requiredLogin = false, requiredEncryption = true)
public ResponseData encode(@RequestBody Dict dict) {
return new SuccessResponseData(dict);
public ResponseData<Dict> encode(@RequestBody Dict dict) {
return new SuccessResponseData<>(dict);
}
}

View File

@ -1,6 +1,7 @@
package cn.stylefeng.guns.modular.test;
import cn.stylefeng.guns.modular.test.service.TranTestService;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
@ -22,15 +23,15 @@ public class TestMultiTranController {
private TranTestService testMultiDbService;
@GetResource(name = "测试多数据源成功", path = "/tran/multi/success")
public Object testSuccess() {
public ResponseData<Object> testSuccess() {
testMultiDbService.beginTest();
return new SuccessResponseData();
return new SuccessResponseData<>();
}
@GetResource(name = "测试多数据源失败", path = "/tran/multi/fail")
public Object testFail() {
public ResponseData<Object> testFail() {
testMultiDbService.beginTestFail();
return new SuccessResponseData();
return new SuccessResponseData<>();
}
}

View File

@ -1,6 +1,7 @@
package cn.stylefeng.guns.modular.test;
import cn.stylefeng.guns.modular.test.service.TranTestService;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
@ -22,15 +23,15 @@ public class TestSingleTranController {
private TranTestService testMultiDbService;
@GetResource(name = "测试单数据源事务成功", path = "/tran/single/success")
public Object testSuccess() {
public ResponseData<Object> testSuccess() {
testMultiDbService.testSingleSuccess();
return new SuccessResponseData();
return new SuccessResponseData<>();
}
@GetResource(name = "测试单数据源事务失败", path = "/tran/single/fail")
public Object testFail() {
public ResponseData<Object> testFail() {
testMultiDbService.testSingleFail();
return new SuccessResponseData();
return new SuccessResponseData<>();
}
}