Lombok插件 @Data传参取值问题记录

问题:springMVC controller 接收参数时存在参数取值为空的情况(所传参数都有值)

1.controller
在这里插入图片描述
2.PSchOrderDTO
在这里插入图片描述
3.取参(如图,只有一个参数有值)
在这里插入图片描述

问题排查(猜想可能参数命名用@Data取值问题,修改一个参数名称)

在这里插入图片描述
重新请求结果(发现修改的参数有值)
在这里插入图片描述
解决方法(手动生成get和set方法,或者规范参数值)

public class PSchOrderTempDTO {

    private List<PSchSchemeVO> pSchSchemes;
    /**
     * 待排订单ids
     */
    private List<Integer> p_sch_order_ids;
    /**
     * 机器配置信息
     */
    private PSchConfig pSchConfig;

    public List<PSchSchemeVO> getpSchSchemes() {
        return pSchSchemes;
    }

    public void setpSchSchemes(List<PSchSchemeVO> pSchSchemes) {
        this.pSchSchemes = pSchSchemes;
    }

    public List<Integer> getP_sch_order_ids() {
        return p_sch_order_ids;
    }

    public void setP_sch_order_ids(List<Integer> p_sch_order_ids) {
        this.p_sch_order_ids = p_sch_order_ids;
    }

    public PSchConfig getpSchConfig() {
        return pSchConfig;
    }

    public void setpSchConfig(PSchConfig pSchConfig) {
        this.pSchConfig = pSchConfig;
    }
}

重新请求接口(全部都有值)
在这里插入图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值