You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.2 KiB
33 lines
1.2 KiB
package com.crm.auth.service;
|
|
|
|
import com.crm.auth.domain.entity.AuthUser;
|
|
import com.crm.base.service.IBaseService;
|
|
|
|
import java.util.List;
|
|
|
|
public interface IAuthUserService extends IBaseService<AuthUser> {
|
|
|
|
/**
|
|
* 按手机号查用户(跨平台身份映射用),无则返回 null
|
|
*/
|
|
AuthUser getByMobile(String mobile);
|
|
|
|
/**
|
|
* 原子设置用户的主部门与全部兼职部门(全量替换式,照角色分配先例)。
|
|
* <p>校验:用户存在、所有部门存在、兼职不得等于主部门(兼职列表先去重);
|
|
* 主部门可为 null(仅兼职的用户合法);层级重叠(兼职到主部门父/子)不拦截。</p>
|
|
*
|
|
* @param userId 目标用户 ID
|
|
* @param primaryDeptId 主部门 ID,可为 null(清空主部门)
|
|
* @param partTimeDeptIds 兼职部门 ID 列表,可为 null/空(清空兼职)
|
|
*/
|
|
void assignDepts(Long userId, Long primaryDeptId, List<Long> partTimeDeptIds);
|
|
|
|
/**
|
|
* 分配用户的角色(全量替换,事务保护)
|
|
*
|
|
* @param userId 用户 ID
|
|
* @param roleIds 角色 ID 列表
|
|
*/
|
|
void assignRoles(Long userId, List<Long> roleIds);
|
|
}
|
|
|