package com.jwipc.order.api.controller;

import com.jwipc.log.annotation.ApiOperateLog;
import com.jwipc.log.constant.ApiDirection;
import com.jwipc.log.constant.ThirdSysType;
import com.jwipc.order.api.dto.BarcodePrinterRestDTO;
import com.jwipc.order.api.dto.SupplierPrintParamDTO;
import com.jwipc.order.api.logic.BarcodePrinterLogic;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
@RestController
@RequestMapping("/third/api/barcode/")
@RequiredArgsConstructor
@Slf4j
public class BarcodePrinterApiController {
    private final BarcodePrinterLogic barcodePrinterLogic;

    @PostMapping("/print")
    @ApiOperateLog(code = "print",name = "供应商条码打印", direction = ApiDirection.OTHER_TO_SRM, thirdSysType = ThirdSysType.OA)
    public BarcodePrinterRestDTO print(@RequestBody SupplierPrintParamDTO supplierPrintParamDTO) {
        BarcodePrinterRestDTO restDTO = barcodePrinterLogic.print(supplierPrintParamDTO);
        return restDTO;
    }
}
