@ApiOperation("BeanUtil使用,JavaBean的工具类")
@GetMapping("/beanUtil")
public CommonResult beanUtil(){
PmsBrand brand = new PmsBrand();
brand.setId(1L);
brand.setName("小米");
brand.setShowStatus(0);
//Bean转Map
Map<String, Object> mapBread = BeanUtil.beanToMap(brand);
LOGGER.info("beanUtil map to bean:{}",mapBread);
//Bean属性拷贝
PmsBrand copyBrand = new PmsBrand();
BeanUtils.copyProperties(brand,copyBrand);
LOGGER.info("beanUtil copy properties:{}",copyBrand);
return CommonResult.success(null,"操作成功!");
}