package com.jwipc.order.api.controller;

import com.jwipc.api.dto.ApiResult;
import com.jwipc.log.annotation.ApiOperateLog;
import com.jwipc.log.constant.ApiDirection;
import com.jwipc.log.constant.ThirdSysType;
import com.jwipc.order.api.logic.PurchaseOrderBomApiLogic;
import com.jwipc.order.api.dto.PurchaseOrderBomItemDTO;
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;

@RestController
@RequestMapping( "/sap/api/purchaseOrderBom")
@RequiredArgsConstructor
public class PurchaseOrderBomApiController {

    private final PurchaseOrderBomApiLogic purchaseOrderBomApiLogic;
    /**
     * 保存更新
     * @param param 参数
     */
    @PostMapping("saveOrUpdate")
    @ApiOperateLog(code = "purchaseOrderBomSaveOrUpdate",name = "套件关系数据同步", direction = ApiDirection.OTHER_TO_SRM, thirdSysType = ThirdSysType.SAP)
    public ApiResult saveOrUpdate(@RequestBody PurchaseOrderBomItemDTO param){
        return purchaseOrderBomApiLogic.saveOrUpdate(param);
    }

}
