package vip.xiaonuo.coldchain.modular.qp.controller;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
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 vip.xiaonuo.coldchain.modular.qp.service.QPService;
import vip.xiaonuo.common.pojo.CommonResult;

@RestController
@RequestMapping("qp")
@Slf4j
public class QPController {

    @Resource
    private QPService qpService;


    @PostMapping("/save")
    public CommonResult<String> save(@RequestBody String param) {
        qpService.save(param);
        return CommonResult.ok();
    }


    /**
     * 事件推送
     */
    @PostMapping("/event")
    public CommonResult<String> triggerEvent(@RequestBody String param) {
        qpService.triggerEvent(param);
        return CommonResult.ok();
    }
}
