package com.ruoyi.frequency.malladdress.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.controller.req.AddressInsertReq;
import com.ruoyi.controller.req.AddressUpdateReq;
import com.ruoyi.frequency.malladdress.entity.MallAddress;
import com.ruoyi.response.ResponseData;
import com.ruoyi.vo.PageBasic;
import com.ruoyi.vo.UserVo;

import java.util.List;

/**
 * 地址Service接口
 *
 * @author liwenlong
 * @date 2024-01-25
 */
public interface MallAddressService extends IService<MallAddress>
{
    /**
     * 查询地址
     *
     * @param id 地址主键
     * @return 地址
     */
    public MallAddress selectMallAddressById(Long id);

    /**
     * 查询地址列表
     *
     * @param mallAddress 地址
     * @return 地址集合
     */
    public List<MallAddress> selectMallAddressList(MallAddress mallAddress);

    /**
     * 新增地址
     *
     * @param mallAddress 地址
     * @return 结果
     */
    public int insertMallAddress(MallAddress mallAddress);

    /**
     * 修改地址
     *
     * @param mallAddress 地址
     * @return 结果
     */
    public int updateMallAddress(MallAddress mallAddress);

    /**
     * 批量删除地址
     *
     * @param ids 需要删除的地址主键集合
     * @return 结果
     */
    public int deleteMallAddressByIds(Long[] ids,Integer delFlag);

    /**
     *
     * @param user
     * @param page
     * @return
     */
    ResponseData addressPage(UserVo user, PageBasic page);

    ResponseData insertAddress(AddressInsertReq addressInsertReq, UserVo userVo);

    ResponseData updateAddress(AddressUpdateReq addressUpdateReq, UserVo userVo);

    ResponseData setDefault(Long id);

    ResponseData deleteAddressById(List<Long> ids,UserVo userVo);

    ResponseData getDefaultAddress(UserVo userVo);
}
