package cn.skcks.docking.gb28181.wvp.api.gb28181;

import cn.skcks.docking.gb28181.annotation.web.JsonMapping;
import cn.skcks.docking.gb28181.annotation.web.methods.GetJson;
import cn.skcks.docking.gb28181.common.json.JsonResponse;
import cn.skcks.docking.gb28181.wvp.config.SwaggerConfig;
import cn.skcks.docking.gb28181.wvp.service.catalog.CatalogService;
import lombok.RequiredArgsConstructor;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequiredArgsConstructor
@RestController
@JsonMapping("/gb28181")
public class Gb28181Controller {
    private final CatalogService catalogService;
    @Bean
    public GroupedOpenApi gb28181Api() {
        return SwaggerConfig.api("Gb28181Api", "/gb28181");
    }

    @GetJson("/catalog")
    public JsonResponse<Void> catalog(@RequestParam("gbDeviceId") String id){
        catalogService.getCatalog(id);
        return JsonResponse.success(null);
    }
}
