/**
* 文件：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.Map;
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> {

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


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


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



    Map<String, List<ResourceEntity>> group(Long roleId, Context context);

}