public StringBuilder adminQueryTopicAuthControl(HttpServletRequest req,
            StringBuilder sBuffer,
            ProcessResult result) {
        TopicCtrlEntity qryEntity = new TopicCtrlEntity();
        // get queried operation info, for createUser, modifyUser, dataVersionId
        if (!WebParameterUtils.getQueriedOperateInfo(req, qryEntity, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        // check and get topicName field
        if (!WebParameterUtils.getStringParamValue(req,
                WebFieldDef.COMPSTOPICNAME, false, null, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        Set<String> topicNameSet = (Set<String>) result.getRetData();
        // query matched records
        Map<String, TopicCtrlEntity> topicCtrlMap =
                defMetaDataService.getTopicCtrlConf(topicNameSet, qryEntity);
        // build query result
        int totalCnt = 0;
        WebParameterUtils.buildSuccessWithDataRetBegin(sBuffer);
        for (TopicCtrlEntity entity : topicCtrlMap.values()) {
            if (totalCnt++ > 0) {
                sBuffer.append(",");
            }
            sBuffer.append("{\"topicName\":\"").append(entity.getTopicName())
                    .append("\",\"isEnable\":").append(entity.isAuthCtrlEnable())
                    .append(",\"createUser\":\"").append(entity.getCreateUser())
                    .append("\",\"createDate\":\"").append(entity.getCreateDateStr())
                    .append("\",\"modifyUser\":\"").append(entity.getModifyUser())
                    .append("\",\"modifyDate\":\"").append(entity.getModifyDateStr())
                    .append("\",\"authConsumeGroup\":[");
            List<GroupConsumeCtrlEntity> groupEntity =
                    defMetaDataService.getConsumeCtrlByTopic(entity.getTopicName());
            int j = 0;
            if (!groupEntity.isEmpty()) {
                for (GroupConsumeCtrlEntity itemEntity : groupEntity) {
                    if (j++ > 0) {
                        sBuffer.append(",");
                    }
                    sBuffer.append("{\"topicName\":\"").append(itemEntity.getTopicName())
                            .append("\",\"groupName\":\"").append(itemEntity.getGroupName())
                            .append("\",\"createUser\":\"").append(itemEntity.getCreateUser())
                            .append("\",\"createDate\":\"").append(itemEntity.getCreateDateStr())
                            .append("\",\"modifyUser\":\"").append(itemEntity.getModifyUser())
                            .append("\",\"modifyDate\":\"").append(itemEntity.getModifyDateStr())
                            .append("\"}");
                }
            }
            sBuffer.append("],\"groupCount\":").append(j).append(",\"authFilterCondSet\":[");
            int y = 0;
            for (GroupConsumeCtrlEntity condEntity : groupEntity) {
                if (y++ > 0) {
                    sBuffer.append(",");
                }
                int condStatusId = condEntity.isEnableFilterConsume() ? 2 : 0;
                sBuffer.append("{\"topicName\":\"").append(condEntity.getTopicName())
                        .append("\",\"groupName\":\"").append(condEntity.getGroupName())
                        .append("\",\"condStatus\":").append(condStatusId);
                if (condEntity.getFilterCondStr().length() <= 2) {
                    sBuffer.append(",\"filterConds\":\"\"");
                } else {
                    sBuffer.append(",\"filterConds\":\"")
                            .append(condEntity.getFilterCondStr())
                            .append("\"");
                }
                sBuffer.append(",\"createUser\":\"").append(condEntity.getCreateUser())
                        .append("\",\"createDate\":\"").append(condEntity.getCreateDateStr())
                        .append("\",\"modifyUser\":\"").append(condEntity.getModifyUser())
                        .append("\",\"modifyDate\":\"").append(condEntity.getModifyDateStr())
                        .append("\"}");
            }
            sBuffer.append("],\"filterCount\":").append(y).append("}");
        }
        WebParameterUtils.buildSuccessWithDataRetEnd(sBuffer, totalCnt);
        return sBuffer;
    }
Query topic authorization control

@param req       Http Servlet Request
@param sBuffer   string buffer
@param result    process result
@return    process result
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/master/web/handler/WebAdminTopicAuthHandler.java