package com.sckw.payment.controller.operate;

import com.sckw.core.web.response.HttpResult;
import com.sckw.payment.model.constant.SettlementOrderTypeEnum;
import com.sckw.payment.model.vo.req.SettlementOfflineReq;
import com.sckw.payment.service.operate.SettlementOfflineService;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 结算-线下记录（交易订单结算/物流订单结算）
 *
 * @author xucaiqin
 * @date 2023-07-20 11:42
 */
@RestController
@RequestMapping("/settlementOffline")
public class SettlementOfflineController {

    @Resource
    private SettlementOfflineService settlementOfflineService;

    /**
     * 贸易-线下付款记录
     *
     * @param settlementOfflineReq
     * @return
     */
    @GetMapping("tradeList")
    public HttpResult list(@Valid SettlementOfflineReq settlementOfflineReq) {
        settlementOfflineReq.setOrderType(SettlementOrderTypeEnum.TRADE.getStatus());
        return HttpResult.ok(settlementOfflineService.list(settlementOfflineReq));
    }

    /**
     * 物流线下结算记录
     *
     * @param settlementOfflineReq
     * @return
     */
    @GetMapping("logisticsList")
    public HttpResult logisticsList(@Valid SettlementOfflineReq settlementOfflineReq) {
        settlementOfflineReq.setOrderType(SettlementOrderTypeEnum.LOGISTICS.getStatus());
        return HttpResult.ok(settlementOfflineService.list(settlementOfflineReq));
    }

}
