package com.fjhx.controller.check;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springblade.core.tool.api.R;
import com.fjhx.entity.check.CheckTag;
import com.fjhx.params.check.CheckTagVo;
import com.fjhx.service.check.CheckTagService;
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 ${author}
 * @since 2022-11-04
 */
@RestController
@RequestMapping("/checkTag")
public class CheckTagController {

    @Autowired
    private CheckTagService checkTagService;

    @PostMapping("/page")
    public R page(@RequestBody Map<String, String> condition){
        Page<CheckTag> result = checkTagService.getPage(condition);
        return R.success(result);
    }

    @PostMapping("/add")
    public R add(@RequestBody CheckTagVo checkTagVo){
        checkTagService.add(checkTagVo);
        return R.success();
    }

    @PostMapping("/edit")
    public R edit(@RequestBody CheckTagVo checkTagVo){
        checkTagService.edit(checkTagVo);
        return R.success();
    }

    @PostMapping("/delete")
    public R delete(@RequestBody CheckTagVo checkTagVo){
        checkTagService.delete(checkTagVo);
        return R.success();
    }

}

