package com.fjhx.controller.data;

import com.alibaba.fastjson.JSONObject;
import com.fjhx.base.Condition;
import com.fjhx.service.data.DataAutoclavesService;
import org.springblade.core.tool.api.R;
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 ${author}
 * @since 2022-11-22
 */
@RestController
@RequestMapping("/dataAutoclaves")
public class DataAutoclavesController {

    @Autowired
    private DataAutoclavesService dataAutoclavesService;

    @PostMapping("/add")
    public R add(@RequestBody JSONObject json) {
        boolean flag = dataAutoclavesService.add(json);
        return R.success(flag);
    }

    @PostMapping("/getData")
    public R getData(@RequestBody Condition condition) {
        JSONObject result = dataAutoclavesService.getData(condition);
        return R.success(result);
    }

}
