Bad return type in lambda expression: AjaxResult cannot be converted to capture of ?

通过函数式编程,控制if...else...返回一个Result对象,报错Bad return type in lambda expression: AjaxResult cannot be converted to capture of ?

接口

img

工具类

img

使用

img

类型不匹配, AjaxResult 无法转换 , 发一下 Supplier的定义看看

换了个思路,虽然可以使用,但是需要强转
改动一

img

改动二

img