package shop.alien.lawyer.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import shop.alien.entity.result.R;
import shop.alien.entity.store.LawyerUserSearchHistory;

import java.util.List;

/**
 * 用户搜索历史 服务类
 *
 * @author system
 * @since 2025-01-XX
 */
public interface LawyerUserSearchHistoryService extends IService<LawyerUserSearchHistory> {

    /**
     * 分页查询用户搜索历史列表
     *
     * @param pageNum     页码
     * @param pageSize    页容
     * @param clientUserId 客户端用户ID
     * @param searchType  搜索类型
     * @return IPage<LawyerUserSearchHistory>
     */
    R<IPage<LawyerUserSearchHistory>> getUserSearchHistoryList(int pageNum, int pageSize, Integer clientUserId, Integer searchType);

    /**
     * 根据用户ID查询搜索历史列表
     *
     * @param clientUserId 客户端用户ID
     * @return List<LawyerUserSearchHistory>
     */
    List<LawyerUserSearchHistory> getListByUserId(Integer clientUserId);

    /**
     * 新增用户搜索历史
     *
     * @param userSearchHistory 用户搜索历史
     * @return R<LawyerUserSearchHistory>
     */
    R<LawyerUserSearchHistory> addUserSearchHistory(LawyerUserSearchHistory userSearchHistory);

    /**
     * 删除用户搜索历史
     *
     * @param id 主键
     * @return R<Boolean>
     */
    R<Boolean> deleteUserSearchHistory(Integer id);

    /**
     * 清空用户搜索历史
     *
     * @param clientUserId 客户端用户ID
     * @return R<Boolean>
     */
    R<Boolean> clearUserSearchHistory(Integer clientUserId);

    /**
     * 通用列表查询（按创建时间降序）
     *
     * @param userSearchHistory 查询条件
     * @return List<LawyerUserSearchHistory>
     */
    List<LawyerUserSearchHistory> getListWithOrder(LawyerUserSearchHistory userSearchHistory);

    /**
     * 通用分页查询（按创建时间降序）
     *
     * @param userSearchHistory 查询条件
     * @param pageNum 页码
     * @param pageSize 每页数量
     * @return IPage<LawyerUserSearchHistory>
     */
    IPage<LawyerUserSearchHistory> getPageWithOrder(LawyerUserSearchHistory userSearchHistory, int pageNum, int pageSize);
}

