package com.bocloud.sms.interfaces; import com.bocloud.sms.entity.*; import com.bocloud.sms.model.*; import com.megatron.common.exception.InternalServerException; import com.megatron.common.model.*; import jakarta.servlet.http.HttpServletResponse; import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; /** * 租户抽象Service接口 * * @author wei wei * @version 1.0 * @since 2016.08.05 */ public interface TenantService { /** * 创建租户 * * @param params * @param requestContext * @return * @throws InternalServerException */ Result create(TenantModel params, RequestContext requestContext) throws InternalServerException; /** * 更新租户 * * @param id * @param tenant * @param requestContext * @return * @throws InternalServerException */ Result modify(Long id, TenantModel tenant, RequestContext requestContext) throws InternalServerException; /** * 删除租户 * * @param id * @param requestContext * @return * @throws InternalServerException */ Result remove(Long id, RequestContext requestContext) throws InternalServerException; /** * 查看租户详情 * * @param id * @return */ GeneralResult detail(Long id); /** * 分页查询 * * @param pager * @param user * @return */ GeneralResult> list(Pager pager, RequestContext user); /** * 根据资源池id删除租户资源池关系 * * @param poolId * @return */ Result deleteByPoolId(Long poolId); /** * 租户配置资源池 * * @param id * @param category * @param poolIds * @param requestContext * @return */ Result configPool(Long id, String category, List poolIds, RequestContext requestContext); /** * 根据租户查询资源池关联信息 * * @param id * @return */ GeneralResult> listTenantPool(Long id); /** * 租户配置资源池 * * @param id * @param businessIds * @return */ Result configBusiness(Long id, List businessIds); /** * 租户登录 * * @param account * @param password * @param sessionId * @param requestIp * @return * @throws InternalServerException */ GeneralResult> login(String account, String password, String sessionId, String requestIp) throws InternalServerException; /** * 租户退出 * * @param id * @return * @throws InternalServerException */ Result logout(Long id) throws InternalServerException; /** * 修改租户状态 * * @param id * @param action * @param requestContext * @return */ Result updateStatus(Long id, ActionModel.Action action, RequestContext requestContext); /** * 获取租户下的用户 * * @param id * @return */ GeneralResult> getTenantUsers(Long id); /** * 修改密码 * * @param id * @param oldPassword * @param password * @param requestContext * @return */ Result changePwd(Long id, String oldPassword, String password, RequestContext requestContext); /** * 重置密码 * * @param id * @param password * @param requestContext * @return */ Result resetPwd(Long id, String password, RequestContext requestContext); /** * 获取安全密钥(公共方法勿删) * * @param apiKey * @return */ GeneralResult apiKey(String apiKey); /** * 检查租户是否异地登录 * * @param id * @param token * @return */ Result checkTenant(Long id, String token); /** * 查询租户的角色 * * @param tenantId * @return */ GeneralResult> listRoles(Long tenantId); /** * 获取apiKey * * @param apiKey * @return */ GeneralResult getByApiKey(String apiKey); /** * 根据租户账号冻结租户基本信息 * * @param account * @return * @throws InternalServerException */ Result lockByAccount(String account) throws InternalServerException; /** * 批量冻结租户 * * @param ids * @param context * @return */ Result batchLock(List ids, RequestContext context); /** * 批量冻结租户 * * @param ids * @param context * @return */ Result batchActive(List ids, RequestContext context); /** * 批量删除租户 * * @param ids * @param context * @return */ Result batchRemove(List ids, RequestContext context); /** * 保存租户登录数据 * * @param log * @return * @throws InternalServerException */ Result save(LoginRecord log) throws InternalServerException; /** * 租户登录记录列表展示 * * @param pager * @return */ GeneralResult> list(Pager pager); /** * checked租户权限 * * @param context * @return */ GeneralResult> listPermissions(RequestContext context); /** * 校验密码 * * @param id * @param password * @return */ Result check(Long id, String password); /** * 批量添加收藏 * * @param favorites * @return */ Result addFavorites(List favorites); /** * 添加收藏 * * @param serviceMenuId * @param tenantId * @return */ Result addFavorite(Long serviceMenuId, Long tenantId); /** * 取消收藏 * * @param serviceId * @param tenantId * @return */ Result cancelFavorite(Long serviceId, Long tenantId, RequestContext requestContext); /** * 获取服务目录 * * @param requestContext * @return */ GeneralResult> listServiceMenu(RequestContext requestContext); /** * 获取收藏夹 * * @param requestContext * @return */ GeneralResult> listFavorite(RequestContext requestContext); /** * 修改收藏夹排序 * * @param params * @param requestContext * @return */ Result changePriority(List params, RequestContext requestContext); /** * 返回账号相关登录所需信息 * * @param account * @return */ GeneralResult> tokenLogin(String account); /** * 获取租户下的项目 * * @param id * @return */ GeneralResult> projects(Long id); /** * 根据账号获取租户信息 * * @param account * @return */ Result exist(String account); /** * 根据省市信息获取租户列表 * * @param city * @return */ GeneralResult> listTenantByCity(String city); /** * 租户导入模板 * * @param title * @param requestContext * @param response * @return */ Result importTemp(String title, RequestContext requestContext, HttpServletResponse response); /** * 租户数据导入 * * @param multipartFile * @param requestContext * @return */ Result importData(MultipartFile multipartFile, RequestContext requestContext); /** * 租户配置成员用户 * * @param id * @param userIds * @return */ Result configUsers(Long id, List userIds); /** * 字典查询 * * @param condition * @return */ GeneralResult condition(String condition); /** * 导出租户列表 * * @param paramList * @param requestContext * @param response * @return */ Result export(List paramList, RequestContext requestContext, HttpServletResponse response); GeneralResult checkPassword(RequestContext requestContext, String password); }