This commit is contained in:
@@ -103,7 +103,7 @@ public class RetResult<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将RetResult<X> 转换成 RetResult<Y>
|
* 将RetResult<X> 转换成一个新的 RetResult<Y>
|
||||||
*
|
*
|
||||||
* @param <R> 目标数据类型
|
* @param <R> 目标数据类型
|
||||||
* @param mapper 转换函数
|
* @param mapper 转换函数
|
||||||
@@ -113,7 +113,7 @@ public class RetResult<T> {
|
|||||||
* @since 2.1.0
|
* @since 2.1.0
|
||||||
*/
|
*/
|
||||||
public <R> RetResult<R> mapTo(Function<T, R> mapper) {
|
public <R> RetResult<R> mapTo(Function<T, R> mapper) {
|
||||||
return new RetResult<>(mapper.apply(this.result));
|
return new RetResult<>(mapper.apply(this.result)).retcode(this.retcode).retinfo(this.retinfo).attach(this.attach);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user