springboot框架中一个controller类可以调用多个service类吗?

Views :
Update time : 2025-06-27 12:55:18

可以,搞清楚controller 和service 区别就知道怎么划分了,service 方法一般是带事务的,尤其是对于写事务,而controller 方法不应该带事务,看你的业务是需要什么样的事务控制来决定怎么调用。

springboot框架中一个controller类可以调用多个service类吗?
Related News
Read More >>
Blog Post With Youtube Video 为什么都说 Finder 难用?
2025-06-24 08:55:17
为什么都说 Finder 难用?...
Blog Post With Youtube Video 想知道这个女孩是谁?
2025-06-24 08:55:17
想知道这个女孩是谁?...
Blog Post With Youtube Video Golang和J***a到底怎么选?
2025-06-24 09:05:19
Golang和J***a到底怎么选?...
Blog Post With Youtube Video 怎么看待B站舞蹈区和某些风格比较暴露的up?
2025-06-24 09:15:18
怎么看待B站舞蹈区和某些风格比较暴露的up?...

Leave Your Message