因为 实体类中的主键 是String类型 不能自动为其分配id 所以需要手动设置在service层 model.setId(UUID.randomUUID().toString()); 转载于:https://www.cnblogs.com/shan1393/p/9193966.html