|
|
|
@ -15,6 +15,16 @@ router.get("/", async function (req, res, next) {
|
|
|
|
|
res.send(formatResponse(0, "", data));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
router.get("/:id", async function (req, res, next) {
|
|
|
|
|
const { id } = req.params;
|
|
|
|
|
const data = await getAddressByIdServices(id);
|
|
|
|
|
if (data) {
|
|
|
|
|
res.send(formatResponse(0, "", data));
|
|
|
|
|
} else {
|
|
|
|
|
res.send(formatResponse(1, "地址不存在", null));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
router.post("/", async function (req, res, next) {
|
|
|
|
|
console.log(req, res);
|
|
|
|
|
const data = await addAddressServices(req.body);
|
|
|
|
|