POST @PostMapping接收实体类属性为null

2023-02-16 15:16:04 浏览数 (1)

代码语言:javascript复制
@Data
public class MailSender {
    private String Subject;
    private String Text;
    private String SetTo;
    private String SetFrom;
    private Map<String, String> Attachments;
}

原因: 实体类属性必须遵循驼峰命名

代码语言:javascript复制
@Data
public class MailSender {
    private String subject;
    private String text;
    private String setTo;
    private String setFrom;
    private Map<String, String> attachments;
}

0 人点赞