比如在AControl中映射路径为"/v1/enterpriseInfo",在BControl中映射路径也为"/v1/enterpriseInfo",那么再有一个相同的Get/Post的方法时就会报错。
路径相同报错
public com.jsptpd.gayg.common.model.ResponseObj<com.jsptpd.gayg.common.util.PageUtil> com.jsptpd.gayg.modules
* .operative.restcontrol.OrderControl.list(java.util.Map) to {[/v1/orderInfo],methods=[GET]}: There is already
* 'orderchantControl' bean method
@RestController
@RequestMapping("/v1/enterpriseInfo")
public class AControl {
@Autowired
private EnterpriseBaseMapper enterpriseBaseMapper;
/**
* 获取列表
*/
@RequestMapping(value = "", method = RequestMethod.GET)
public ResponseObj<PageUtil> list(@RequestParam Map<String, String> formData) {
formData = CommonUtil.convertFormData(formData);
Integer integer = enterpriseBaseMapper.countByRole(formData);
List<EnterpriseBase> enterpriseBases = enterpriseBaseMapper.selectByOrg(formData);
PageUtil pageInfo = new PageUtil(integer, formData);
pageInfo.setResultList(enterpriseBases);
return new ResponseObj<PageUtil>(pageInfo, RetCode.SUCCESS);
}
}
@RestController
@RequestMapping("/v1/enterpriseInfo")
public class BControl {
@Autowired
private EnterpriseBaseMapper enterpriseBaseMapper;
/**
* 获取列表
*/
@RequestMapping(value = "", method = RequestMethod.GET)
public ResponseObj<PageUtil> list(@RequestParam Map<String, String> formData) {
formData = CommonUtil.convertFormData(formData);
Integer integer = enterpriseBaseMapper.countByRole(formData);
List<EnterpriseBase> enterpriseBases = enterpriseBaseMapper.selectByOrg(formData);
PageUtil pageInfo = new PageUtil(integer, formData);
pageInfo.setResultList(enterpriseBases);
return new ResponseObj<PageUtil>(pageInfo, RetCode.SUCCESS);
}
}
网友评论