From 3e485c2d0ff17163dcdee0c906d376ac33b05f92 Mon Sep 17 00:00:00 2001
From: YunaiV <>
Date: Tue, 9 Apr 2019 23:39:38 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E7=AB=AF=EF=BC=9A=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E6=A8=A1=E5=9D=97=EF=BC=8C=E5=90=88?=
=?UTF-8?q?=E5=B9=B6=E5=88=B0=E8=AE=A2=E5=8D=95=E6=A8=A1=E5=9D=97=20?=
=?UTF-8?q?=E5=90=8E=E7=AB=AF=EF=BC=9A=E8=AE=BE=E8=AE=A1=E8=AE=A2=E5=8D=95?=
=?UTF-8?q?=E4=BB=B7=E6=A0=BC=E8=AE=A1=E7=AE=97=E7=9B=B8=E5=85=B3=E6=96=B9?=
=?UTF-8?q?=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
cart/cart-application/pom.xml | 70 ------------
.../cart/application/CartApplication.java | 13 ---
.../application/config/MVCConfiguration.java | 42 --------
.../config/SwaggerConfiguration.java | 36 -------
.../src/main/resources/application.yaml | 9 --
cart/cart-service-api/pom.xml | 40 -------
.../cn/iocoder/mall/cart/api/CartService.java | 4 -
.../cart/api/constant/CartErrorCodeEnum.java | 28 -----
cart/cart-service-impl/pom.xml | 66 ------------
.../biz/config/DatabaseConfiguration.java | 14 ---
.../config/ServiceExceptionConfiguration.java | 19 ----
.../iocoder/mall/cart/biz/package-info.java | 1 -
.../main/resources/config/application.yaml | 44 --------
cart/pom.xml | 21 ----
.../controller/users/UsersCartController.java | 22 ++++
.../users/UsersOrderController.java | 1 -
.../order/application/vo/FeeMessageVO.java | 26 +++++
.../order/application/vo/UsersCartItemVO.java | 5 +
.../order/application/vo/UsersCartListVO.java | 11 ++
.../iocoder/mall/order/api/CartService.java | 99 +++++++++++++++++
.../iocoder/mall/order/api/OrderService.java | 13 ++-
.../mall/order/api/bo/CalcOrderPriceBO.java | 99 +++++++++++++++++
.../cn/iocoder/mall/order/api/bo/CartBO.java | 24 +++++
.../iocoder/mall/order/api/bo/CartItemBO.java | 15 +++
.../mall/order/api/bo/CartItemGroupBO.java | 21 ++++
.../mall/order/api/bo/FeeDetailBO.java | 4 +
.../mall/order/api/bo/FeeMessageBO.java | 26 +++++
.../mall/order/api/bo/MerchantItemGroup.java | 19 ++++
.../mall/order/api/bo/PostageDetailBO.java | 14 +++
.../mall/order/api/dto/CalcOrderPriceDTO.java | 41 +++++++
.../mall/order/biz/dataobject/CartItemDO.java | 100 ++++++++++++++++++
pom.xml | 1 -
32 files changed, 535 insertions(+), 413 deletions(-)
delete mode 100644 cart/cart-application/pom.xml
delete mode 100644 cart/cart-application/src/main/java/cn/iocoder/mall/cart/application/CartApplication.java
delete mode 100644 cart/cart-application/src/main/java/cn/iocoder/mall/cart/application/config/MVCConfiguration.java
delete mode 100644 cart/cart-application/src/main/java/cn/iocoder/mall/cart/application/config/SwaggerConfiguration.java
delete mode 100644 cart/cart-application/src/main/resources/application.yaml
delete mode 100644 cart/cart-service-api/pom.xml
delete mode 100644 cart/cart-service-api/src/main/java/cn/iocoder/mall/cart/api/CartService.java
delete mode 100644 cart/cart-service-api/src/main/java/cn/iocoder/mall/cart/api/constant/CartErrorCodeEnum.java
delete mode 100644 cart/cart-service-impl/pom.xml
delete mode 100644 cart/cart-service-impl/src/main/java/cn/iocoder/mall/cart/biz/config/DatabaseConfiguration.java
delete mode 100644 cart/cart-service-impl/src/main/java/cn/iocoder/mall/cart/biz/config/ServiceExceptionConfiguration.java
delete mode 100644 cart/cart-service-impl/src/main/java/cn/iocoder/mall/cart/biz/package-info.java
delete mode 100644 cart/cart-service-impl/src/main/resources/config/application.yaml
delete mode 100644 cart/pom.xml
create mode 100644 order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/UsersCartController.java
create mode 100644 order/order-application/src/main/java/cn/iocoder/mall/order/application/vo/FeeMessageVO.java
create mode 100644 order/order-application/src/main/java/cn/iocoder/mall/order/application/vo/UsersCartItemVO.java
create mode 100644 order/order-application/src/main/java/cn/iocoder/mall/order/application/vo/UsersCartListVO.java
create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/CartService.java
create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/CalcOrderPriceBO.java
create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/CartBO.java
create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/CartItemBO.java
create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/CartItemGroupBO.java
create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/FeeDetailBO.java
create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/FeeMessageBO.java
create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/MerchantItemGroup.java
create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/PostageDetailBO.java
create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/CalcOrderPriceDTO.java
create mode 100644 order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/CartItemDO.java
diff --git a/cart/cart-application/pom.xml b/cart/cart-application/pom.xml
deleted file mode 100644
index 4043c93b7..000000000
--- a/cart/cart-application/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
- cart
- cn.iocoder.mall
- 1.0-SNAPSHOT
-
- 4.0.0
-
- cart-application
-
-
-
-
- cn.iocoder.mall
- common-framework
- 1.0-SNAPSHOT
-
-
-
- cn.iocoder.mall
- user-sdk
- 1.0-SNAPSHOT
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
- com.alibaba
- dubbo
-
-
- com.alibaba.boot
- dubbo-spring-boot-starter
-
-
-
- org.apache.curator
- curator-framework
-
-
-
- io.springfox
- springfox-swagger2
-
-
- io.springfox
- springfox-swagger-ui
-
-
-
- org.springframework.boot
- spring-boot-devtools
- true
-
-
-
-
-
diff --git a/cart/cart-application/src/main/java/cn/iocoder/mall/cart/application/CartApplication.java b/cart/cart-application/src/main/java/cn/iocoder/mall/cart/application/CartApplication.java
deleted file mode 100644
index c65c010b8..000000000
--- a/cart/cart-application/src/main/java/cn/iocoder/mall/cart/application/CartApplication.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package cn.iocoder.mall.cart.application;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication(scanBasePackages = {"cn.iocoder.mall.cart"})
-public class CartApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(CartApplication.class, args);
- }
-
-}
diff --git a/cart/cart-application/src/main/java/cn/iocoder/mall/cart/application/config/MVCConfiguration.java b/cart/cart-application/src/main/java/cn/iocoder/mall/cart/application/config/MVCConfiguration.java
deleted file mode 100644
index c1c5c7bcc..000000000
--- a/cart/cart-application/src/main/java/cn/iocoder/mall/cart/application/config/MVCConfiguration.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package cn.iocoder.mall.cart.application.config;
-
-import cn.iocoder.common.framework.config.GlobalExceptionHandler;
-import cn.iocoder.common.framework.servlet.CorsFilter;
-import org.springframework.boot.web.servlet.FilterRegistrationBean;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-import org.springframework.web.servlet.config.annotation.*;
-
-@EnableWebMvc
-@Configuration
-@Import(value = {GlobalExceptionHandler.class}) // 统一全局返回
-public class MVCConfiguration implements WebMvcConfigurer {
-
-// @Autowired
-// private SecurityInterceptor securityInterceptor;
-
-// @Reference
-// private OAuth2Service oauth2Service;
-
- @Override
- public void addInterceptors(InterceptorRegistry registry) {
-// registry.addInterceptor(securityInterceptor);
- }
-
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- // 解决 swagger-ui.html 的访问,参考自 https://stackoverflow.com/questions/43545540/swagger-ui-no-mapping-found-for-http-request 解决
- registry.addResourceHandler("swagger-ui.html**").addResourceLocations("classpath:/META-INF/resources/swagger-ui.html");
- registry.addResourceHandler("webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
- }
-
- @Bean
- public FilterRegistrationBean corsFilter() {
- FilterRegistrationBean registrationBean = new FilterRegistrationBean<>();
- registrationBean.setFilter(new CorsFilter());
- registrationBean.addUrlPatterns("/*");
- return registrationBean;
- }
-
-}
diff --git a/cart/cart-application/src/main/java/cn/iocoder/mall/cart/application/config/SwaggerConfiguration.java b/cart/cart-application/src/main/java/cn/iocoder/mall/cart/application/config/SwaggerConfiguration.java
deleted file mode 100644
index d52f167cf..000000000
--- a/cart/cart-application/src/main/java/cn/iocoder/mall/cart/application/config/SwaggerConfiguration.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package cn.iocoder.mall.cart.application.config;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-@Configuration
-@EnableSwagger2
-public class SwaggerConfiguration {
-
- @Bean
- public Docket createRestApi() {
- return new Docket(DocumentationType.SWAGGER_2)
- .apiInfo(apiInfo())
- .select()
- .apis(RequestHandlerSelectors.basePackage("cn.iocoder.mall.biz.application.controller"))
- .paths(PathSelectors.any())
- .build();
- }
-
- private ApiInfo apiInfo() {
- return new ApiInfoBuilder()
- .title("购物车子系统")
- .description("购物车子系统")
- .termsOfServiceUrl("http://www.iocoder.cn")
- .version("1.0.0")
- .build();
- }
-
-}
diff --git a/cart/cart-application/src/main/resources/application.yaml b/cart/cart-application/src/main/resources/application.yaml
deleted file mode 100644
index c925f363d..000000000
--- a/cart/cart-application/src/main/resources/application.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-spring:
- application:
- name: cart-application
-
-# server
-server:
- port: 18086
- servlet:
- context-path: /cart-api/
diff --git a/cart/cart-service-api/pom.xml b/cart/cart-service-api/pom.xml
deleted file mode 100644
index d301868b7..000000000
--- a/cart/cart-service-api/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
- cart
- cn.iocoder.mall
- 1.0-SNAPSHOT
-
- 4.0.0
-
- cart-service-api
-
-
-
- cn.iocoder.mall
- common-framework
- 1.0-SNAPSHOT
-
-
-
- javax.validation
- validation-api
-
-
-
- org.mapstruct
- mapstruct
-
-
- org.mapstruct
- mapstruct-jdk8
-
-
- org.projectlombok
- lombok
-
-
-
-
diff --git a/cart/cart-service-api/src/main/java/cn/iocoder/mall/cart/api/CartService.java b/cart/cart-service-api/src/main/java/cn/iocoder/mall/cart/api/CartService.java
deleted file mode 100644
index 47a6a8311..000000000
--- a/cart/cart-service-api/src/main/java/cn/iocoder/mall/cart/api/CartService.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package cn.iocoder.mall.cart.api;
-
-public interface CartService {
-}
diff --git a/cart/cart-service-api/src/main/java/cn/iocoder/mall/cart/api/constant/CartErrorCodeEnum.java b/cart/cart-service-api/src/main/java/cn/iocoder/mall/cart/api/constant/CartErrorCodeEnum.java
deleted file mode 100644
index 0dae7880b..000000000
--- a/cart/cart-service-api/src/main/java/cn/iocoder/mall/cart/api/constant/CartErrorCodeEnum.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cn.iocoder.mall.cart.api.constant;
-
-/**
- * 错误码枚举类
- *
- * 购物车系统,使用 1-005-000-000 段
- */
-public enum CartErrorCodeEnum {
-
- ;
-
- private final int code;
- private final String message;
-
- CartErrorCodeEnum(int code, String message) {
- this.code = code;
- this.message = message;
- }
-
- public int getCode() {
- return code;
- }
-
- public String getMessage() {
- return message;
- }
-
-}
diff --git a/cart/cart-service-impl/pom.xml b/cart/cart-service-impl/pom.xml
deleted file mode 100644
index 96e609cee..000000000
--- a/cart/cart-service-impl/pom.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
- cart
- cn.iocoder.mall
- 1.0-SNAPSHOT
-
- 4.0.0
-
- cart-service-impl
-
-
-
- com.alibaba
- dubbo
-
-
- cn.iocoder.mall
- cart-service-api
- 1.0-SNAPSHOT
-
-
-
- mysql
- mysql-connector-java
-
-
- org.springframework.boot
- spring-boot-starter-jdbc
-
-
-
- org.mybatis.spring.boot
- mybatis-spring-boot-starter
-
-
-
- com.google.guava
- guava
-
-
-
- com.xuxueli
- xxl-job-core
-
-
-
- org.apache.rocketmq
- rocketmq-spring-boot-starter
-
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
-
-
-
-
diff --git a/cart/cart-service-impl/src/main/java/cn/iocoder/mall/cart/biz/config/DatabaseConfiguration.java b/cart/cart-service-impl/src/main/java/cn/iocoder/mall/cart/biz/config/DatabaseConfiguration.java
deleted file mode 100644
index 375a47b3e..000000000
--- a/cart/cart-service-impl/src/main/java/cn/iocoder/mall/cart/biz/config/DatabaseConfiguration.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package cn.iocoder.mall.cart.biz.config;
-
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.transaction.annotation.EnableTransactionManagement;
-
-@Configuration
-@MapperScan("cn.iocoder.mall.cart.biz.dao") // 扫描对应的 Mapper 接口
-@EnableTransactionManagement(proxyTargetClass = true) // 启动事务管理。为什么使用 proxyTargetClass 参数,参见 https://blog.csdn.net/huang_550/article/details/76492600
-public class DatabaseConfiguration {
-
- // 数据源,使用 HikariCP
-
-}
diff --git a/cart/cart-service-impl/src/main/java/cn/iocoder/mall/cart/biz/config/ServiceExceptionConfiguration.java b/cart/cart-service-impl/src/main/java/cn/iocoder/mall/cart/biz/config/ServiceExceptionConfiguration.java
deleted file mode 100644
index 40263e309..000000000
--- a/cart/cart-service-impl/src/main/java/cn/iocoder/mall/cart/biz/config/ServiceExceptionConfiguration.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package cn.iocoder.mall.cart.biz.config;
-
-import cn.iocoder.common.framework.util.ServiceExceptionUtil;
-import cn.iocoder.mall.cart.api.constant.CartErrorCodeEnum;
-import org.springframework.boot.context.event.ApplicationReadyEvent;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.event.EventListener;
-
-@Configuration
-public class ServiceExceptionConfiguration {
-
- @EventListener(ApplicationReadyEvent.class) // 可参考 https://www.cnblogs.com/ssslinppp/p/7607509.html
- public void initMessages() {
- for (CartErrorCodeEnum item : CartErrorCodeEnum.values()) {
- ServiceExceptionUtil.put(item.getCode(), item.getMessage());
- }
- }
-
-}
diff --git a/cart/cart-service-impl/src/main/java/cn/iocoder/mall/cart/biz/package-info.java b/cart/cart-service-impl/src/main/java/cn/iocoder/mall/cart/biz/package-info.java
deleted file mode 100644
index 5fcec432d..000000000
--- a/cart/cart-service-impl/src/main/java/cn/iocoder/mall/cart/biz/package-info.java
+++ /dev/null
@@ -1 +0,0 @@
-package cn.iocoder.mall.cart.biz;
diff --git a/cart/cart-service-impl/src/main/resources/config/application.yaml b/cart/cart-service-impl/src/main/resources/config/application.yaml
deleted file mode 100644
index fc176627c..000000000
--- a/cart/cart-service-impl/src/main/resources/config/application.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
-spring:
- # datasource
- datasource:
- url: jdbc:mysql://180.167.213.26:13306/mall_cart?useSSL=false&useUnicode=true&characterEncoding=UTF-8
- driver-class-name: com.mysql.jdbc.Driver
- username: root
- password: ${MALL_MYSQL_PASSWORD}
-
-# mybatis
-mybatis:
- config-location: classpath:mybatis-config.xml
- mapper-locations: classpath:mapper/*.xml
- type-aliases-package: cn.iocoder.mall.cart.biz.dataobject
-
-# dubbo
-dubbo:
- application:
- name: cart-service
- registry:
- address: zookeeper://127.0.0.1:2181
- protocol:
- port: -1
- name: dubbo
- scan:
- base-packages: cn.iocoder.mall.cart.biz.service
-
-# xxl-job
-#xxl:
-# job:
-# admin:
-# addresses: http://127.0.0.1:8080/xxl-job-admin
-# executor:
-# appname: cart-job-executor
-# ip:
-# port: 0
-# logpath: /Users/yunai/logs/xxl-job/
-# logretentiondays: 1
-# accessToken:
-
-# rocketmq
-#rocketmq:
-# name-server: 127.0.0.1:9876
-# producer:
-# group: cart-producer-group
diff --git a/cart/pom.xml b/cart/pom.xml
deleted file mode 100644
index dc05e2d77..000000000
--- a/cart/pom.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
- mall-parent
- cn.iocoder.mall
- 1.0-SNAPSHOT
-
- 4.0.0
-
- cart
- pom
-
- cart-application
- cart-service-api
- cart-service-impl
-
-
-
-
diff --git a/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/UsersCartController.java b/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/UsersCartController.java
new file mode 100644
index 000000000..4408f8746
--- /dev/null
+++ b/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/UsersCartController.java
@@ -0,0 +1,22 @@
+package cn.iocoder.mall.order.application.controller.users;
+
+import cn.iocoder.common.framework.vo.CommonResult;
+import cn.iocoder.mall.order.api.CartService;
+import cn.iocoder.mall.order.api.OrderService;
+
+public class UsersCartController {
+
+ // TODO 注入
+ private CartService cartService;
+ // TODO 注入
+ private OrderService orderService;
+
+ public CommonResult