实现用户角色服务

This commit is contained in:
2025-05-08 22:28:25 +08:00
parent 2f9b922485
commit 87d6c738c7

View File

@@ -32,4 +32,16 @@ export class UserRoleService {
] ]
}) })
} }
async addUserRole(userRole: Pick<UserRole, 'roleId' | 'userId' | 'isEnabled' | 'expiredAt'>): Promise<void> {
const newUserRole = this.userRoleRepository.create(userRole);
await this.userRoleRepository.save(newUserRole);
}
async deleteUserRole(userId: string, roleId: string): Promise<void> {
await this.userRoleRepository.delete({
userId,
roleId,
});
}
} }