use of com.amusing.start.exception.UnauthorizedException in project amusing-project by m-lvqingyu.
the class OrderInfoController method create.
/**
* 订单创建
*
* @param from 订单信息
* @return
*/
@PostMapping("create/v1")
public ApiResult<String> create(@Valid @RequestBody CreateFrom from) throws OrderException, UnauthorizedException {
CreateDto createDto = fromToDto(from);
String orderId = "";
try {
orderId = orderCreateService.create(createDto);
} catch (Exception e) {
log.error("[Order]-[create]-msg:{}", Throwables.getStackTraceAsString(e));
}
return StringUtils.isEmpty(orderId) ? ApiResult.result(OrderCode.ORDER_SAVE_FAIL) : ApiResult.ok(orderId);
}
Aggregations