前提:由于jsp基础薄弱,很多功能实现起来困难,考虑能不能直接以json形式返回的response来设计接口。
响应成功的例子
{
"success": true,
"payload": {
/* Application-specific data would go here. */
}
}
响应失败的例子
{
"success": false,
"payload": {
/* Application-specific data would go here. */
},
"error": {
"code": 123,
"message": "An error occurred!"
}
}