spring-boot-api-project-seed
spring-boot-api-project-seed copied to clipboard
restcontroller 中findById 主键类型问题
rest controller中主键查询默认是Integer,但是model主键有可能是string byte long等类型,使用时会报类型转换错误 这种情况现在是怎么处理的? 生成代码后手动修改controller的id类型吗?
自定义Mapper 不继承 IdsMapper
自定义Mapper 不继承 IdsMapper
不是IdsMapper的问题,IdsMapper只有查询多个id和删除多个id的接口,并没有findById 将Service接口的findById参数修改为Object类型(现在是Integer类型),这样可以适配不同类型主键 但是controller层detail方法的参数必须指定参数类型,否则后续会报错,这里是否只能手动修改?
另外,如果使用自定义Mapper的话面临同样的手动修改问题