package com.aucma.api.controller;

import com.aucma.api.service.IPdaBindingService;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Optional;

import static com.aucma.common.core.domain.AjaxResult.error;
import static com.aucma.common.core.domain.AjaxResult.success;

/**
 * @author wanghao
 * @date 2023/11/14  9:28
 */
@RestController("/api")
public class PdaBindingController {

    @Autowired
    private IPdaBindingService service;

    //壳胆绑定-提交
    @PostMapping("/boxBanding")
    public AjaxResult binding(String boxCode,String innerCode,String loginName){
       String boxName = service.selectBoxNameByCode(boxCode);
       if (StringUtils.isNotNull(boxName)){
           service.insertBindingInfo(boxCode,boxName,innerCode);
         return success( ) ;
       }
        return error("箱壳条码扫描");
    }
    //条码绑定
}
