记录下自己的bug
/**
* 礼物订单信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/order/gift")
public class OrderGiftController extends BaseController
{
@Autowired
private IOrderGiftService orderGiftService;
/**
* 获取礼物订单列表 - 联合数据
*/
@GetMapping("/orderGiftUnionList")
public AjaxResult orderGiftUnionList(HttpServletRequest request){
return ajax;
}
/**
* 根据礼物订单编号获取详细信息
*/
@GetMapping(value = { "/", "/{orderNo}" })
public AjaxResult getInfo(@PathVariable(value = "orderNo", required = false) String orderNo)
{
AjaxResult ajax = AjaxResult.success();
if (StringUtils.isNotNull(orderNo))
{
OrderGift orderGift = orderGiftService.selectOrderGiftByOrderNo(orderNo);
ajax.put(AjaxResult.DATA_TAG, orderGift);
}
return ajax;
}
前端报错
{
"msg": "请求参数类型不匹配,参数[giftId]要求类型为:'java.lang.Long',但输入值为:'orderGiftUnionList'",
"code": 500
}
原因,两个请求重复了,都是get请求,@GetMapping("/orderGiftUnionList") 被 @GetMapping(value = { "/", "/{orderNo}" }) 冲突