package com.huimv.eartag2.admin.controller;


import com.huimv.eartag2.admin.service.BaseFarmService;
import com.huimv.eartag2.common.utils.Result;
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 javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zn
 * @since 2022-11-09
 */
@RestController
@RequestMapping("/base-farm")
public class BaseFarmController {
    @Resource
    private BaseFarmService baseFarmService;

    /**
     * @description: 【增加】
     * @author: 静静
     * @param: maps
     **/
    @PostMapping("/add")
    public Result addConfig(@RequestBody Map<String, String> maps){
        return baseFarmService.add(maps);
    }

    /**
     * @description: 【删除】
     * @author: 静静
     * @param: ids
     **/
    @PostMapping("/remove")
    public Result removeConfig(@RequestBody String ids){
        return baseFarmService.remove(ids);
    }

    /**
     * @description: 【修改】
     * @author: 静静
     * @param: maps
     **/
    @PostMapping("/update")
    public Result updateConfig(@RequestBody  Map<String, String> maps){
        return baseFarmService.update(maps);
    }
    /**
     * @description: 【查询】 分页查询配置表
     * @author: 静静
     * @param: paramsMap
     **/
    @PostMapping("/list")
    public Result list(@RequestBody Map<String,String> paramsMap){
        return baseFarmService.list(paramsMap);
    }
}

