上一页 1 2 3 4 5 6 7 8 ··· 17 下一页

2022年10月27日

webflux 把返回的Flux对象转换成Mono对象

摘要: 在使用一个对象列表时用Flux public Mono<ServerResponse> listPeople(ServerRequest request) { Flux<Person> people = repository.allPeople(); return ok().contentType( 阅读全文

posted @ 2022-10-27 20:33 白衣风云 阅读(1019) 评论(0) 推荐(0) 编辑

2022年10月26日

webFlux 路由post请求时依赖注入字段报null

摘要: 有下列代码: @Autowired AuthHandler authHandler; RouterFunction<ServerResponse> doctorRouter = RouterFunctions.route() .path("/doctors", b1 -> b1 .nest(acce 阅读全文

posted @ 2022-10-26 10:23 白衣风云 阅读(59) 评论(0) 推荐(0) 编辑

2022年9月27日

java 布尔类型的默认值

摘要: 今天在看spring security源码时,有这么一段代码: public UserDetails build() { String encodedPassword = (String)this.passwordEncoder.apply(this.password); return new Us 阅读全文

posted @ 2022-09-27 20:46 白衣风云 阅读(79) 评论(0) 推荐(0) 编辑

2022年9月9日

webflux router 路径冲突

摘要: webflux中有下列路由: public RouterFunction<ServerResponse> doctorRoutes(DoctorHandler handler) { return RouterFunctions.route() .path("/doctors",b1 -> b1 .n 阅读全文

posted @ 2022-09-09 00:56 白衣风云 阅读(60) 评论(0) 推荐(0) 编辑

2022年6月22日

spring 远程调用时报错No substitution in url for:id

摘要: 在使用GET请求时使用了rest风格方式,结果报错500 Feign客户端代码 请求路由 服务端路由 使用postman 请求 报错信息 刚开始还以为路由写错了,最后发现是需要把路径上的id参数取出来传入调用的方法中,修改后代码 Feign客户端 package com.fengyun.medica 阅读全文

posted @ 2022-06-22 02:19 白衣风云 阅读(108) 评论(0) 推荐(0) 编辑

spring 实体类定义的字段不能从数据读取

摘要: 实体类上定义的日期字段,插入数据库时没问题,但是当读取出来时报映射错误,不能从类型LocalDate转换到Date类型: No converter found capable of converting from type [java.time.LocalDate] to type [java.ut 阅读全文

posted @ 2022-06-22 00:58 白衣风云 阅读(130) 评论(0) 推荐(0) 编辑

2022年6月19日

webFlux post 请求报错MonoOnErrorResume

摘要: webFlux发起 POST请求没有在数据中插入数据,返回400状态码,打印请求数据输出MonoOnErrorResume 实体类代码: 在插入数据时,总是报IdCard字段没有值,可在前端传值了,是怎么回事,最后把取到的数据再返回前端去,这下可明白了 看下IdCard 字段的首字母变成了小写,变量 阅读全文

posted @ 2022-06-19 14:32 白衣风云 阅读(469) 评论(0) 推荐(0) 编辑

2022年6月16日

spring 中把接口作为参数调用

摘要: 先看下面两段代码: package com.example.webflux.handler; import com.example.webflux.pojo.Greeting; import org.springframework.http.MediaType; import org.springf 阅读全文

posted @ 2022-06-16 01:55 白衣风云 阅读(183) 评论(0) 推荐(0) 编辑

2022年5月26日

django 项目部署后登录admin管理页面报403

摘要: 解决方案: 在settings页面中添加下列内容: CORS_ALLOWED_ORIGINS = [ "http://read.only.com", "http://change.allowed.com", ] # 添加下列内容 CSRF_TRUSTED_ORIGINS = [ "http://ch 阅读全文

posted @ 2022-05-26 23:02 白衣风云 阅读(192) 评论(0) 推荐(0) 编辑

2022年4月6日

feign-reactive 实现拦截器功能

摘要: 关于请求拦截器官网上说有两种实现方式:如下 第一种方式看不懂是怎么实现,网上搜了半天也没有找到,要是有大佬知道这是怎么回事,请告诉我。 第二种方式的实现,在此记录下 在标记ReactiveFeignClient的接口方法参数中添加@RequestHeader注解 在调用时传入自定义的请求头参数 在服 阅读全文

posted @ 2022-04-06 00:25 白衣风云 阅读(415) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 ··· 17 下一页

导航