mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-09 17:34:50 +08:00
返回新实体
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package org.hswebframework.web.system.authorization.defaults.webflux;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hswebframework.web.authorization.DimensionType;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor(staticName = "of")
|
||||
@NoArgsConstructor
|
||||
public class DimensionTypeResponse {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
public static DimensionTypeResponse of(DimensionType type) {
|
||||
return of(type.getId(), type.getName());
|
||||
}
|
||||
}
|
||||
@@ -35,9 +35,10 @@ public class WebFluxDimensionTypeController implements ReactiveCrudController<Di
|
||||
|
||||
@GetMapping("/all")
|
||||
@QueryAction
|
||||
public Flux<DimensionType> findAllType() {
|
||||
public Flux<DimensionTypeResponse> findAllType() {
|
||||
return Flux.fromIterable(dimensionProviders)
|
||||
.flatMap(DimensionProvider::getAllType);
|
||||
.flatMap(DimensionProvider::getAllType)
|
||||
.map(DimensionTypeResponse::of);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user