Magic Johnson and the Lakers have plenty of reasons to smile. As for Danny Ainge and the Celtics — well, they didn’t earn a smile Thursday. (Composite photo)

Expected to remain quiet, this year’s NBA trade deadline turned out to be a doozy. So who benefited from the league’s swap meet, and who missed an opportunity to improve?

Here’s The Post’s take on who won or lost big at the buzzer.

Winners

Cleveland Cavaliers

Cleveland desperately needed a makeover, and they got a dramatic one Thursday, shipping out six players and its own first-round pick in exchange for Jordan Clarkson, Larry Nance Jr., Rodney Hood and George Hill. The result? Cleveland got younger and deeper, improved its shooting and defense, and reestablished itself as an NBA Finals favorite in the East.

Not a bad day’s work for General Manager Koby Altman. Combined with none of the other East contenders improving, Cleveland emerges as the biggest winner from Thursday’s deadline.

Los Angeles Lakers

The Lakers needed to get out of future money to position themselves to pull off their dream scenario this summer: Landing both LeBron James and Paul George on max contracts.

Not only did the Lakers clear enough space by shipping out Clarkson and Nance, but they acquired Cleveland’s first-round pick in the process. It was a stunning turn of events for a franchise that has spent the past five years treading water and losing more games than it has in the nearly 60 years the Lakers have been in Los Angeles. Now the team has a chance to get back to where they are used to being.

“This is what I came here to do,” president of basketball operations Magic Johnson told reporters Thursday.

Now he has to do what the Lakers have failed to do the past few summers when they had cap space: lure star free agents. What they pulled off Thursday was a big step in the right direction.

LeBron James

The face of the league woke up Thursday as part of a team with no chemistry, one that couldn’t play defense and had questionable chances of making it back to the NBA Finals. On top of that, James had no obvious landing spot in free agency if he wanted to leave Cleveland for a second time in his career.

By the time James sat down for dinner Thursday, the Cavaliers had remade their roster — including jettisoning Isaiah Thomas, who had clashed with James — and the Lakers had opened up cap space to sign both James and George as free agents. He can contend now, and still choose his path this summer.

Thursday was about as good of a day as it could’ve been for the world’s greatest player.

Detroit Pistons

The Pistons struck early, trading for Blake Griffin last week, and then made a pair of nice depth moves Thursday in adding Jameer Nelson from the Chicago Bulls and James Ennis from the Memphis Grizzlies. Detroit has won five games in a row since trading for Griffin, moving them into a tie with the Philadelphia 76ers for the eighth playoff spot in the East, and now look like a clear favorite to reach the playoffs.

Chicago Bulls

When Nikola Mirotic was punched in the face by teammate Bobby Portis during training camp, it was just a matter of time before he would be leaving Chicago. The fact that the Bulls were able to get a first-round pick — one that could wind up in the back half of the lottery, depending on if New Orleans makes the playoffs — makes it a home run move for the Bulls, even if the trade did require them taking on Omer Asik’s contract through next season.

Losers

Boston Celtics

Yes, the Celtics nabbed Greg Monroe — a quality big who will give them scoring punch off the bench — after he was bought out. But Boston needed a shot creator — something they currently only have in Kyrie Irving. With a plethora of assets, including their own first-round pick this year, the Celtics had the pieces to make a move to bolster their team.

Monroe turned out to be the one move they made. On top of that, the Cavaliers managed to remake their roster on the fly and erase many of the concerns that have made them fall apart over the past several weeks. Couple that with a blowout loss in Toronto this week, and it’s fair to wonder if Boston will even be able to make it back to the Eastern Conference finals this season — let alone make it to the NBA Finals for the first time since 2010.

The future remains as bright in Boston as it is anywhere in the league, and that won’t be changing anytime soon. But Thursday, their present took a hit.

Memphis Grizzlies

Leading up to the trade deadline, the player everyone was sure would be traded was Tyreke Evans. The Grizzlies had shut him down last week to make sure he didn’t get hurt before the deadline. He he was going to wind up somewhere — it was just a matter of the price.

So … why is Evans still on the Grizzlies? Memphis had options to get something for him (just not the first-rounder they desired), and decided it would rather hang onto Evans — and potentially re-sign him this summer — instead of flipping him for a lesser price.

But what if Evans makes it clear he won’t re-sign and asks to be bought out?

It seems Memphis, which is going to be capped out this summer regardless, would have been better off getting what they could for him now. Of all the deals that didn’t happen, this remains the most confusing one.

Charlotte Hornets

The Hornets are a mess. They aren’t going to make the playoffs, and they have a ton of money stuck on their books for the next several years; they are projected to pay the luxury tax next season.

Meanwhile, their one quality player, point guard Kemba Walker, an all-star who will be a free agent in 2019 due for a massive payday, will likely be hoping to make deep playoff runs every season instead of being mired on a team that’s far from contention.

Given the lack of impact players that moved Thursday, Charlotte could have been in a position to trade Walker while both getting something of value for him and getting out from under some of that bad money. Now, they might not be able to do either — which would be a true doomsday scenario for one of the league’s small-market franchises.

New Orleans Pelicans

New Orleans made a pair of nice moves over the past week, landing Mirotic — a perfect fit next to their remaining star, Anthony Davis, and who is signed to a good contract through next season — as well as shedding salary and clearing a roster spot by moving Dante Cunningham to the Brooklyn Nets for Rashad Vaughn.

But the Pelicans were rolling before DeMarcus Cousins tore his Achilles’ tendon, costing him not just the rest of this season, but potentially part of next as well. Despite not knowing what Cousins’s future health will be, the Pelicans will likely have to pony up a huge contract for him, if only to keep Davis, his close friend, happy and interested in remaining with the franchise long term.

That is an unenviable position. It also doesn’t include the fact that the Los Angeles Clippers kept their team largely intact and the Utah Jazz have won seven in a row to move within 2.5 games of the Pelicans for the final playoff spot in the West.

It’s been a bad couple of weeks in New Orleans, to put it mildly.

Isaiah Thomas

What a difference a year makes. This time last season, Thomas was a borderline candidate for the NBA’s most valuable player award, leading the Celtics to the best record in the East and looking like he was going to land a massive contract when his deal expires in July 2018.

Thomas was shut down in the Eastern Conference finals with a hip injury, then traded to the Cavaliers as part of a package for Irving. He missed the first two months of the season, returned as one of the least efficient NBA players for the past month and was at the center of multiple locker room controversies. Now he has been shipped to the Lakers, where he may not start and where he won’t have a shot at the playoffs — just one day after saying he was tired of being traded.

Talk about a fall. Thomas does have the benefit of spending the next two months playing for a team that isn’t going anywhere, giving him the opportunity to play into form (something he clearly needed the benefit of time to do in Cleveland, which the Cavaliers didn’t have).

To say the last year hasn’t gone the way Thomas had expected — or hoped — is the definition of an understatement. That culminated in Thursday’s trade.

Read more on the NBA:

Cavaliers trade basically everyone, Internet goes berserk

Wizards trade injured player Sheldon Mac to open roster spot

How NBA teams’ reckless spending on 2016 free agents is crippling the market today

Kristaps Porzingis’s torn ACL is a cruel blow to a franchise that’s all too used to them

The Wizards are winning without John Wall, but it’s crazy to think they’re better off without him