| | |
| | | package cc.mrbird.febs.mall.controller; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.mall.dto.AddOrderDto; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.service.IApiMallOrderInfoService; |
| | | import cc.mrbird.febs.mall.vo.OrderDetailVo; |
| | | import cc.mrbird.febs.mall.vo.OrderListVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | | @CrossOrigin("*") |
| | | @RequiredArgsConstructor |
| | | @RequestMapping(value = "/api/order") |
| | | @Api(value = "ApiMallOrderController", tags = "订单接口类") |
| | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "支付订单", notes = "支付订单") |
| | | @PostMapping(value = "/payOrder") |
| | | public FebsResponse payOrder(@RequestBody PayOrderDto payOrderDto) { |
| | | Map<String, Object> result = mallOrderInfoService.payOrder(payOrderDto); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("order", result); |
| | | map.put("type", payOrderDto.getType()); |
| | | return new FebsResponse().success().data(map).message("支付成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单列表", notes = "订单列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = OrderListVo.class) |
| | | }) |
| | | @PostMapping(value = "/orderList") |
| | | public FebsResponse orderList(@RequestBody OrderListDto orderListDto) { |
| | | return new FebsResponse().success().data(mallOrderInfoService.findOrderList(orderListDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单详情", notes = "订单详情") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = OrderDetailVo.class) |
| | | }) |
| | | @GetMapping(value = "/orderDetails/{id}") |
| | | public FebsResponse orderDetails(@PathVariable("id") Long id) { |
| | | return new FebsResponse().success().data(mallOrderInfoService.findOrderDetailsById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "确认收货", notes = "确认收货") |
| | | @PostMapping(value = "/confirm/{id}") |
| | | public FebsResponse confirm(@PathVariable("id") Long id) { |
| | | mallOrderInfoService.confirmOrder(id); |
| | | return new FebsResponse().success().message("确认成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除订单", notes = "删除订单") |
| | | @PostMapping(value = "/delOrder/{id}") |
| | | public FebsResponse delOrder(@PathVariable("id") Long id) { |
| | | mallOrderInfoService.delOrder(id); |
| | | return new FebsResponse().success().message("删除成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "提交退款申请", notes = "提交退款申请") |
| | | @PostMapping(value = "/applyRefund") |
| | | public FebsResponse applyRefund(@RequestBody AddRefundDto addRefundDto) { |
| | | mallOrderInfoService.applyRefund(addRefundDto); |
| | | return new FebsResponse().success().message("提交成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "提交退款物流信息", notes = "提交退款物流信息") |
| | | @PostMapping(value = "/refundExpress") |
| | | public FebsResponse refundExpress(@RequestBody RefundExpressDto refundExpressDto) { |
| | | mallOrderInfoService.refundExpress(refundExpressDto); |
| | | return new FebsResponse().success().message("提交成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "评价", notes = "评价") |
| | | @PostMapping(value = "/goodsComment") |
| | | public FebsResponse goodsComment(@RequestBody ApiAddCommentDtos addCommentDtos) { |
| | | mallOrderInfoService.goodsComment(addCommentDtos); |
| | | return new FebsResponse().success().message("评价成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看银行卡是否签约", notes = "查看银行卡是否签约") |
| | | @PostMapping(value = "/bangCardSign") |
| | | public FebsResponse bangCardSign(@RequestBody BangCardSignDto bangCardSignDto) { |
| | | return mallOrderInfoService.bangCardSign(bangCardSignDto); |
| | | } |
| | | |
| | | } |