package com.YuyeTech.HeartRate.game.imageInfo.service;

import com.YuyeTech.HeartRate.common.service.CommonService;
import com.YuyeTech.HeartRate.game.gameInfo.vo.GameInfoVo;
import com.YuyeTech.HeartRate.game.imageInfo.projo.Pictures;
import com.YuyeTech.HeartRate.game.imageInfo.vo.PicturesVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.io.File;
import java.util.List;

/**
 * @author:slambb
 * @date:2020/6/24
 */
public interface PicturesService  extends CommonService<PicturesVo, Pictures, Integer> {
    /**
     * 分页查询图片
     * @param pageable
     * @return
     */
    Page<Pictures> findAllByPageable(Pageable pageable);

    Pictures addPicture(Pictures pictures);

    Pictures addPictureAndFlush(Pictures pictures);

    Pictures findById(Integer id);

    void deletePictureById(Integer id);

    /**
     * 根据图片id 数组来 查找图片库对应的全部图片
     * @param ids
     * @return
     */
    List<Pictures> findAllByPictureIdList(List<Integer> ids);

    /**
     * 根据图片id 数组来 查找图片库对应的全部图片Url
     * 不添加前缀
     * @param ids
     * @return
     */
    List<String> findAllByPictureIdListAndNoDomain(List<Integer> ids);
    /**
     * 根据图片id 数组来 查找图片库对应的全部图片Url
     * 带前缀
     * @param ids
     * @return
     */
    List<String> findAllByPictureIdListAndDomain(List<Integer> ids);

    /**
     * 添加图片到游戏，并且关联信息
     * @return
     */
    void addPictureToTheGame(File uploadIconFile, String type, GameInfoVo gameInfoVo);

    PicturesVo findByGameIdAndPictureType();

    /**
     * 返回一个查询列表
     * @param pictureType
     * @param associatedId
     * @return
     */
    List<Pictures> findByPictureTypeAndAssociatedId(Integer pictureType,String associatedId);

    /**
     * 删除头像关联数据
     * @param associatedId
     * @return
     */
    Pictures deleteAvatar(String associatedId);

    /**
     * 根据id列表获取数据信息
     * @param pictureIds
     * @return
     */
    List<Pictures> findByPictureIdIn(List<Integer> pictureIds);
}
