mirror of
https://gitee.com/ssssssss-team/magic-api.git
synced 2026-06-20 04:27:37 +08:00
优化加载速度
This commit is contained in:
@@ -12,6 +12,7 @@ import org.ssssssss.magicapi.provider.ApiServiceProvider;
|
||||
import org.ssssssss.magicapi.provider.MagicAPIService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 接口相关操作
|
||||
@@ -47,7 +48,7 @@ public class MagicAPIController extends MagicController implements MagicExceptio
|
||||
@ResponseBody
|
||||
@Valid(authorization = Authorization.VIEW)
|
||||
public JsonBean<List<ApiInfo>> list() {
|
||||
return new JsonBean<>(magicAPIService.apiList());
|
||||
return new JsonBean<>(magicAPIService.apiList().stream().map(ApiInfo::simple).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -257,6 +257,15 @@ public class ApiInfo extends MagicEntity {
|
||||
this.responseBodyDefinition = responseBodyDefinition;
|
||||
}
|
||||
|
||||
public ApiInfo simple(){
|
||||
ApiInfo target = new ApiInfo();
|
||||
target.setId(this.getId());
|
||||
target.setName(this.getName());
|
||||
target.setGroupId(this.getGroupId());
|
||||
target.setPath(this.getPath());
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
||||
Reference in New Issue
Block a user