Search in sources :

Example 1 with UnitMdBuilderHandler

use of info.xiancloud.apidoc.handler.UnitMdBuilderHandler in project xian by happyyangyuan.

the class AbstractMdApidocUnit method specifyBuild.

/**
 * 返回生成MD的文件字符串
 */
private static String specifyBuild(String description, String docName, IUnitFilter filter) {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    ApiBuilder.build(new UnitMdBuilderHandler(description, docName, filter).callback(data -> {
        try {
            bos.write(data);
            if (data.length > 0) {
                LOG.info("api-doc接口文档unit文档大小 : " + data.length);
                LOG.info("api-doc接口文档unit发布成功");
            } else {
                LOG.info("api-doc接口文档unit暂无扫描到相关数据");
            }
        } catch (Exception e) {
            LOG.error("api-doc接口文档生成unit接口文档出错", e);
        }
    }));
    return bos.toString();
}
Also used : ApiBuilder(info.xiancloud.apidoc.ApiBuilder) Group(info.xiancloud.core.Group) Unit(info.xiancloud.core.Unit) Input(info.xiancloud.core.Input) ByteArrayOutputStream(java.io.ByteArrayOutputStream) UnitRequest(info.xiancloud.core.message.UnitRequest) UnitMdBuilderHandler(info.xiancloud.apidoc.handler.UnitMdBuilderHandler) IUnitFilter(info.xiancloud.apidoc.handler.filter.IUnitFilter) UnitResponse(info.xiancloud.core.message.UnitResponse) LOG(info.xiancloud.core.util.LOG) ApidocGroup(info.xiancloud.apidoc.ApidocGroup) UnitMeta(info.xiancloud.core.UnitMeta) ByteArrayOutputStream(java.io.ByteArrayOutputStream) UnitMdBuilderHandler(info.xiancloud.apidoc.handler.UnitMdBuilderHandler)

Aggregations

ApiBuilder (info.xiancloud.apidoc.ApiBuilder)1 ApidocGroup (info.xiancloud.apidoc.ApidocGroup)1 UnitMdBuilderHandler (info.xiancloud.apidoc.handler.UnitMdBuilderHandler)1 IUnitFilter (info.xiancloud.apidoc.handler.filter.IUnitFilter)1 Group (info.xiancloud.core.Group)1 Input (info.xiancloud.core.Input)1 Unit (info.xiancloud.core.Unit)1 UnitMeta (info.xiancloud.core.UnitMeta)1 UnitRequest (info.xiancloud.core.message.UnitRequest)1 UnitResponse (info.xiancloud.core.message.UnitResponse)1 LOG (info.xiancloud.core.util.LOG)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1