package com.ruoyi.frequency.customer.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.page.PageResult;
import com.ruoyi.controller.req.CustomerPageReq;
import com.ruoyi.controller.req.RegisterUserReq;
import com.ruoyi.controller.req.UserEditReqVo;
import com.ruoyi.frequency.customer.entity.Customer;
import com.ruoyi.frequency.customer.model.param.CustomerParam;
import com.ruoyi.frequency.customer.model.result.CustomerCount;
import com.ruoyi.response.ResponseData;
import com.ruoyi.vo.UserVo;

import java.util.List;

/**
 * 用户Service接口
 *
 * @author liwenlong
 * @date 2023-09-22
 */
public interface CustomerService extends IService<Customer>
{
    /**
     * 查询用户
     *
     * @param id 用户主键
     * @return 用户
     */
    public Customer selectCustomerById(Long id);

    /**
     * 查询用户列表
     *
     * @param customer 用户
     * @return 用户集合
     */
    public List<Customer> selectCustomerList(Customer customer);

    CustomerCount statistics(Customer customer);

    /**
     * 新增用户
     *
     * @param customer 用户
     * @return 结果
     */
    public int insertCustomer(Customer customer);

    /**
     * 修改用户
     *
     * @param customer 用户
     * @return 结果
     */
    public int updateCustomer(Customer customer);

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

    /**
     * 删除用户信息
     *
     * @param id 用户主键
     * @return 结果
     */
    public int deleteCustomerById(Long id);


    /**
     * 修改用户余额
     * @param customer
     * @return
     */
    AjaxResult updateBalance(Customer customer);

    /**
     * 组装用户
     * @param req
     * @param md5Pwd
     * @return
     */
    Customer assembleCustomer(RegisterUserReq req, String md5Pwd);


    /**
     * 用户个人信息
     * @param userVo
     * @return
     */
    ResponseData info(UserVo userVo);


    /**
     * 编辑用户信息
     * @param req
     * @param userVo
     * @return
     */
    ResponseData editInfo(UserEditReqVo req, UserVo userVo);


    /**
     * 后台编辑用户的启用禁用状态
     */
    void switchEnable(CustomerParam customerParam);


    /**
     * 根据账号查询用户
     * @param account 账号
     * @return 用户
     */
    Customer getCustomerByAccount(String account);

    /**
     * 根据手机号查询用户
     * @param areaCode 区号
     * @param mobile 手机号
     * @return 用户
     */
    Customer getCustomerByMobile(String areaCode,String mobile);


    void saveIdNo(Long id);


    /**
     * 设计师列表
     * @param req
     * @param userVo
     * @return
     */
    ResponseData<PageResult<Page<Customer>>> customerPage(CustomerPageReq req, UserVo userVo);

    void canCancellation(Long userId);

    AjaxResult updateIntegral(Customer customer);
}
