const { getAddressDao, addAddressDao, updateAddressDao, deleteAddressDao, getAddressByIdDao, } = require("../dao/addressDao"); module.exports.getAddressServices = async function (senderId) { return await getAddressDao(senderId); }; module.exports.getAddressByIdServices = async function (id) { return await getAddressByIdDao(+id); }; module.exports.addAddressServices = async function (addressData) { console.log(addressData); // 确保isDefault是数字类型 const data = { ...addressData, isDefault: addressData.isDefault || 0, }; return await addAddressDao(data); }; module.exports.updateAddressServices = async function (addressData) { // 这里需要提供id return await updateAddressDao(addressData); }; module.exports.deleteAddressServices = async function ({ id }) { return await deleteAddressDao(id); };