|
|
@@ -18,7 +18,7 @@ import com.yy.basedevelop.common.data.BaseReturnDto;
|
|
|
|
|
|
|
|
|
import com.yy.basedevelop.common.http.config.RedisService;
|
|
|
-import com.yy.basedevelop.common.http.config.ThreadLocalContext;
|
|
|
+
|
|
|
import com.yy.basedevelop.common.util.DictUtil;
|
|
|
import com.yy.basedevelop.common.util.ExcelUtil;
|
|
|
import com.yy.basedevelop.common.util.HttpClientUtils;
|
|
|
@@ -67,7 +67,7 @@ public class DemoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("listdict")
|
|
|
- public TestDemoDto listdict(@RequestBody TestDemoDto dto) {
|
|
|
+ public Mono<TestDemoDto> listdict(@RequestBody TestDemoDto dto) {
|
|
|
log.info("listdict=:{}", dto);
|
|
|
|
|
|
TestDemoDto dto1 = new TestDemoDto();
|
|
|
@@ -76,7 +76,7 @@ public class DemoController {
|
|
|
dto1.setDictValue(DictUtil.getDictCodeStr(dto.getDictTypeNameCn(),dto.getDictNameCn()));
|
|
|
Integer val=DictUtil.getDictCodeInt(dto.getDictTypeNameCn(),dto.getDictNameCn());
|
|
|
log.info("val=:{}", val);
|
|
|
- return dto1;
|
|
|
+ return Mono.just(dto1);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -87,7 +87,7 @@ public class DemoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("ossTest")
|
|
|
- public TestDemoDto ossTest(@RequestPart("file") FilePart filePart,
|
|
|
+ public Mono<TestDemoDto> ossTest(@RequestPart("file") FilePart filePart,
|
|
|
@RequestPart("description") String description,
|
|
|
@RequestPart("path") String path) {
|
|
|
log.info("接收的listoss=:{},path={}", description,path);
|
|
|
@@ -100,7 +100,7 @@ public class DemoController {
|
|
|
dto1.setName("返回名字oss");
|
|
|
dto1.setAge(25);
|
|
|
dto1.setOssUrl(ossstr);
|
|
|
- return dto1;
|
|
|
+ return Mono.just(dto1);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -125,7 +125,7 @@ public class DemoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("redisTest")
|
|
|
- public TestDemoDto list5668(@RequestBody TestDemoDto dto) {
|
|
|
+ public Mono<TestDemoDto> list5668(@RequestBody TestDemoDto dto) {
|
|
|
log.info("接收的DTO8=:{}", dto);
|
|
|
|
|
|
Boolean baaa=redisService.hasKey("aaa");
|
|
|
@@ -134,7 +134,7 @@ public class DemoController {
|
|
|
TestDemoDto dto1 = new TestDemoDto();
|
|
|
dto1.setName("直接返回Dto");
|
|
|
dto1.setAge(26);
|
|
|
- return dto1;
|
|
|
+ return Mono.just(dto1);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -212,10 +212,10 @@ public class DemoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("normReturn")
|
|
|
- public BaseReturnDto normReturn(@RequestBody SysDictData sysDictData) {
|
|
|
+ public Mono<BaseReturnDto> normReturn(@RequestBody SysDictData sysDictData) {
|
|
|
|
|
|
List<SysDictData> list=DictUtil.getSysDictDataByKey(sysDictData.getDictType());
|
|
|
- return BaseReturnDto.success(list);
|
|
|
+ return Mono.just(BaseReturnDto.success(list));
|
|
|
}
|
|
|
|
|
|
/***
|
|
|
@@ -225,10 +225,10 @@ public class DemoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("listPage")
|
|
|
- public BasePageResult<MyDemoDto> listPage(@RequestBody QueryDto dto) {
|
|
|
+ public Mono<BasePageResult<MyDemoDto>> listPage(@RequestBody QueryDto dto) {
|
|
|
BasePageResult<MyDemoDto> lst=demoService.qyeryList(dto);
|
|
|
|
|
|
- return lst.success();
|
|
|
+ return Mono.just(lst.success());
|
|
|
}
|
|
|
|
|
|
/***
|
|
|
@@ -238,10 +238,10 @@ public class DemoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("listpage2")
|
|
|
- public BasePageResult<MyDemoDto> listpage2(@RequestBody QueryDto dto) {
|
|
|
+ public Mono<BasePageResult<MyDemoDto>> listpage2(@RequestBody QueryDto dto) {
|
|
|
BasePageResult<MyDemoDto> lst=demoService.qyeryList3(dto);
|
|
|
|
|
|
- return lst.success();
|
|
|
+ return Mono.just(lst.success());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -250,9 +250,9 @@ public class DemoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("listname2")
|
|
|
- public BasePageResult<MyDemoDto> select1(@RequestParam("name") String name) {
|
|
|
+ public Mono<BasePageResult<MyDemoDto>> select1(@RequestParam("name") String name) {
|
|
|
PageHelper.startPage(2, 10);
|
|
|
- return demoService.selectList1(name);
|
|
|
+ return Mono.just(demoService.selectList1(name));
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -262,13 +262,13 @@ public class DemoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("threadTest1")
|
|
|
- public MyDto threadTest1() {
|
|
|
+ public Mono<MyDto> threadTest1() {
|
|
|
|
|
|
log.info("当前访问了threadTest1");
|
|
|
transServer.testsubThread();
|
|
|
|
|
|
|
|
|
- return MyDto.success();
|
|
|
+ return Mono.just(MyDto.success());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -276,11 +276,11 @@ public class DemoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("retunJson")
|
|
|
- public MyDto<JSONObject> retunJson() {
|
|
|
+ public Mono<MyDto<JSONObject>> retunJson() {
|
|
|
|
|
|
log.info("list1");
|
|
|
|
|
|
- return MyDto.success(JSONObject.parseObject("{\"a\":1}"));
|
|
|
+ return Mono.just(MyDto.success(JSONObject.parseObject("{\"a\":1}")));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -289,14 +289,14 @@ public class DemoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/mothod1")
|
|
|
- public MyDto threadTest(@RequestBody MyParmDto dto) {
|
|
|
+ public Mono<MyDto> threadTest(@RequestBody MyParmDto dto) {
|
|
|
log.info("当前访问了mothod1");
|
|
|
|
|
|
|
|
|
transServer.threadTest1(dto.getName());
|
|
|
|
|
|
|
|
|
- return MyDto.success();
|
|
|
+ return Mono.just(MyDto.success());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -305,13 +305,13 @@ public class DemoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("username")
|
|
|
- public MyDto username(@RequestParam(value = "name", required = false) String name) {
|
|
|
+ public Mono<MyDto> username(@RequestParam(value = "name", required = false) String name) {
|
|
|
if (name == null || name.trim().isEmpty()) {
|
|
|
JSONObject error = new JSONObject();
|
|
|
error.put("error", "Name parameter is required and cannot be empty");
|
|
|
MyDto d= MyDto.success(error);
|
|
|
|
|
|
- return d;
|
|
|
+ return Mono.just(d);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -319,7 +319,7 @@ public class DemoController {
|
|
|
response.put("name", name);
|
|
|
MyDto d= MyDto.error(response);
|
|
|
|
|
|
- return d;
|
|
|
+ return Mono.just(d);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -327,10 +327,10 @@ public class DemoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("returnJson")
|
|
|
- public BaseReturnDto<JSONObject> anniu1(){
|
|
|
+ public Mono<BaseReturnDto<JSONObject>> anniu1(){
|
|
|
JSONObject response = new JSONObject();
|
|
|
response.put("name", "按钮1,编辑权限");
|
|
|
- return BaseReturnDto.success(response);
|
|
|
+ return Mono.just(BaseReturnDto.success(response));
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -340,10 +340,10 @@ public class DemoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("remotCall")
|
|
|
- public BaseReturnDto<JSONObject> remotCall(){
|
|
|
+ public Mono<BaseReturnDto<JSONObject>> remotCall(){
|
|
|
JSONObject response = new JSONObject();
|
|
|
transServer.remotCall();
|
|
|
- return BaseReturnDto.success(response);
|
|
|
+ return Mono.just(BaseReturnDto.success(response));
|
|
|
}
|
|
|
|
|
|
|