/**
* 文件：ResourceService.java
* 版本：1.0.0
* 日期：
* Copyright &reg; 
* All right reserved.
*/

package com.mortals.xhx.base.system.resource.service;


import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;

import java.util.List;
import java.util.Set;

/**
 * <p>Title: 资源信息</p>
 * <p>Description: ResourceService service接口 </p>
 * <p>Copyright: Copyright &reg;  </p>
 * <p>Company: </p>
 * @author 
 * @version 1.0.0
 */

public interface ResourceService extends ICRUDService<ResourceEntity,Long> {
    /**
     * 查询所有可用资源
     * @return
     * @throws AppException
     */
     List<ResourceEntity> findAllEnable() throws AppException;

    /**
     * 根据用户查询可用资源
     * @param userId
     * @return
     * @throws AppException
     */
     List<ResourceEntity> findListByUserId(Long userId) throws AppException;

    /**
     * 查询用户可用资源
     * @param userId
     * @return 字符串，多个以逗号分隔
     * @throws AppException
     */
     String findUrlByUserId(Long userId) throws AppException;

    /**
     * 查询用户用资源集合
     * @param userId
     * @return
     * @throws AppException
     */
     Set<String> findUrlSetByUserId(Long userId) throws AppException;

    /**
     * 获取所有资源，不分页
     * @return
     * @param userType
     */
    List<ResourceEntity> findAll(int userType);


    Rest<String> refreshResourceUrl(String packageName, Context context);

}