package com.xhpc.common.api;

import com.xhpc.common.api.factory.PileOrderFallbackFactory;
import com.xhpc.common.core.constant.ServiceNameConstants;
import com.xhpc.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 桩订单回调
 * @author yuyang
 * @date 2021/8/15 16:54
 */
@FeignClient(contextId ="pileOrderService",value = ServiceNameConstants.XHPC_ORDER, fallbackFactory = PileOrderFallbackFactory.class)
public interface PileOrderService {

    /**
     * 桩启动回调接口
     * @param orderNo  订单号
     * @param status   1 成功 2失败
     * @param remark   备注
     * @return
     */
    @GetMapping("/chargeOrder/pileStartup")
    R pileStartup(@RequestParam(value = "orderNo") String orderNo, @RequestParam(value = "status") Integer status, @RequestParam(value = "remark") String remark);

    /**
     * 桩停止回调接口
     *
     * @param orderNo 订单号
     * @param status  1 成功 2失败 3数据中断 4恢复数据
     * @param remark  备注
     * @return
     */
    @GetMapping("/chargeOrder/pileStop")
    R pileStop(@RequestParam(value = "orderNo") String orderNo, @RequestParam(value = "status") Integer status, @RequestParam(value = "remark") String remark);


    /**
     * 桩订单结束回调接口
     * @param orderNo  订单号
     * @return
     */
    @PostMapping("/chargeOrder/pileEndOrder")
    R pileEndOrder(@RequestParam(value = "orderNo") String orderNo);


    /**
     * 桩订单实时订单回调接口
     * @param orderNo  订单号
     * @return
     */
    @GetMapping("/chargeOrder/pileRimeOrder")
    R pileRimeOrder(@RequestParam(value = "orderNo") String orderNo);


    /**
     * 订单异常回调接口
     *
     * @param orderNo 订单号
     * @return
     */
    @GetMapping("/chargeOrder/abnormalOrder")
    R abnormalOrder(@RequestParam(value = "orderNo") String orderNo);


    @GetMapping(value = "/chargeOrder/pileStartUpBy3rd")
    R pileStartUpBy3rd(@RequestParam(value = "internetSerialNumber") String internetSerialNumber,
                       @RequestParam(value = "driverId", required = false) String driverId,
                       @RequestParam(value = "chargingAmt", required = false, defaultValue = "500") Integer chargingAmt,
                       @RequestParam(value = "plateNum", required = false) String plateNum,
                       @RequestParam(value = "status") Integer status,
                       @RequestParam(value = "connectorId") String connectorId);
}
