package com.clx.performance.controller.temp;

import com.clx.performance.dao.OrderChildDao;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.listener.OrderChildSyncTransportListener;
import com.clx.performance.model.OrderChild;
import com.msl.common.result.Result;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Author: aiqingguo
 * @Description: 临时接口
 * @Date: 2023-8-21 12:10:16
 * @Version: 1.0
 */
@Slf4j
@RestController
@RequestMapping(value="/temp/broker")
public class TempSettlementController {

    @Autowired
    private OrderChildDao orderChildDao;

    @Autowired
    private OrderChildSyncTransportListener orderChildSyncTransportListener;

    @ApiOperation(value = "test", notes = "<br>By:艾庆国")
    @RequestMapping(value = "/test", method = RequestMethod.GET)
    public Result test(String childNo) {

        OrderChild orderChild = orderChildDao.getByChildNo(childNo).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
        orderChildSyncTransportListener.transportOrderChildProcess(orderChild);

        return Result.ok();
    }

}
