refactor:项目结构调整

This commit is contained in:
haoxr 2021-03-15 01:10:04 +08:00
parent 29fde8f974
commit f2f2313d70
3 changed files with 12 additions and 14 deletions

View File

@ -25,12 +25,12 @@ import org.springframework.web.bind.annotation.*;
@AllArgsConstructor
public class CartController {
private ICartService ICartService;
private ICartService cartService;
@ApiOperation(value = "查询购物车", httpMethod = "GET")
@GetMapping
public Result getCart() {
CartVO cart = ICartService.getCart();
CartVO cart = cartService.getCart();
return Result.success(cart);
}
@ -38,7 +38,7 @@ public class CartController {
@ApiImplicitParam(name = "skuId", value = "SKU ID", required = true, paramType = "param", dataType = "Long")
@PostMapping
public Result addCartItem(@RequestParam Long skuId) {
ICartService.addCartItem(skuId);
cartService.addCartItem(skuId);
return Result.success();
}
@ -49,7 +49,7 @@ public class CartController {
Integer num,
Boolean checked
) {
ICartService.updateCartItem(skuId, num, checked);
cartService.updateCartItem(skuId, num, checked);
return Result.success();
}
@ -57,7 +57,7 @@ public class CartController {
@ApiImplicitParam(name = "checked", value = "全选/全不选", required = true, paramType = "param", dataType = "Boolean")
@PatchMapping("/batch")
public Result checkAll(Boolean checked) {
ICartService.checkAll(checked);
cartService.checkAll(checked);
return Result.success();
}
@ -65,14 +65,14 @@ public class CartController {
@ApiImplicitParam(name = "skuId", value = "SKU ID集合", required = true, paramType = "param", dataType = "Long")
@DeleteMapping("/skuId/{skuId}")
public Result deleteCartItem(@PathVariable Long skuId) {
ICartService.deleteCartItem(skuId);
cartService.deleteCartItem(skuId);
return Result.success();
}
@ApiOperation(value = "清空购物车", httpMethod = "DELETE")
@DeleteMapping
public Result deleteCart() {
ICartService.deleteCart();
cartService.deleteCart();
return Result.success();
}
}

View File

@ -27,7 +27,7 @@ import java.util.List;
@AllArgsConstructor
public class OrderController {
private IOrderService IOrderService;
private IOrderService orderService;
/**
* 订单确认信息生成订单
@ -46,7 +46,7 @@ public class OrderController {
Long skuId,
Integer num
) {
OrderConfirmVO confirm = IOrderService.confirm(skuId, num);
OrderConfirmVO confirm = orderService.confirm(skuId, num);
return Result.success(confirm);
}
@ -54,7 +54,7 @@ public class OrderController {
@ApiImplicitParam(name = "orderSubmitVO", value = "提交订单信息", required = true, paramType = "body", dataType = "OrderSubmitVO")
@PostMapping("/_submit")
public Result submit(@Valid @RequestBody OrderSubmitInfoDTO orderSubmitInfoDTO) {
OrderSubmitResultVO result = IOrderService.submit(orderSubmitInfoDTO);
OrderSubmitResultVO result = orderService.submit(orderSubmitInfoDTO);
return Result.success(result);
}
@ -68,9 +68,8 @@ public class OrderController {
@ApiOperation("订单列表查询")
@GetMapping("/list")
public Result<List<OrderListVO>> list(@ApiParam(name = "status", value = "订单状态", required = true, defaultValue = "0")
@RequestParam(value = "status", required = true, defaultValue = "0") Integer status) {
List<OrderListVO> orderList = IOrderService.list(status);
@RequestParam(value = "status", defaultValue = "0") Integer status) {
List<OrderListVO> orderList = orderService.list(status);
return Result.success(orderList);
}

View File

@ -1,6 +1,5 @@
package com.youlai.mall.pms.pojo.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;