package com.storlead.sales.service.customer;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.storlead.framework.common.result.Result;
import com.storlead.framework.mybatis.service.MyBaseService;
import com.storlead.sales.pojo.dto.customer.SysResourceSearchDTO;
import com.storlead.sales.pojo.entity.customer.SysResourceEntity;
import com.storlead.sales.pojo.vo.customer.SysResourceListVO;
import com.storlead.sales.pojo.vo.customer.SysResourceVO;
import com.storlead.sales.enums.ResourceTypeEnum;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 系统资源表 服务类
 * </p>
 *
 * @author YPZ
 * @since 2024-04-29
 */
public interface SysResourceService extends MyBaseService<SysResourceEntity> {

    /***
      * @Description:  客户资源转移
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/5/22 15:38
      */
    boolean changeResourceCustomerId(Long fromId, Long customerId);

    /**
     * 删除资源
     * @Param: [resourceType, resourceTypeId]
     * @return: boolean
     * @Author: xiaojiawei
     * @Date: 2022/3/8
     */
    boolean delete(String resourceType, Long resourceTypeId);

    boolean updateResource(String resourceType, Long typeId, List<SysResourceEntity> resourceList);

    Result saveVo(SysResourceVO sysResourceVO);

    Map<Long, List<SysResourceEntity>> getResourceMap(String resourceType, List<Long> typeIds);

    boolean updateResourceById(Long customerId,String resourceType, Long typeId, List<Long> resourceIdList);

    boolean updateDelete(String resourceType, Long resourceTypeId);

    Result<IPage<SysResourceListVO>> selectListVO(SysResourceSearchDTO sysResourceSearchDTO);

    /***
      * @Description: 批量上传文件
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/6/24 16:22
      */
    Result saveFileList(SysResourceVO sysResourceVO);

    Result uploadFileList(SysResourceVO sysResourceVO);

    Result saveVo(SysResourceVO sysResourceVO,String newBucketName,String newEndPoint);

    Result uploadFileList(SysResourceVO sysResourceVO,String newBucketName,String newEndPoint);

    Result addResourceByIdList(SysResourceVO sysResourceVO);
}
