发送的参数:
{"id":1,
"shiftDetails":[{"id":1,"lineId":2}],
"broadcasts":[{"id":1,"lineId":1,"imgPath":"TEST1"},
{"id":2,"lineId":2,"imgPath":"TEST2"}]
}
Controller类:
@Controller
@RequestMapping("/travelLine")
public class TravelLineController {
@RequestMapping("/insertTest")
@ResponseBody
public Json insertTest(@RequestBody TravelLineDomain tl) {
Json j = new Json();
j.setData(tl);
return j;
}
}
TravelLineDomain实体类:
@Table(name = "t_travel_line")
public class TravelLineDomain{
@Id
@GeneratedValue(generator = "JDBC")
private Integer id;
private List
private List
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public List
return shiftDetails;
}
public void setShiftDetails(List
this.shiftDetails = shiftDetails;
}
public List
return Broadcasts;
}
public void setBroadcasts(List
Broadcasts = broadcasts;
}
}
有问题可留言哦,看见会第一时间回复!