当我得到回应时,成功课程完美无缺.但是当它失败时它给了我错误.
在URL中传递失败数据时的响应:
{
"success": -1,
"message": "Invalid username or password",
"data": ""
}
正确数据在URL中传递时的响应:
{
"success": 1,
"message": "User successfully logged in",
"data": {
"userId": 219,
"userName": "mp",
"picture": "219.png",
"isBo": false,
"isPo": true,
"isHm": true,
"hmProfileCompletionStatus": 3,
"poProfileCompletionStatus": 2,
"poPhoto": null,
"hmPhoto": null,
"custStripeToken": "xxx",
"accountStripeToken": "xx",
"bgcStatus": true,
"idCardStatus": true,
"isInsured": null,
"amISponsered": false,
"hmRating": null,
"poRating": null,
"email": "xxx@gmail.com"
}
}
UserResponse.java
@Getter
@Setter
public class UserResponse{
private int success;
private String message;
private User data;
}
错误
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 64 path $.data