pub.codex.apix.doc.DocDocument Maven / Gradle / Ivy
package pub.codex.apix.doc;
import pub.codex.apix.schema.ApiListing;
import pub.codex.apix.schema.Documentation;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
* 文档包装类
*/
public class DocDocument {
private List controller = new ArrayList<>();
public List getController() {
return controller;
}
public void setController(List controller) {
this.controller = controller;
}
public DocDocument(Documentation documentation) {
Set apiListings = documentation.getApiListings().keySet();
for (String apiListingsKey : apiListings) {
Collection collection = documentation.getApiListings().get(apiListingsKey);
collection.forEach(apiListing -> {
controller.add(new ControllerDocument(apiListingsKey, apiListing.getApis()));
});
}
}
}