我试图将EventLoopFuture类型转换为EventLoopFuture<Type>类型。}
let a = try req.content.decode(GetUserQuestions.self)
return Question.query(on: req.db).all().flatMap {qs
}行旁边出现错误Cannot convert return expression of type 'EventLoopFuture<Account.idOut>' to return type 'Account.idOutfunc newAccount(req: Request) throws -> EventLoopFuture<Account.idOut> {
let input = try req.content.decodelet acco
给定一个控制器方法,它接受符合Vapor中实体的部分或所有属性的请求体,是否有一种方法可以在不手动分配所有属性的情况下更新实体?content = try req.content.decode(Mission.self)
}
但是,这会产生错误Argument type'EventLoopFuture<Mission>' does not conform to expected type 'Database
所以我试图在我的一个Vapor端点中调用第二个端点。response.content.decode(ConnectionResponse.self) })它在flatMap上失败了,表示Cannot convert return expression of type'EventLoopFuture<ConnectionResponse>' to return type 'ConnectionResponse'。