You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
uml-task/services/addressService.js

30 lines
716 B

const {
getAddressDao,
addAddressDao,
updateAddressDao,
deleteAddressDao,
} = require("../dao/addressDao");
module.exports.getAddressServices = async function () {
return await getAddressDao();
};
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);
};