Is it bad to create different classes for REST request and response?

前端 未结 3 1623
被撕碎了的回忆
被撕碎了的回忆 2020-12-16 03:10

I\'m working in a Spring Boot project, as my implement at the moment, almost for each API I have request and response classes.

For example:

3条回答
  •  被撕碎了的回忆
    2020-12-16 03:37

    I will suggest you to use JSON format instead of creating class and returning its instance every time. But still if you need a class hierarchy you can create a class and put a variable which will store JSON.

提交回复
热议问题