package cn.reghao.tnb.message.app.soa.controller;

import cn.reghao.tnb.common.web.WebResult;
import cn.reghao.tnb.message.app.soa.model.vo.RouteDefinitionInfo;
import cn.reghao.tnb.message.app.soa.service.RouteService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author reghao
 * @date 2025-04-16 10:37:14
 */
@Tag(name = "tnb 网关接口")
@RestController
@RequestMapping("/api/admin/tnb/gw")
public class TnbGatewayController {
    private final RouteService routeService;

    public TnbGatewayController(RouteService routeService) {
        this.routeService = routeService;
    }

    @Operation(summary = "网关路由")
    @GetMapping("/route")
    public String gatewayRoutePage() {
        List<RouteDefinitionInfo> routes = routeService.getRouteInfos();
        return WebResult.success(routes);
    }
}
