package com.hr.controller;

import com.alibaba.fastjson.JSONObject;
import com.hr.externelSystem.BizHandlerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

@RestController
@RequestMapping("/callback")
public class TestCallBackController {

    @Autowired
    private BizHandlerFactory bizHandlerFactory;

    @RequestMapping("/test")
    public Mono<Boolean> test(@RequestBody JSONObject json) {
        // 根据序列号查询到对应的业务id
        String businessNo = "aabbccddee";
        String interfaceNo = "aiwen";
        Boolean result = bizHandlerFactory.doCallBack(interfaceNo,businessNo,json);
        return Mono.just(result);

    }

}
