后端get请求

public ResponseEntity<CommodityRespM02> commoditySelectMap(@RequestParam Commodity commodity) throws Exception {

  ...........................

}

 

后端post请求

public ResponseEntity<CommodityRespM02> commoditySelectMap(@RequestBody Commodity commodity) throws Exception {

  ...........................

}

 

 

/**
* 对象转map
* @param bean
* @return
*/
public static <T> Map<String, Object> beanToMap(T bean) {
Map<String, Object> map = Maps.newHashMap();
if (bean != null) {
BeanMap beanMap = BeanMap.create(bean);
for (Object key : beanMap.keySet()) {
map.put(key + "", beanMap.get(key));
}
}
return map;
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
  • 2022-02-06
  • 2022-12-23
猜你喜欢
  • 2021-11-07
  • 2021-10-24
  • 2021-05-30
  • 2022-02-01
  • 2022-12-23
  • 2022-01-28
相关资源
相似解决方案