package com.hdkj.lt.bf.controller;

import com.hdkj.lt.bf.aspect.RequiresCountryPermissions;
import com.hdkj.lt.bf.entity.dto.XlRelDTO;
import com.hdkj.lt.bf.entity.vo.XlRelVO;
import com.hdkj.lt.bf.service.IXlRelService;
import com.hdkj.hussar.ApiResponse;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 线路与线路关系多对多 前端控制器
 * </p>
 *
 * @author luorui
 * @since 2025-07-25
 */

@RestController
@RequestMapping("/xl-rel")
@RequiredArgsConstructor
public class XlRelController {

    private final IXlRelService xlRelService;

    /**
     * 根据线路查询联络开关列表
     * @param
     * @return
     */
    @PostMapping("/getContactSwitchListByFeeder")
    @ApiOperation(value = "根据线路查询联络开关列表")
    @RequiresCountryPermissions(lineFields = "lineId")
    public ApiResponse<List<XlRelVO>> getContactSwitchListByFeeder(@RequestBody XlRelDTO xlRelDTO) {
        List<XlRelVO> relVOList = xlRelService.getContactSwitchListByFeeder(xlRelDTO);
        return ApiResponse.success(relVOList);
    }


}
