package com.sz.admin.monitor.controller;

import com.sz.admin.monitor.pojo.po.ComputerRoom;
import com.sz.admin.monitor.service.ComputerRoomService;
import com.sz.core.common.entity.ApiResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Profile;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName: ComputerRootController
 * Package: com.sz.admin.monitor.controller
 * Description:
 */
@Tag(name = "机房表")
@RestController
@RequestMapping("computerRoom")
@RequiredArgsConstructor
@Profile({"dev", "local", "preview"})
public class ComputerRoomController {
    private final ComputerRoomService computerRoomService;
    @Operation(summary = "获取变电站下的机房列表")
    @GetMapping("/list")
    public ApiResult<List<ComputerRoom>> getList(@RequestParam("substationId") Long substationId) {
        return ApiResult.success(computerRoomService.getComputerRoomList(substationId));
    }
}
