package com.muyu.server.controller;

import com.muyu.common.core.domain.Result;
import com.muyu.domain.CarFenceGroup;
import com.muyu.server.service.CarMiddleGroupService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 围栏及围栏组控制层
 * @Author：yang
 * @Package：com.muyu.server.controller
 * @Project：cloud-server-8
 * @name：CarFenceGroupController
 * @Date：2024/9/23 1:12
 */
@RequestMapping("/CarFenceGroup")
@RestController
@AllArgsConstructor
@Tag(name = "查询数据",description = "从中间表中查询数据")
@Log4j2
public class CarFenceGroupController {

    private final CarMiddleGroupService carMiddleGroupService;

    /**
     * 查询围栏信息
     */
    @PostMapping("/selectCarMiddleGroup")
    @Operation(summary = "查询数据",description = "查询数据")
    public Result<List<CarFenceGroup>> selectConnect(){
        List<CarFenceGroup> connects = carMiddleGroupService.selectCarFence();
        return Result.success(
                connects, "操作成功"
        );
    }

}
