feat(新增): 获取订单信息
Signed-off-by: bunny <1319900154@qq.com>
This commit is contained in:
parent
d352cd8dd2
commit
4a9055ecd3
|
@ -2,6 +2,7 @@ package com.atguigu.order.controller;
|
||||||
|
|
||||||
import com.atguigu.order.service.OrderInfoService;
|
import com.atguigu.order.service.OrderInfoService;
|
||||||
import com.atguigu.spzx.model.dto.h5.OrderInfoDto;
|
import com.atguigu.spzx.model.dto.h5.OrderInfoDto;
|
||||||
|
import com.atguigu.spzx.model.entity.order.OrderInfo;
|
||||||
import com.atguigu.spzx.model.vo.h5.TradeVo;
|
import com.atguigu.spzx.model.vo.h5.TradeVo;
|
||||||
import com.atguigu.spzx.model.vo.result.Result;
|
import com.atguigu.spzx.model.vo.result.Result;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
@ -30,4 +31,11 @@ public class OrderInfoController {
|
||||||
Long orderId = orderInfoService.submitOrder(orderInfoDto);
|
Long orderId = orderInfoService.submitOrder(orderInfoDto);
|
||||||
return Result.success(orderId);
|
return Result.success(orderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取订单信息")
|
||||||
|
@GetMapping("auth/{orderId}")
|
||||||
|
public Result<OrderInfo> getOrderInfo(@Parameter(name = "orderId", description = "订单id", required = true) @PathVariable Long orderId) {
|
||||||
|
OrderInfo orderInfo = orderInfoService.getOrderInfo(orderId);
|
||||||
|
return Result.success(orderInfo);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -11,4 +11,12 @@ public interface OrderInfoMapper {
|
||||||
* @param orderInfo orderInfo
|
* @param orderInfo orderInfo
|
||||||
*/
|
*/
|
||||||
void save(OrderInfo orderInfo);
|
void save(OrderInfo orderInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取订单信息
|
||||||
|
*
|
||||||
|
* @param orderId 订单Id
|
||||||
|
* @return OrderInfo
|
||||||
|
*/
|
||||||
|
OrderInfo getById(Long orderId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.atguigu.order.service;
|
package com.atguigu.order.service;
|
||||||
|
|
||||||
import com.atguigu.spzx.model.dto.h5.OrderInfoDto;
|
import com.atguigu.spzx.model.dto.h5.OrderInfoDto;
|
||||||
|
import com.atguigu.spzx.model.entity.order.OrderInfo;
|
||||||
import com.atguigu.spzx.model.vo.h5.TradeVo;
|
import com.atguigu.spzx.model.vo.h5.TradeVo;
|
||||||
|
|
||||||
public interface OrderInfoService {
|
public interface OrderInfoService {
|
||||||
|
@ -18,4 +19,12 @@ public interface OrderInfoService {
|
||||||
* @return Long
|
* @return Long
|
||||||
*/
|
*/
|
||||||
Long submitOrder(OrderInfoDto orderInfoDto);
|
Long submitOrder(OrderInfoDto orderInfoDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取订单信息
|
||||||
|
*
|
||||||
|
* @param orderId 订单Id
|
||||||
|
* @return OrderInfo
|
||||||
|
*/
|
||||||
|
OrderInfo getOrderInfo(Long orderId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,4 +149,15 @@ public class OrderInfoServiceImpl implements OrderInfoService {
|
||||||
// 6、返回订单id
|
// 6、返回订单id
|
||||||
return orderInfo.getId();
|
return orderInfo.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取订单信息
|
||||||
|
*
|
||||||
|
* @param orderId 订单Id
|
||||||
|
* @return OrderInfo
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public OrderInfo getOrderInfo(Long orderId) {
|
||||||
|
return orderInfoMapper.getById(orderId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,4 +57,13 @@
|
||||||
#{cancelTime},
|
#{cancelTime},
|
||||||
#{cancelReason})
|
#{cancelReason})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<!-- 获取订单信息 -->
|
||||||
|
<select id="getById" resultType="com.atguigu.spzx.model.entity.order.OrderInfo">
|
||||||
|
select
|
||||||
|
<include refid="columns"/>
|
||||||
|
from order_info
|
||||||
|
where
|
||||||
|
id = #{id}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue