import { mysqlModelMap} from "../db/sqlModelBind";

/**
 * 添加数据
 * @param tableModel 
 * @param data 
 * @returns 
 */
export async function addData(tableEnumValue:string, data:any) {
    let dataArray = [];
    if (!Array.isArray(data)) {
        dataArray.push(data);
    } else dataArray = data;
    
    await mysqlModelMap[tableEnumValue].bulkCreate(dataArray);
}