苍穹外卖day9前端订单分页查询后订单菜品不展示(已解决)

前端约定好返回结果示例如下:

复制代码
{ 
    "code": 0, 
    "msg": null, 
    "data": { 
        "total": 0, 
        "records": [ 
            { 
                "id": 0, 
                "number": "string", 
                "status": 0, 
                "userId": 0, 
                "addressBookId": 0, 
                "orderTime": "string", 
                "checkoutTime": null, 
                "payMethod": 0, 
                "payStatus": 0, 
                "amount": 0, 
                "remark": "string", 
                "userName": "string", 
                "phone": "string", 
                "address": "string", 
                "consignee": "string", 
                "cancelReason": "string", 
                "rejectionReason": "string", 
                "cancelTime": "string", 
                "estimatedDeliveryTime": "string", 
                "deliveryStatus": 0, "deliveryTime": 
                "string", "packAmount": 0, 
                "tablewareNumber": 0, 
                "tablewareStatus": 0, 
                "orderDishes": "string" 
            } 
        ] 
    } 
}

可以发现,前端已经规定好data-records的订单菜品属性名为orderDishes,而我由于追求命名准确性,将OrderVO的属性

复制代码
private String orderDishes;

修改为

复制代码
private String orderFoodsInfo;

而这样会导致前端无法从OrderVO中解析出orderDishes属性的值,从而导致前端订单菜品没有展示出来。

启示:

对于要返回给前端展示的VO,最好不要随意修改属性名称。

相关推荐
专注VB编程开发20年14 小时前
Windows API 所有老式结构体4字节对齐,但是64位VBA,Twinbasic弄成了8字节对齐,大BUG
windows·bug
IT枫斗者1 天前
前端部署后如何判断“页面是不是最新”?一套可落地的版本检测方案(适配 Vite/Vue/React/任意 SPA)
前端·javascript·vue.js·react.js·架构·bug
半天法师2 天前
Bug 记录:UE 结构体转 JSON 时 Key 字段大小写异常 (Editor 与打包后表现不一致)
ai·ue5·json·bug
张小俊_2 天前
WPF 跨线程 UI 更新与硬编码赋值引发的 Bug 排查
c#·bug·wpf
鸿儒5173 天前
记录一个C++ Windows程序移植到Linux系统的bug
开发语言·c++·bug
Python私教3 天前
HermesAgent 终端工具 Windows 兼容性修复实战:两个 Bug 的排查与解决
windows·bug
瀚高PG实验室4 天前
pgroonga全文检索插件的BUG
数据库·postgresql·bug·瀚高数据库
¥-oriented5 天前
记录使用C#编程中遇到的一个小bug
c#·bug
MaraSun6 天前
Deepseek 的一个bug
bug·deepseek
葡萄城技术团队8 天前
Excel公式前的“@”符号:是Bug还是黑科技?
科技·bug·excel