package com.sptg.estate.biz.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.estate.api.dto.MemberDto;
import com.sptg.estate.api.entity.Member;
import com.sptg.estate.api.entity.MemberLoginStatus;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

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

/**
 * title: MemberServiceInterface
 * package: com.sptg.estate.biz.security
 * description: 会员  服务层接口
 *
 *               
 *                
 */
public interface MemberServiceInterface extends IService<Member> {
    /**
     * 功能描述:根据openid获取会员信息
     * @param  memberDto
     * @return 
     *               
     *                      
     */
    ResultBean<Member> getMemberByOpenid(MemberDto memberDto);

    /**
     * 功能描述:根据Id获取会员信息
     * @param  memberDto
     * @return
     *
     *
     */
    ResultBean<Member> getMemberById(MemberDto memberDto);
    /**
     * 功能描述:会员注册
     * @param member
     * @return
     *               
     *                      
     */
    ResultBean<Boolean> memberRegister(Member member);
    /**
     * 功能描述:检测同一机构下面一个手机号码只能注册一个会员
     * @param
     * @return
     *               
     *                      
     */
    ResultBean<Boolean> checkMemberTel(Member member);
    /**
     * 功能描述:小程序端openid关联到指定会员--orgid和phone和name
     * @param  member
     * @return
     *               
     *                      
     */
    ResultBean<Boolean> updateMemberOpenId(Member member);

    /**
     * 功能描述:根据位置查询会员数量
     * @param memberDto
     * {
     *    orgPosition : 位置信息
     *    isAllType : 查询类型
     * }
     * @return int
     *             
     *                      
     */
    int getMemberAccount(MemberDto memberDto);

    /**
     * 功能描述:根据类型获取会员的数量
     * @param memberDto
     * @return ResultBean<Map<String,Object>>
     *             
     *                      
     */
    ResultBean<Map<String,Object>> getMemberTypeCount(MemberDto memberDto);

    /**
     * 功能描述:重置会员密码
     * @param member
     * @return ResultBean<Map<String,Object>>
     *               
     *                      
     */
    ResultBean<Boolean> updateMemberPassword(Member member);

    /**
     * 功能描述:根据电话查询当前机构下的会员
     * @param member
     * @return Member
     *               
     *                      
     */
    Member findMemberByTel(Member member);

    /**
     * 功能描述:查询会员列表
     * @param memberDto
     * @return Member
     *               
     *                      
     */
    Page<Member> showMemberList(MemberDto memberDto);

    /**
     * 功能描述:会员注册--特殊
     * @param member
     * @return
     *               
     *                      
     */
    ResultBean<Member> memberRegisterNew(Member member);
    /**
     * 功能描述:后台新增住户的时候-去匹配一次会员
     * @param name
     * @param tel
     * @return
     *
     *
     */
    List<Member> findMemberByNameAndTel(String name, String tel);

    /**
     * 功能描述:更换绑定手机
     * @param member
     * @return
     */
    ResultBean<Boolean> changeTel(Member member);

    /**
     * 更新用户信息
     * @param member
     * @return
     */
    ResultBean<Boolean> updateMember(Member member);

    /**
     * 功能描述:会员注册
     * @param memberDto
     * @return ResultBean<Boolean>
     */
    ResultBean<Boolean> activation(MemberDto memberDto);

    /**
     * 根据条件查询member
     * @param member
     * @return
     */
    Member getMember(Member member);
}
