package com.lanyuanxiaoyao.service.forest.service;

import com.dtflys.forest.annotation.BaseRequest;
import com.dtflys.forest.annotation.Get;
import com.dtflys.forest.annotation.Query;
import com.lanyuanxiaoyao.service.configuration.entity.pulsar.PulsarNamespace;
import com.lanyuanxiaoyao.service.configuration.entity.pulsar.PulsarTenant;
import com.lanyuanxiaoyao.service.configuration.entity.pulsar.PulsarTopic;
import org.eclipse.collections.api.list.ImmutableList;

/**
 * Pulsar
 *
 * @author lanyuanxiaoyao
 * @date 2023-04-28
 */
@BaseRequest(baseURL = "http://service-pulsar-query")
public interface PulsarService {
    @Get("/pulsar/name")
    String name(@Query("pulsar_url") String pulsarUrl);

    @Get("/pulsar/names")
    ImmutableList<String> names();

    @Get("/pulsar/tenants")
    ImmutableList<PulsarTenant> tenants(@Query("name") String name);

    @Get("/pulsar/namespaces")
    ImmutableList<PulsarNamespace> namespaces(@Query("name") String name, @Query("tenant") String tenant);

    @Get("/pulsar/topic")
    PulsarTopic topic(@Query("name") String name, @Query("topic") String topic);

    @Get("/pulsar/topics")
    ImmutableList<PulsarTopic> topics(@Query("name") String name, @Query("namespace") String namespace);
}
