package com.jwipc.inquiry.controller;

import com.jwipc.api.dto.ApiResult;
import com.jwipc.inquiry.dto.PurchaseApplyBillApiDTO;
import com.jwipc.inquiry.logic.PurchaseApplyBillApiLogic;
import com.jwipc.log.annotation.ApiOperateLog;
import com.jwipc.log.constant.ApiDirection;
import com.jwipc.log.constant.ThirdSysType;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
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;

import javax.validation.Valid;
import java.util.List;

/**
 * @author shenyang.ou
 * @date 2024/3/27 11:14
 * @desc
 */
@RestController
@RequestMapping( "/oa/api/purchase/apply")
@RequiredArgsConstructor
@Validated
public class PurchaseApplyBillApiController {
    private final PurchaseApplyBillApiLogic purchaseApplyBillApiLogic;

    /**
     * OA采购申请数据同步SRM
     * @param param 参数
     */
    @PostMapping("/sync")
    @ApiOperateLog(code = "purchaseApplySync",name = "OA采购申请数据同步SRM", direction = ApiDirection.OTHER_TO_SRM, thirdSysType = ThirdSysType.OA)
    public ApiResult sync(@Valid @RequestBody List<PurchaseApplyBillApiDTO> param){
        return purchaseApplyBillApiLogic.sync(param);
    }
}
