Exactly solvable models with time-dependent boundary conditions