This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-samples.git
The following commit(s) were added to refs/heads/master by this push:
new 59b3665a8 update dubbo shop project (#1145)
59b3665a8 is described below
commit 59b3665a83a6eb18d71d1583d3e9c040ba2139d0
Author: kwings6 <[email protected]>
AuthorDate: Wed May 8 19:58:24 2024 +0800
update dubbo shop project (#1145)
---
.../mapper/Checkout/CheckoutServiceMapper.java | 24 --------
.../mapper/GoodsDatails/GoodsDetailsMapper.java | 6 +-
.../dubbo/shop/mapper/HotGoods/HotGoodsMapper.java | 8 ++-
.../dubbo/shop/mapper/NewGoods/NewGoodsMapper.java | 2 +-
.../common/pojo/HotGoodsList/HotGoodsList.java | 18 +-----
.../shop/common/pojo/checkout/CheckoutData.java | 13 +----
.../dubbo/shop/common/pojo/checkout/Good.java | 63 --------------------
.../dubbo/shop/common/pojo/checkout/Summary.java | 43 --------------
.../shop/common/pojo/checkout/UserAddress.java | 67 ----------------------
.../apache/dubbo/shop/service/CheckoutService.java | 2 +-
.../apache/dubbo/shop/service/GoodsDetails.java | 4 +-
.../apache/dubbo/shop/service/HotGoodsService.java | 2 +-
.../src/main/resources/application.yml | 4 +-
.../shop/service/checkout/CheckoutServiceImpl.java | 14 +++--
.../dubbo-shop-service-goodsDetails/pom.xml | 28 +--------
.../goodsDetails/GoodsDatailServiceImpl.java | 8 ++-
.../shop/service/hotGoods/HotGoodsServiceImpl.java | 2 +-
.../shop/service/hotGoods/HotGoodsServiceImpl.java | 32 -----------
.../src/main/resources/application.yml | 2 +-
.../dubbo-shop/dubbo-shop-web-ads/pom.xml | 3 -
.../apache/dubbo/shop/web/ads/AdsController.java | 14 ++++-
.../shop/web/checkout/CheckoutController.java | 6 +-
.../checkout/CheckoutControllerApplication.java | 2 +
.../apache/dubbo/shop/web/checkout/SetGood.java | 47 ---------------
.../web/goodsDetails/GoodsDetailsController.java | 16 ++++--
.../shop/web/hotGoods/HotGoodsController.java | 16 +++---
.../dubbo-shop/dubbo-shop-web-newGoods/pom.xml | 2 -
.../shop/web/newGoods/NewGoodsController.java | 1 +
.../newGoods/NewGoodsControllerApplication.java | 1 -
.../src/main/resources/application.yml | 2 +-
30 files changed, 79 insertions(+), 373 deletions(-)
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/Checkout/CheckoutServiceMapper.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/Checkout/CheckoutServiceMapper.java
deleted file mode 100644
index 28da7b556..000000000
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/Checkout/CheckoutServiceMapper.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.shop.mapper.Checkout;
-import org.apache.dubbo.shop.common.pojo.checkout.CheckoutData;
-import org.apache.ibatis.annotations.Mapper;
-
-@Mapper
-public interface CheckoutServiceMapper {
- public CheckoutData getCheckoutData(Integer orderId);
-}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/GoodsDatails/GoodsDetailsMapper.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/GoodsDatails/GoodsDetailsMapper.java
index 73cce1794..026058b13 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/GoodsDatails/GoodsDetailsMapper.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/GoodsDatails/GoodsDetailsMapper.java
@@ -16,10 +16,12 @@
*/
package org.apache.dubbo.shop.mapper.GoodsDatails;
-import org.apache.dubbo.shop.common.pojo.GoodsDetails.GoodsDetails;
+import org.apache.dubbo.shop.common.pojo.GoodsDetails.Details;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
@Mapper
public interface GoodsDetailsMapper {
- public GoodsDetails getGoodsDetails(Integer id);
+ @Select("select * from goods where id = #{orderId}")
+ public Details getGoodsDetails(Integer orderId);
}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/HotGoods/HotGoodsMapper.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/HotGoods/HotGoodsMapper.java
index 16b5bb938..63fe8b2cc 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/HotGoods/HotGoodsMapper.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/HotGoods/HotGoodsMapper.java
@@ -15,10 +15,12 @@
* limitations under the License.
*/
package org.apache.dubbo.shop.mapper.HotGoods;
-import org.apache.dubbo.shop.common.pojo.HotGoodsList.HotGoodsList;
-import org.apache.dubbo.shop.common.pojo.NewGoodsList.NewGoodsList;
+import org.apache.dubbo.shop.common.pojo.HotGoodsList.HotGood;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
@Mapper
public interface HotGoodsMapper {
- public HotGoodsList getHotGoodsList();
+ @Select("select * from goods where id = #{orderId}")
+ public HotGood getHotGoods(Integer orderId);
}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/NewGoods/NewGoodsMapper.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/NewGoods/NewGoodsMapper.java
index 41bb8ba88..2f9c45e96 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/NewGoods/NewGoodsMapper.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/NewGoods/NewGoodsMapper.java
@@ -25,6 +25,6 @@ import org.springframework.context.annotation.Configuration;
@Mapper
public interface NewGoodsMapper {
- @Select("select * from newgoods where id = #{orderId}")
+ @Select("select * from goods where id = #{orderId}")
public NewGood getNewGoods(Integer orderId);
}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/HotGoodsList/HotGoodsList.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/HotGoodsList/HotGoodsList.java
index 6ee1ae1e0..8c4d10096 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/HotGoodsList/HotGoodsList.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/HotGoodsList/HotGoodsList.java
@@ -17,23 +17,9 @@
package org.apache.dubbo.shop.common.pojo.HotGoodsList;
import lombok.Data;
+import org.apache.dubbo.shop.common.pojo.NewGoodsList.NewGood;
@Data
public class HotGoodsList {
- /**
- * 推荐别名
- */
- private String alt;
- /**
- * 推荐id
- */
- private String id;
- /**
- * 推荐图片
- */
- private String picture;
- /**
- * 推荐标题
- */
- private String title;
+ private HotGood[] hotGoods;
}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/checkout/CheckoutData.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/checkout/CheckoutData.java
index cd3ffd186..4abe21d9f 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/checkout/CheckoutData.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/checkout/CheckoutData.java
@@ -20,16 +20,5 @@ import lombok.Data;
@Data
public class CheckoutData {
- /**
- * 订单商品集合
- */
- private Good[] goods;
- /**
- * 订单总计信息
- */
- private Summary summary;
- /**
- * 订单内用户地址列表
- */
- private UserAddress[] userAddresses;
+ private double postFee;
}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/checkout/Good.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/checkout/Good.java
deleted file mode 100644
index 827052550..000000000
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/checkout/Good.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.shop.common.pojo.checkout;
-
-import lombok.Data;
-
-@Data
-public class Good {
- /**
- * 商品属性
- */
- private String attrsText;
- /**
- * 商品数量,购买数量
- */
- private long count;
- /**
- * 商品id
- */
- private String id;
- /**
- * 商品名字
- */
- private String name;
- /**
- * 商品实付单价
- */
- private String payPrice;
- /**
- * 商品图片
- */
- private String picture;
- /**
- * 商品价格
- */
- private String price;
- /**
- * 商品sku的id
- */
- private String skuId;
- /**
- * 商品实付价格小计
- */
- private String totalPayPrice;
- /**
- * 商品小计总价
- */
- private String totalPrice;
-}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/checkout/Summary.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/checkout/Summary.java
deleted file mode 100644
index 601a02540..000000000
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/checkout/Summary.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.shop.common.pojo.checkout;
-
-import lombok.Data;
-
-@Data
-public class Summary {
- /**
- * 订单总折扣
- */
- private long discountPrice;
- /**
- * 订单总件数
- */
- private long goodsCount;
- /**
- * 订单总邮费
- */
- private long postFee;
- /**
- * 订单总价格实付
- */
- private long totalPayPrice;
- /**
- * 订单总价格
- */
- private long totalPrice;
-}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/checkout/UserAddress.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/checkout/UserAddress.java
deleted file mode 100644
index e1fd2138d..000000000
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/checkout/UserAddress.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.shop.common.pojo.checkout;
-
-import lombok.Data;
-
-@Data
-public class UserAddress {
- /**
- * 收货详细地址
- */
- private String address;
- /**
- * 收货地址标签,用英文逗号分割
- */
- private String addressTags;
- /**
- * 收货地址-城市编码
- */
- private String cityCode;
- /**
- * 收货人-联系方式
- */
- private String contact;
- /**
- * 收货地址-地区编码
- */
- private String countyCode;
- /**
- * 收货完整地址
- */
- private String fullLocation;
- /**
- * 收货地址id
- */
- private String id;
- /**
- * 是否为默认,0是, 1不是
- */
- private long isDefault;
- /**
- * 收货方-邮政编码
- */
- private String postalCode;
- /**
- * 收货地址-省份编码
- */
- private String provinceCode;
- /**
- * 收货人-名字
- */
- private String receiver;
-}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/CheckoutService.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/CheckoutService.java
index de7e79c39..9d4d30280 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/CheckoutService.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/CheckoutService.java
@@ -19,6 +19,6 @@ package org.apache.dubbo.shop.service;
import org.apache.dubbo.shop.common.pojo.checkout.CheckoutData;
public interface CheckoutService {
- public CheckoutData checkoutResult(Integer orderId);
+ public CheckoutData checkoutResult();
}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/GoodsDetails.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/GoodsDetails.java
index d54f41c44..5a2017740 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/GoodsDetails.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/GoodsDetails.java
@@ -16,6 +16,8 @@
*/
package org.apache.dubbo.shop.service;
+import org.apache.dubbo.shop.common.pojo.GoodsDetails.Details;
+
public interface GoodsDetails {
- public GoodsDetails GoodsResult(Integer id);
+ public Details GoodsResult(Integer id);
}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/HotGoodsService.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/HotGoodsService.java
index 59dcd4633..6689b0d9e 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/HotGoodsService.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/HotGoodsService.java
@@ -19,5 +19,5 @@ package org.apache.dubbo.shop.service;
import org.apache.dubbo.shop.common.pojo.HotGoodsList.HotGoodsList;
public interface HotGoodsService {
- public HotGoodsList hotGoodsList();
+ public HotGoodsList hotGoodsListResult();
}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-ads/src/main/resources/application.yml
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-ads/src/main/resources/application.yml
index 79ecd5651..835222375 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-ads/src/main/resources/application.yml
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-ads/src/main/resources/application.yml
@@ -17,7 +17,9 @@ server:
port: 8083
spring:
application:
- name: HotGoodsServiceImpl
+
+ name: AdsServiceImpl
+
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/test_shop
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-checkout/src/main/java/org/apache/duubo/shop/service/checkout/CheckoutServiceImpl.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-checkout/src/main/java/org/apache/duubo/shop/service/checkout/CheckoutServiceImpl.java
index a2782213e..01553ddfe 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-checkout/src/main/java/org/apache/duubo/shop/service/checkout/CheckoutServiceImpl.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-checkout/src/main/java/org/apache/duubo/shop/service/checkout/CheckoutServiceImpl.java
@@ -16,19 +16,21 @@
*/
package org.apache.duubo.shop.service.checkout;
-import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.shop.common.pojo.checkout.CheckoutData;
import org.apache.dubbo.shop.service.CheckoutService;
-import org.apache.dubbo.shop.mapper.Checkout.CheckoutServiceMapper;
@DubboService
public class CheckoutServiceImpl implements CheckoutService{
- @DubboReference
- CheckoutServiceMapper checkoutServiceMapper;
+ /**
+ * this class is only return postFee,if you want to display more info on
the product detail page
+ * you can implement more functions in this class
+ */
+
@Override
- public CheckoutData checkoutResult(Integer orderId) {
- CheckoutData checkoutData =
checkoutServiceMapper.findCheckoutData(orderId);
+ public CheckoutData checkoutResult() {
+ CheckoutData checkoutData = new CheckoutData();
+ checkoutData.setPostFee(10);
return checkoutData;
}
}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-goodsDetails/pom.xml
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-goodsDetails/pom.xml
index d2a535d18..c378021ee 100644
--- a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-goodsDetails/pom.xml
+++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-goodsDetails/pom.xml
@@ -33,43 +33,17 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-spring-boot-starter</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-log4j2</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-nacos-spring-boot-starter</artifactId>
- </dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-shop-interface</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
-
<dependency>
<groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-shop-common-mapper</artifactId>
+ <artifactId> dubbo-shop-common-mapper</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
-
</dependencies>
<build>
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-goodsDetails/src/main/java/org/apache/dubbo/shop/service/goodsDetails/GoodsDatailServiceImpl.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-goodsDetails/src/main/java/org/apache/dubbo/shop/service/goodsDetails/GoodsDatailServiceImpl.java
index db6d77387..6acf52554 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-goodsDetails/src/main/java/org/apache/dubbo/shop/service/goodsDetails/GoodsDatailServiceImpl.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-goodsDetails/src/main/java/org/apache/dubbo/shop/service/goodsDetails/GoodsDatailServiceImpl.java
@@ -18,6 +18,7 @@ package org.apache.dubbo.shop.service.goodsDetails;
import org.apache.dubbo.config.annotation.DubboService;
+import org.apache.dubbo.shop.common.pojo.GoodsDetails.Details;
import org.apache.dubbo.shop.mapper.GoodsDatails.GoodsDetailsMapper;
import org.apache.dubbo.shop.service.GoodsDetails;
import org.springframework.beans.factory.annotation.Autowired;
@@ -27,7 +28,10 @@ public class GoodsDatailServiceImpl implements GoodsDetails {
@Autowired
GoodsDetailsMapper goodsDetailsMapper;
@Override
- public GoodsDetails GoodsResult(Integer id) {
- return null;
+ public Details GoodsResult(Integer id) {
+ Details details = goodsDetailsMapper.getGoodsDetails(id);
+ //为了传给前端mainPictures这个名字的参数,进行数据处理
+ details.setMainPictures(details.getPicture());
+ return details;
}
}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-hotGoods/src/main/java/org/apache/dubbo/shop/service/hotGoods/HotGoodsServiceImpl.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-hotGoods/src/main/java/org/apache/dubbo/shop/service/hotGoods/HotGoodsServiceImpl.java
index 786bd01c9..2f38bbda2 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-hotGoods/src/main/java/org/apache/dubbo/shop/service/hotGoods/HotGoodsServiceImpl.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-hotGoods/src/main/java/org/apache/dubbo/shop/service/hotGoods/HotGoodsServiceImpl.java
@@ -16,7 +16,7 @@
*/
package org.apache.dubbo.shop.service.hotGoods;
-import org.apache.dubbo.config.annotation.DubboReference;
+
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.shop.common.pojo.HotGoodsList.HotGood;
import org.apache.dubbo.shop.common.pojo.HotGoodsList.HotGoodsList;
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-hotGoods/src/main/java/org/apache/dubo/shop/service/hotGoods/HotGoodsServiceImpl.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-hotGoods/src/main/java/org/apache/dubo/shop/service/hotGoods/HotGoodsServiceImpl.java
deleted file mode 100644
index 397811633..000000000
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-hotGoods/src/main/java/org/apache/dubo/shop/service/hotGoods/HotGoodsServiceImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubo.shop.service.hotGoods;
-
-import org.apache.dubbo.config.annotation.DubboReference;
-import org.apache.dubbo.shop.common.pojo.HotGoodsList.HotGoodsList;
-import org.apache.dubbo.shop.mapper.HotGoods.HotGoodsMapper;
-import org.apache.dubbo.shop.mapper.NewGoods.NewGoodsMapper;
-import org.apache.dubbo.shop.service.HotGoodsService;
-
-public class HotGoodsServiceImpl implements HotGoodsService {
- @DubboReference
- HotGoodsMapper hotGoodsMapper;
- @Override
- public HotGoodsList hotGoodsList() {
- return null;
- }
-}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-newGoods/src/main/resources/application.yml
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-newGoods/src/main/resources/application.yml
index 5aebbc3cf..dc210e138 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-newGoods/src/main/resources/application.yml
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-newGoods/src/main/resources/application.yml
@@ -30,5 +30,5 @@ dubbo:
registry:
address:
nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos
protocol:
- port: 20882
+ port: 20880
name: dubbo
diff --git a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-ads/pom.xml
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-ads/pom.xml
index d2136fdc6..1add72d9d 100644
--- a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-ads/pom.xml
+++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-ads/pom.xml
@@ -63,10 +63,7 @@
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
-
-
</dependencies>
-
<build>
<plugins>
<plugin>
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-ads/src/main/java/org/apache/dubbo/shop/web/ads/AdsController.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-ads/src/main/java/org/apache/dubbo/shop/web/ads/AdsController.java
index 2e9024189..4adec20a2 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-ads/src/main/java/org/apache/dubbo/shop/web/ads/AdsController.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-ads/src/main/java/org/apache/dubbo/shop/web/ads/AdsController.java
@@ -16,8 +16,14 @@
*/
package org.apache.dubbo.shop.web.ads;
+import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.shop.common.ReturnResult;
+import org.apache.dubbo.shop.common.pojo.Ads.AdsGood;
+import org.apache.dubbo.shop.common.pojo.Ads.AdsGoodsList;
+import org.apache.dubbo.shop.common.pojo.HotGoodsList.HotGoodsList;
+import org.apache.dubbo.shop.service.AdsService;
import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -25,7 +31,13 @@ import
org.springframework.web.bind.annotation.RestController;
@Component
@RestController
@RequestMapping("/goods")
+@CrossOrigin(originPatterns = "*",allowCredentials = "true")
public class AdsController {
+ @DubboReference
+ AdsService adsService;
@GetMapping("/hot")
- public ReturnResult
+ public ReturnResult adsGoosList(){
+ AdsGoodsList adsGoodsList = adsService.adsGoodsListResult();
+ return ReturnResult.success(adsGoodsList);
+ }
}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-checkout/src/main/java/org/apache/dubbo/shop/web/checkout/CheckoutController.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-checkout/src/main/java/org/apache/dubbo/shop/web/checkout/CheckoutController.java
index 5db5d0a60..f5cd820de 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-checkout/src/main/java/org/apache/dubbo/shop/web/checkout/CheckoutController.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-checkout/src/main/java/org/apache/dubbo/shop/web/checkout/CheckoutController.java
@@ -27,13 +27,13 @@ import org.springframework.web.bind.annotation.*;
@Component
@RestController
@RequestMapping("/member")
-@CrossOrigin(origins = "*")
+@CrossOrigin(originPatterns = "*",allowCredentials = "true")
public class CheckoutController {
@DubboReference
CheckoutService checkoutService;
@GetMapping("/order")
- public ReturnResult checkout(Integer orderId){
- CheckoutData checkoutData = checkoutService.checkoutResult(orderId);
+ public ReturnResult checkout(){
+ CheckoutData checkoutData = checkoutService.checkoutResult();
return ReturnResult.success(checkoutData);
}
}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-checkout/src/main/java/org/apache/dubbo/shop/web/checkout/CheckoutControllerApplication.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-checkout/src/main/java/org/apache/dubbo/shop/web/checkout/CheckoutControllerApplication.java
index 09afcd777..95cbc14a9 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-checkout/src/main/java/org/apache/dubbo/shop/web/checkout/CheckoutControllerApplication.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-checkout/src/main/java/org/apache/dubbo/shop/web/checkout/CheckoutControllerApplication.java
@@ -16,11 +16,13 @@
*/
package org.apache.dubbo.shop.web.checkout;
+import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
+@EnableDubbo
public class CheckoutControllerApplication {
public static void main(String[] args) {
SpringApplication.run(CheckoutControllerApplication.class, args);
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-checkout/src/main/java/org/apache/dubbo/shop/web/checkout/SetGood.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-checkout/src/main/java/org/apache/dubbo/shop/web/checkout/SetGood.java
deleted file mode 100644
index 5ab8bdced..000000000
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-checkout/src/main/java/org/apache/dubbo/shop/web/checkout/SetGood.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.shop.web.checkout;
-
-import org.apache.dubbo.shop.attributeClass.checkout.Good;
-import org.apache.dubbo.shop.attributeClass.checkout.Summary;
-
-public class SetGood {
- public static Good[] setgood(){
- Good[] goods = new Good[1];
- Good good = new Good();
- good.setId("1");
- good.setCount(1);
- good.setName("toukui");
- good.setPicture("/assets/images/liuying.png");
- good.setPrice("190");
- good.setAttrsText("好货");
- good.setSkuId("1");
- good.setTotalPayPrice("190");
- good.setPayPrice("190");
- good.setTotalPrice("190");
- goods[0] = good;
- return goods;
- }
- public static Summary setSummary(){
- Summary summary = new Summary();
- summary.setGoodsCount(1);
- summary.setTotalPrice(190);
- summary.setDiscountPrice(0);
- summary.setPostFee(100);
- return summary;
- }
-}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-goodsDetails/src/main/java/oeg/apache/dubbo/shop/web/goodsDetails/GoodsDetailsController.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-goodsDetails/src/main/java/oeg/apache/dubbo/shop/web/goodsDetails/GoodsDetailsController.java
index b54ad49fa..56bc96ebd 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-goodsDetails/src/main/java/oeg/apache/dubbo/shop/web/goodsDetails/GoodsDetailsController.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-goodsDetails/src/main/java/oeg/apache/dubbo/shop/web/goodsDetails/GoodsDetailsController.java
@@ -16,18 +16,26 @@
*/
package oeg.apache.dubbo.shop.web.goodsDetails;
+import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.shop.common.ReturnResult;
+import org.apache.dubbo.shop.common.pojo.GoodsDetails.Details;
+import org.apache.dubbo.shop.service.GoodsDetails;
import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
-
@Component
@RestController
+@RequestMapping("/detail")
+@CrossOrigin(originPatterns = "*",allowCredentials = "true")
public class GoodsDetailsController {
- @GetMapping("/goods")
- public ReturnResult GoodsDetailsList(@RequestParam Integer id){
-
+ @DubboReference
+ GoodsDetails goodsDetails;
+ @GetMapping("/id")
+ public ReturnResult GoodsDetailsList(@RequestParam("id") Integer id){
+ Details details = goodsDetails.GoodsResult(id);
+ return ReturnResult.success(details);
}
}
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-hotGoods/src/main/java/org/apache/dubbo/shop/web/hotGoods/HotGoodsController.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-hotGoods/src/main/java/org/apache/dubbo/shop/web/hotGoods/HotGoodsController.java
index 840ab30bf..5ff01b74c 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-hotGoods/src/main/java/org/apache/dubbo/shop/web/hotGoods/HotGoodsController.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-hotGoods/src/main/java/org/apache/dubbo/shop/web/hotGoods/HotGoodsController.java
@@ -18,22 +18,24 @@ package org.apache.dubbo.shop.web.hotGoods;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.shop.common.ReturnResult;
-import org.apache.dubbo.shop.common.pojo.NewGoodsList.NewGoodsList;
-import org.apache.dubbo.shop.service.NewGoodsService;
+import org.apache.dubbo.shop.common.pojo.HotGoodsList.HotGoodsList;
+import org.apache.dubbo.shop.service.HotGoodsService;
import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Component
@RestController
-@RequestMapping("good")
+@RequestMapping("/good")
+@CrossOrigin(originPatterns = "*",allowCredentials = "true")
public class HotGoodsController {
@DubboReference
- NewGoodsService newGoodsService;
- @GetMapping("hot")
+ HotGoodsService hotGoodsService;
+ @GetMapping("/hot")
public ReturnResult newGoodsList(){
- NewGoodsList newGoodsList = newGoodsService.newGoodsListResult();
- return ReturnResult.success(newGoodsList);
+ HotGoodsList hotGoodsList = hotGoodsService.hotGoodsListResult();
+ return ReturnResult.success(hotGoodsList);
}
}
diff --git a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/pom.xml
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/pom.xml
index b73880bc3..b435583e8 100644
--- a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/pom.xml
+++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/pom.xml
@@ -63,8 +63,6 @@
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
-
-
</dependencies>
<build>
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/src/main/java/org/apache/dubbo/shop/web/newGoods/NewGoodsController.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/src/main/java/org/apache/dubbo/shop/web/newGoods/NewGoodsController.java
index 80972f66f..a53f37074 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/src/main/java/org/apache/dubbo/shop/web/newGoods/NewGoodsController.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/src/main/java/org/apache/dubbo/shop/web/newGoods/NewGoodsController.java
@@ -19,6 +19,7 @@ package org.apache.dubbo.shop.web.newGoods;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.shop.common.ReturnResult;
import org.apache.dubbo.shop.common.pojo.NewGoodsList.NewGoodsList;
+import org.apache.dubbo.shop.common.ReturnResult;
import org.apache.dubbo.shop.service.NewGoodsService;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.CrossOrigin;
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/src/main/java/org/apache/dubbo/shop/web/newGoods/NewGoodsControllerApplication.java
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/src/main/java/org/apache/dubbo/shop/web/newGoods/NewGoodsControllerApplication.java
index bae137e5e..817778de2 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/src/main/java/org/apache/dubbo/shop/web/newGoods/NewGoodsControllerApplication.java
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/src/main/java/org/apache/dubbo/shop/web/newGoods/NewGoodsControllerApplication.java
@@ -15,7 +15,6 @@
* limitations under the License.
*/
package org.apache.dubbo.shop.web.newGoods;
-
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/src/main/resources/application.yml
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/src/main/resources/application.yml
index 1085a5b2c..f2370e85b 100644
---
a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/src/main/resources/application.yml
+++
b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-newGoods/src/main/resources/application.yml
@@ -24,5 +24,5 @@ dubbo:
registry:
address:
nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos
protocol:
- port: 20883
+ port: 20881
name: dubbo
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]