I am developing a classified automobile valuation API that would return value of used cars.
Sample API request:
{
"car": "BMW X3 sportline",
"milesDriven": 20000,
"yearOfPurchase": 2010,
"askingPrice": "₹₹₹$20000"
}
The request sends car details with the price what seller expects.
Sample API response:
{
"badConditionPrice": "₹₹₹$30000",
"goodConditionPrice": "₹₹₹$35000"
}
The response sends back 2 prices to indicate rough estimate for ideal price the car should be sold at.
Now, at each client(web/app) we have to show all 3 prices - "askingPrice", "badConditionPrice", "goodConditionPrice".
While "badConditionPrice", "goodConditionPrice" has fixed position ["bad" at left and "good" at right], the position of "askingPrice" will vary. For example:
My question is- who should decide the exact position of "askingPrice" - CLIENT or SERVER?
In case its server we need to send back flag to indicate its position OR if its client, we need to write this logic at each client.
答案 0 :(得分:0)
这实际上取决于您如何定位数据和偏好。什么更容易,如果必须的话,你需要跳更少的地方以便以后改变?