kotlin - 单核细胞增多症使用 AWS 开发工具包 DynamoDB 增强型 Kotlin 时忽略
问题描述
我正在使用 Spring WebFlux、AWS SDK 2.X、Kotlin 和 DynamoDB 增强客户端。我想返回标题201
,Location
但我得到了一个200
. 似乎 AWS 开发工具包弄乱了我的实际ResponseEntity
@RestController
@RequestMapping("/test")
class TestController(
private val dynamoDbAsyncTable: DynamoDbAsyncTable<TestEntity>
) {
@PostMapping
fun save(): Mono<ResponseEntity<Unit>> {
// This returns 201 as expected
// return Mono.just("someId").map { ResponseEntity.created(URI.create("/test").build() }
// This returns 200
return Mono.fromFuture(dynamoDbAsyncTable.putItem(TestEntity("someId"))).map { ResponseEntity.created(URI.create("/test")).build<Unit>() }
}
}
我错过了什么吗?提前致谢!
解决方案
推荐阅读
- algorithm - 按键从一小组项目中查找项目的最快方法是什么?
- amazon-web-services - 从 aws ecs 任务定义中剥离的秘密
- sql - 同一个表中的多个连接
- postgresql - 连接到较旧的 Postgresql 数据库
- javascript - 制作 React Native 多行文本输入,在拖动时隐藏键盘并且不隐藏光标
- docker - 我不知道如何做同样的事情拉,创建和启动,而不是 docker run -dti
- ios - 如何快速检查类型并将其转换为 Decodable
- vb.net - 在 VB.NET 中,对象引用周围的括号到底是做什么的?
- python - 在 python tkinter 输入框中登录后显示用户名
- java - Java Stream - 结合过滤和收集