package com.sckw.contract.controller;

import com.sckw.contract.model.vo.req.ContractDetailReq;
import com.sckw.contract.model.vo.req.LogisticListReq;
import com.sckw.contract.model.vo.req.QueryLogisticListReq;
import com.sckw.contract.model.vo.res.QueryLogisticDetailResp;
import com.sckw.contract.model.vo.res.QueryLogisticListResp;
import com.sckw.contract.service.operateService.KwcContractLogisticsService;
import com.sckw.core.web.response.BaseResult;
import com.sckw.core.web.response.result.PageDataResult;
import lombok.RequiredArgsConstructor;
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;

/**
 * @author :chenXiaoFei
 * @version :1.0
 * @description : 物流合同相关接口
 * @create :2025-11-06 09:34:00
 */
@RestController
@RequestMapping("logisticsContract")
@RequiredArgsConstructor
public class KwcLogisticsContractController {
    private final KwcContractLogisticsService kwcContractLogisticsService;

    /**
     * @desc: 分页查询
     * @param: reqVo 分页入参
     * @author: sky
     * @date 2023/7/13
     * @return HttpResult
     */
    @PostMapping("/queryListByPage")
    public BaseResult<PageDataResult<QueryLogisticListResp>> queryListByPage(@RequestBody QueryLogisticListReq req) {
        return BaseResult.success(kwcContractLogisticsService.queryLogisticsContractListByPage(req));
    }
    /**
     * 新增物流合同
     */
    @PostMapping("/addOrUpdateLogisticsContract")
    public BaseResult<Boolean> addOrUpdateLogisticsContract(@RequestBody LogisticListReq req) {
        return BaseResult.success(kwcContractLogisticsService.addOrUpdateLogisticsContract(req));
    }

    /**
     * 查询物流合同明细
     */
    @PostMapping("/queryLogisticsContractDetail")
    public BaseResult<QueryLogisticDetailResp> queryLogisticsContractDetail(@RequestBody ContractDetailReq req) {
       return BaseResult.success(kwcContractLogisticsService.queryLogisticsContractDetail(req)) ;
    }
}
