The springboot request parameter is a class that contains list

such as the title.

background controller:

@RequestMapping("generatorOrder")
    public TMessage generatorOrder(Order order) {
        ...
    }

order class:

public class Order implements Serializable {
    
    
    private Long orderId;
    
    private BigDecimal sum;
    /**
     * 
     */
    private Timestamp gmtCreate;
    private transient List<OrderDetail> detailList;
}

this is my test result:

clipboard.png


stringlist


clipboard.png

how should string, be received correctly if the background request parameters are not changed to the json format of the order class?
the picture is a little blurry, please click to view the original picture

Mar.01,2021

1 create a new class

  

add requestbody comments to the parameter.

Menu