package com.ruoyi.mall.service;

import java.util.List;
import java.util.Map;

import com.github.pagehelper.PageInfo;
import com.ruoyi.common.utils.ApiResult;
import com.ruoyi.mall.domain.MallMemberCoupon;
import com.ruoyi.mall.domain.MallMemberUser;
import com.ruoyi.mall.domain.vo.IndexGoodsVO;
import com.ruoyi.mall.domain.vo.MemberCollectVO;
import com.ruoyi.mall.domain.vo.MemberUserVO;

/**
 * 会员Service接口
 *
 * @author ruoyi
 * @date 2021-11-25
 */
public interface IMallMemberUserService
{
    /**
     * 查询会员
     *
     * @param id 会员主键
     * @return 会员
     */
    public MallMemberUser selectMallMemberUserById(Long id);

    /**
     *
     * @param openid
     * @return
     */
    public MallMemberUser queryByOpenid(String openid);
    public MallMemberUser queryByPhone(String phone);

    /**
     * 查询会员列表
     *
     * @param mallMemberUser 会员
     * @return 会员集合
     */
    public List<MallMemberUser> selectMallMemberUserList(MallMemberUser mallMemberUser);

    /**
     * 新增会员
     *
     * @param mallMemberUser 会员
     * @return 结果
     */
    public int insertMallMemberUser(MallMemberUser mallMemberUser);


    /**
     * 修改会员
     *
     * @param mallMemberUser 会员
     * @return 结果
     */
    public int updateMallMemberUser(MallMemberUser mallMemberUser);

    /**
     * 批量删除会员
     *
     * @param ids 需要删除的会员主键集合
     * @return 结果
     */
    public int deleteMallMemberUserByIds(Long[] ids);

    /**
     * 删除会员信息
     *
     * @param id 会员主键
     * @return 结果
     */
    public int deleteMallMemberUserById(Long id);

    public MemberUserVO selectMemberVOUserById(Long l);

    /*
    * 查询收藏个数
    * */
    public int selectCollectCount(Map<String, Object> params);

    /*
    * 收藏
    * */
    public void insertMemberGoods(MemberCollectVO memberGoods);

    /*
    * 取消收藏
    * */
    public void deleteMemberGoodsByParam(Map<String, Object> params);

    /*
    * 查看收藏列表
    * */
    public PageInfo<IndexGoodsVO> queryByUserId(Map<String, Object> params);

    /*
     * 查看足迹
     * */
    public PageInfo<IndexGoodsVO> queryFoodMarkByUserId(Map<String, Object> params);

    /*
     * 插入足迹
     * */
    public void insertIntoFoodMarkBD(Map<String, Object> params);

    public MemberCollectVO selectIsCollectBy(MemberCollectVO collectVO);

    public Map<String,Object> checkUserCoupon(Long userId, String couponId);

    public void insertUserCoupon(MallMemberCoupon memberCoupon);

    public List<Map<String,Object>> getMyCoupons(Long userId);

    //查看优惠券是否可用
    public Map<String,Object> checkCouponUsed(String couponId, Long userId);

    //修改优惠券状态为使用
    public void updateCouponUsed(String couponId, Long userId);

    Map<String,Object> getMyRecordCount(Long userId);
}
