package cn.pluss.platform.controller.merchant.callback;

import cn.pluss.platform.channel.MchMachineCallbackService;
import cn.pluss.platform.util.SxfConfg;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
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;

@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/machineCallback")
public class MachineCallbackController {

    private final MchMachineCallbackService sxfMchMachineCallbackService;

    @PostMapping("orderCallback")
    public JSONObject orderCallback(@RequestBody JSONObject param) {
        log.info("======随行付机具回调======");
        log.info(param.toJSONString());
        sxfMchMachineCallbackService.orderCallback(param);
        return SxfConfg.ok();
    }
}
