package com.fjhx.jushuitan.controller.jushuitan;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.jushuitan.entity.jushuitan.dto.JushuitanConfigDto;
import com.fjhx.jushuitan.entity.jushuitan.dto.JushuitanConfigSelectDto;
import com.fjhx.jushuitan.entity.jushuitan.vo.JushuitanConfigVo;
import com.fjhx.jushuitan.service.jushuitan.JushuitanConfigService;
import com.ruoyi.common.core.domain.BaseSelectDto;
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;


/**
 * <p>
 * 聚水潭配置 前端控制器
 * </p>
 *
 * @author
 * @since 2024-01-18
 */
@RestController
@RequestMapping("/jushuitanConfig")
public class JushuitanConfigController {

    @Autowired
    private JushuitanConfigService jushuitanConfigService;

    /**
     * 聚水潭配置分页
     */
    @PostMapping("/page")
    public Page<JushuitanConfigVo> page(@RequestBody JushuitanConfigSelectDto dto) {
        return jushuitanConfigService.getPage(dto);
    }

    /**
     * 聚水潭配置明细
     */
    @PostMapping("/detail")
    public JushuitanConfigVo detail(@RequestBody BaseSelectDto dto) {
        return jushuitanConfigService.detail(dto.getId());
    }

    /**
     * 聚水潭配置新增
     */
    @PostMapping("/add")
    public void add(@RequestBody JushuitanConfigDto jushuitanConfigDto) {
        jushuitanConfigService.add(jushuitanConfigDto);
    }

    /**
     * 聚水潭配置编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody JushuitanConfigDto jushuitanConfigDto) {
        jushuitanConfigService.edit(jushuitanConfigDto);
    }

    /**
     * 聚水潭配置删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        jushuitanConfigService.delete(dto.getId());
    }

}
