package com.huimv.environ.eco.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huimv.common.utils.Result;
import com.huimv.common.utils.ResultCode;
import com.huimv.environ.eco.entity.BaseTelecomRoom;
import com.huimv.environ.eco.service.IBaseTelecomRoomService;
import org.springframework.beans.factory.annotation.Autowired;
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;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author astupidcoder
 * @since 2021-11-23
 */
@RestController
@RequestMapping("/baseTelecomRoom")
public class BaseTelecomRoomController {

    @Autowired
    private IBaseTelecomRoomService baseTelecomRoomService;

    @GetMapping("/list")
    public Result list(@RequestParam(name = "farmId") Integer farmId){
        List<BaseTelecomRoom> baseTelecomRooms = baseTelecomRoomService.list(new QueryWrapper<BaseTelecomRoom>().eq("farm_id", farmId));
        return new Result(ResultCode.SUCCESS,baseTelecomRooms);
    }

}
