package com.jwipc.shopping.util;

import com.jwipc.shopping.model.vo.ExcelShopCartVO;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.util.StringUtil;

/**
 * 功能描述:
 *
 * @Author: zx
 * @Date: 2024/4/8 0008 17:01
 */
public class ExcelShopCartVOValidator {

    public static boolean validateData(ExcelShopCartVO data) {
        Boolean qtyFlag = isNumeric(data.getQty());
        Boolean costFlag = isNumeric(data.getProductPrice());

        // 在这里添加你的验证逻辑
        // 假设我们只是简单地检查某个字段是否为null
        return qtyFlag && costFlag;
    }

    public static boolean isNumeric(String str){
        String reg = "^[0-9]+(.[0-9]+)?$";
        return str.matches(reg);
    }


}
