From c848d637755af04037c7a0eb3cbffa2239f6ee64 Mon Sep 17 00:00:00 2001 From: sin <2943460818@qq.com> Date: Sun, 24 Mar 2019 11:37:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20admins=20=E5=92=8C=20users?= =?UTF-8?q?=20controller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admins/AdminsOrderController.java | 56 +++++++++++++++++++ .../users/UsersOrderController.java | 15 +++++ 2 files changed, 71 insertions(+) create mode 100644 order/order-application/src/main/java/cn/iocoder/mall/order/controller/admins/AdminsOrderController.java create mode 100644 order/order-application/src/main/java/cn/iocoder/mall/order/controller/users/UsersOrderController.java diff --git a/order/order-application/src/main/java/cn/iocoder/mall/order/controller/admins/AdminsOrderController.java b/order/order-application/src/main/java/cn/iocoder/mall/order/controller/admins/AdminsOrderController.java new file mode 100644 index 000000000..c2b659195 --- /dev/null +++ b/order/order-application/src/main/java/cn/iocoder/mall/order/controller/admins/AdminsOrderController.java @@ -0,0 +1,56 @@ +package cn.iocoder.mall.order.controller.admins; + +import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.order.api.OrderService; +import cn.iocoder.mall.order.api.dto.OrderItemUpdateDTO; +import cn.iocoder.mall.order.api.dto.OrderLogisticsUpdateDTO; +import cn.iocoder.mall.order.api.dto.OrderPageBO; +import cn.iocoder.mall.order.api.dto.OrderQueryDTO; +import cn.iocoder.mall.order.convert.OrderConvert; +import cn.iocoder.mall.order.vo.OrderItemUpdateVO; +import cn.iocoder.mall.order.vo.OrderLogisticsVO; +import cn.iocoder.mall.order.vo.OrderPageQueryVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 订单API(admins) + * + * @author Sin + * @time 2019-03-24 10:22 + */ +@RestController +@RequestMapping("admins/order") +@Api(description = "订单API(admins)") +public class AdminsOrderController { + + @Autowired + private OrderService orderService; + + @GetMapping("page") + @ApiOperation("订单列表") + public CommonResult> getOrderPage(@RequestBody OrderPageQueryVO orderPageQueryVO) { + OrderQueryDTO orderQueryDTO = OrderConvert.INSTANCE.convertPageBO(orderPageQueryVO); + CommonResult> result = orderService.getOrderPage(orderQueryDTO); + return result; + } + + @PutMapping("order/update") + @ApiOperation("订单item更新") + public CommonResult updateOrderItem(@RequestBody @Validated OrderItemUpdateVO orderItemUpdateVO) { + OrderItemUpdateDTO dto = OrderConvert.INSTANCE.convertPageBO(orderItemUpdateVO); + return orderService.updateOrderItem(dto); + } + + @PutMapping("logistics/update") + @ApiOperation("订单物流更新") + public CommonResult updateLogistics(@RequestBody @Validated OrderLogisticsVO orderLogisticsVO) { + OrderLogisticsUpdateDTO dto = OrderConvert.INSTANCE.convertPageBO(orderLogisticsVO); + return orderService.updateLogistics(dto); + } +} diff --git a/order/order-application/src/main/java/cn/iocoder/mall/order/controller/users/UsersOrderController.java b/order/order-application/src/main/java/cn/iocoder/mall/order/controller/users/UsersOrderController.java new file mode 100644 index 000000000..04e32bfc4 --- /dev/null +++ b/order/order-application/src/main/java/cn/iocoder/mall/order/controller/users/UsersOrderController.java @@ -0,0 +1,15 @@ +package cn.iocoder.mall.order.controller.users; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 订单API(users) + * + * @author Sin + * @time 2019-03-24 11:24 + */ +@RestController +@RequestMapping("users/order") +public class UsersOrderController { +}