package com.ruoyi.web.controller.coffee;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.impl.MachineApiServiceImpl;
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;

@RestController
@RequestMapping("/v1")
public class MachineApiController {
    @Autowired
    private MachineApiServiceImpl machineApiService;
    @PostMapping("/down/material/update")
    public AjaxResult shopGoodsUpdate(@RequestBody String body){
        JSONObject jsonObject = JSONObject.parseObject(body);
        return AjaxResult.success(machineApiService.shopGoodsUpdate(jsonObject));
    }
    @PostMapping("/down/order/update")
    public AjaxResult updateOrder(@RequestBody String body){
        JSONObject jsonObject = JSONObject.parseObject(body);
        return AjaxResult.success(machineApiService.updateOrder(jsonObject));
    }
    @PostMapping("/down/robot/status")
    public AjaxResult robotUpdate(@RequestBody String body){
        return null;

    }
}
