Search in sources :

Example 1 with IUnitFilter

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

the class CustomizedMdApidocUnit method getFilter.

@Override
protected IUnitFilter getFilter(UnitRequest msg) {
    IUnitFilter filter = new FilterByUnits();
    String unitFilter = msg.getString("unitFilter");
    if (!StringUtil.isEmpty(unitFilter)) {
        String[] fullNameArr = unitFilter.split(",");
        filter.setValues(Arrays.asList(fullNameArr));
    }
    return filter;
}
Also used : FilterByUnits(info.xiancloud.apidoc.handler.filter.FilterByUnits) IUnitFilter(info.xiancloud.apidoc.handler.filter.IUnitFilter)

Example 2 with IUnitFilter

use of info.xiancloud.apidoc.handler.filter.IUnitFilter 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)

Example 3 with IUnitFilter

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

the class GroupMdApidocUnit method getFilter.

@Override
protected IUnitFilter getFilter(UnitRequest request) {
    IUnitFilter filter = new FilterByGroups();
    filter.setValues(new ArrayList<String>() {

        {
            add(request.getString("groupName"));
        }
    });
    return filter;
}
Also used : IUnitFilter(info.xiancloud.apidoc.handler.filter.IUnitFilter) FilterByGroups(info.xiancloud.apidoc.handler.filter.FilterByGroups)

Aggregations

IUnitFilter (info.xiancloud.apidoc.handler.filter.IUnitFilter)3 ApiBuilder (info.xiancloud.apidoc.ApiBuilder)1 ApidocGroup (info.xiancloud.apidoc.ApidocGroup)1 UnitMdBuilderHandler (info.xiancloud.apidoc.handler.UnitMdBuilderHandler)1 FilterByGroups (info.xiancloud.apidoc.handler.filter.FilterByGroups)1 FilterByUnits (info.xiancloud.apidoc.handler.filter.FilterByUnits)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