package com.hai.service;

import com.alibaba.fastjson.JSONObject;
import com.hai.entity.HighUser;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * @ClassName: HighUserService
 * @Description: 用户管理
 * @author: 袁野
 * @date: 2019/10/28 9:46
 * @Copyright: 2021 www.high.com Inc. All rights reserved.
 */
public interface HighUserService {


    /**
     *
     * @Title: getListUser
     * @Description:  查询用户列表
     * @Date: 2021/03/09 10:23
     * @author: Sum1Dream
     * @param: [map] map参数
     * @return: java.util.List<com.hai.entity.HighUser>
     * @throws Exception 抛出异常
     */

    List<HighUser> getListUser(Map<String , String> map) throws Exception;

    /**
     *
     * @Title: findByUserId
     * @Description:  查询用户详情
     * @Date: 2021/03/09 10:23
     * @author: Sum1Dream
     * @param: userId 用户id
     * @return: HighUser
     */
    HighUser findByUserId(Long userId);

    /**
     * @Author hurui
     * @Description 查询用户详情数据
     * @Date 15:34 2021/9/7
     * @Param [userId]
     * @return com.hai.entity.HighUser
     **/
    HighUser getDetailDataByUser(Long userId);

    /**
     * @Author 胡锐
     * @Description 根据微信openId 查询用户
     * @Date 2021/3/10 22:44
     **/
    HighUser findByOpenId(String openId);

    /**
    * @Author Sum1Dream
    * @name findByOpenIdH5.java
    * @Description // 根据h5openId查询
    * @Date 15:10 2022/8/23
    * @Param [java.lang.String]
    * @return com.hai.entity.HighUser
    */
    HighUser findByOpenIdH5(String openId);

    /**
     *
     * @param unionId
     * @return
     */
    HighUser findByUnionId(String unionId);

    /**
     * @Author 胡锐
     * @Description 根据手机号 查询用户
     * @Date 2021/3/10 22:55
     **/
    HighUser findByPhone(String phone);

    /**
     * 绑定手机号
     * @param phone
     * @param request
     * @return
     * @throws Exception
     */
    HighUser bindUserPhone(String phone, HttpServletRequest request) throws Exception;

    /**
     *
     * @Title: updateUser
     * @Description: 修改用户信息
     * @author: Sum1Dream
     * @Date: 2021/03/09 11:23
     * @param: [highUser] 用户信息
     * @return: com.hai.entity.HighUser
     */
    void updateUser(HighUser highUser);

    /**
     *
     * @Title: insertUser
     * @Description: 新增用户
     * @author: Sum1Dream
     * @Date: 2021/03/09 11:23
     * @param: [highUser] 用户信息
     * @return: com.hai.entity.HighUser
     */
    void insertUser(HighUser highUser , Long popularizeUserId , String regionId);

    /**
     * @Author 胡锐
     * @Description 用户金币充值、消费
     * @Date 2021/3/27 9:51
     **/
    void goldHandle(Long userId, Integer goldNum, Integer goldType, Integer resType, Long resId , String remark);

    /**
    * @Author Sum1Dream
    * @name findGoldRepeat.java
    * @Description // 查询用户是否有重复记录
    * @Date 3:55 下午 2022/2/16
    * @Param [java.lang.Integer, java.lang.Long]
    * @return java.lang.Boolean
    */
    Boolean findGoldRepeat(Integer resType , Long resId);


    Long countUser();

    /**
    * @Author Sum1Dream
    * @name userDistributionStatistics.java
    * @Description // 用户分销统计
    * @Date 10:00 2022/8/16
    * @Param [java.lang.Long]
    * @return com.alibaba.fastjson.JSONObject
    */
    JSONObject userDistributionStatistics(Long userId);


}
