package com.flossom.system.controller;


import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.WxInstrumentNameRelate;
import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.flossom.system.service.IWxInstrumentNameRelateService;


/**
 * 仪器关联正品控产品名Controller
 *
 * @author flossom
 * @date 2024-01-15
 */
@RestController
@RequestMapping("/instrumentRelateName")
public class WxInstrumentNameRelateController extends BaseController {

    @Autowired
    private IWxInstrumentNameRelateService wxInstrumentNameRelateService;

    @GetMapping("/list")
    public R list(WxInstrumentNameRelate wxInstrumentNameRelate) {
        return R.ok(wxInstrumentNameRelateService.selectWxInstrumentNameRelateList(wxInstrumentNameRelate));
    }

    @PostMapping
    public AjaxResult add(@RequestBody WxInstrumentNameRelate wxInstrumentNameRelate) {
        return toAjax(wxInstrumentNameRelateService.insertWxInstrumentNameRelate(wxInstrumentNameRelate));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody WxInstrumentNameRelate wxInstrumentNameRelate) {
        return toAjax(wxInstrumentNameRelateService.updateWxInstrumentNameRelate(wxInstrumentNameRelate));
    }

    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(wxInstrumentNameRelateService.deleteWxInstrumentNameRelateByIds(ids));
    }

}
