 /*
  * 手太欠
  * 愿这世界都如故事里一样 美好而动人~
*/

import { req } from "../request"

// 收获地址（列表)
const siteList = () => req({
    url: "mall/addresses"
})

// 省市区-获取
const create = data => req({
    url: "mall/addresses/create",
    data: data
})

// 新增地址
const siteAdd = data => req({
    url: "mall/addresses",
    data: data,
    method: 'POST'
})

// 地址详细
const siteSee = (address) => req({
    url: "mall/addresses/" + address
})

// 编辑地址
const siteEdit = (address, data) => req({
    url: "mall/addresses/" + address,
    data: data,
    method: 'PUT'
})

// 删除地址
const siteDel = (address) => req({
    url: "mall/addresses/" + address,
    method: 'DELETE'
})

// 设置默认地址
const siteDefault = (address) => req({
    url: "mall/addresses/" + address + "/default",
    method: 'POST'
})

export default ({
    siteList,
    create,
    siteAdd,
    siteSee,
    siteEdit,
    siteDel,
    siteDefault
})