json类型字段使用mybatisPlus保存报错
数据库结构如下
java实体类如下:
@TableName("student")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Student implements Serializable {
@TableId(type = IdType.AUTO)
private int id;
private String name;
@TableField(typeHandler = FastjsonTypeHandler.class)
private JSONPObject param;
}
接口:
@RestController
@RequestMapping("student")
@Api(tags = "学生管理")
public class StudentController {
@Resource
private StudentService studentService;
@PostMapping("save")
public ResponseEntity save(@RequestBody Student student){
studentService.saveOrUpdate(student);
return ResponseEntity.ok("success");
}
}
service:
public interface StudentService extends IService<Student> {
}
实现类
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements StudentService{
}
调接口报错:
问:json的数据该怎么保存