How to interface data more elegantly in complex business scenarios

  1. currently encounters a complex data interface, and a large object will be sent to the front end. Large objects contain the key of N, and the data of each key is different, strings, objects, numbers, arrays, etc. How to deal with this interface data docking more elegantly? I feel that the current processing is a little messy, and the code has been changed to death after a slight change to the data interface.

for example, the interface of grafana has so much data. How to deal with it more elegantly.
clipboard.png

May.25,2022

refer to Restful design style, separate resources
for example, user list returns user basic information
user's city, user's work history is obtained separately in more user id or resume id, and the front end controls


consult with the background, a large parameter transfer string is put into a separate field.
only key information is sent.
for example:

params = {
    userId:xxx,
    jsonStr:json
}
Menu