package com.huimv.environ.eco.controller;


import com.huimv.common.utils.Result;
import com.huimv.environ.eco.entity.EcoDevice;
import com.huimv.environ.eco.service.EcoDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
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.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zn
 * @since 2022-11-09
 */
@RestController
@RequestMapping("/ecoDevice")
public class EcoDeviceController {
    @Autowired
    private EcoDeviceService ecoDeviceService;
    @PostMapping("/add")
    public Result add(@RequestBody EcoDevice ecoDevice) {
        return ecoDeviceService.add(ecoDevice);
    }

    @PostMapping("/edit")
    public Result edit(@RequestBody EcoDevice ecoDevice) {
        return ecoDeviceService.edit(ecoDevice);
    }

    @PostMapping("/remove")
    public Result remove(@RequestBody Map<String,String> paramsMap) {
        return ecoDeviceService.remove(paramsMap);
    }

    @PostMapping("/list")
    public Result list(@RequestBody Map<String,String> paramsMap) {
        return ecoDeviceService.list(paramsMap);
    }
}

