package shop.alien.store.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartRequest;
import shop.alien.entity.store.StoreCommentAppeal;
import shop.alien.entity.store.vo.StoreCommentAppealInfoVo;
import shop.alien.entity.store.vo.StoreCommentAppealVo;

import java.util.Map;

/**
 * 评论申诉表 服务类
 *
 * @author ssk
 * @since 2025-01-02
 */
public interface StoreCommentAppealService extends IService<StoreCommentAppeal> {

    /**
     * 申诉历史-分页
     *
     * @param pageNum      页数
     * @param pageSize     页容
     * @param storeId      门店id
     * @param appealStatus 申诉状态: 0:待处理, 1:已驳回, 2:已同意
     * @return IPage<StoreCommentAppeal>
     */
    IPage<StoreCommentAppealVo> getAppealHistory(Integer pageNum, Integer pageSize, Integer storeId, String appealStatus);

    /**
     * 申诉历史各状态数量
     * @param storeId      门店id
     */
    Map<String, Integer> getAppealHistoryCountStatus(Integer storeId);

    /**
     * 新增申诉
     *
     * @param multipartRequest 文件
     * @param storeId          门店id
     * @param commentId        评论id
     * @param appealReason     申诉原因
     * @return Integer(0 : 申诉成功, 1 : 申诉失败, 2 : 申诉已存在, 3 : 文本内容异常)
     */
    Integer addAppeal(MultipartRequest multipartRequest, Integer storeId, Integer commentId, String appealReason);

    /**
     * 新增申诉
     *
     * @param multipartRequest 文件
     * @param storeId          门店id
     * @param commentId        评论id
     * @param appealReason     申诉原因
     * @return Integer(0 : 申诉成功, 1 : 申诉失败, 2 : 申诉已存在, 3 : 文本内容异常)
     */
    StoreCommentAppealInfoVo addAppealNew(MultipartRequest multipartRequest, Integer storeId, Integer commentId, String appealReason);



    /**
     * 申诉详情
     *
     * @param id 申诉id
     * @return StoreCommentAppealVo
     */
    StoreCommentAppealVo getStoreCommentAppealDetail(Integer id);

    /**
     * web-申诉分页查询
     *
     * @param pageNum      页数
     * @param pageSize     页容
     * @param storeName    门店名称
     * @param storeContact 门店联系人
     * @param storePhone   门店电话
     * @param appealStatus 申诉状态: 0:待处理, 1:已驳回, 2:已同意
     * @return IPage<StoreCommentAppealVo>
     */
    IPage<StoreCommentAppealVo> getStoreAppealPage(Integer pageNum, Integer pageSize, String storeName, String storeContact, String storePhone, String appealStatus);

    /**
     * 修改申诉状态
     *
     * @param id           申诉id
     * @param appealStatus 申诉状态: 0:待处理, 1:已驳回, 2:已同意
     * @return boolean
     */
    boolean setAppealStatus(Integer id, Integer appealStatus,String logRemark);

    /**
     * 导出Excel
     *
     * @return ResponseEntity
     */
    ResponseEntity<byte[]> exportToExcel();
}
