我开始使用 Spring 并且对它的约定有些困惑。
Services
和其他存储库? Service
是最佳做法吗?和Repository
类基于 Entity
名称,即:用户-> UserRepository
-> UserService
? 最佳答案
并且不要在 Controller 中使用实体。创建 Dto(数据传输
对象)来自实体的对象并在您的
前端
关于Spring 服务和存储库层约定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34058238/