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

View File

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

View File

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