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 cbb84d00f Complete shop sample (#1144) cbb84d00f is described below commit cbb84d00fec9eed05f17387fa11b569d71b457f7 Author: kwings6 <151895399+kwin...@users.noreply.github.com> AuthorDate: Wed May 8 14:47:35 2024 +0800 Complete shop sample (#1144) --- .../dubbo/shop/mapper/Ads/AdsServiceMapper.java} | 18 +++---- .../dubbo/shop/common/pojo/Ads/AdsGood.java} | 33 ++++++++---- .../dubbo/shop/common/pojo/Ads/AdsGoodsList.java} | 15 +++--- .../shop/common/pojo/GoodsDetails/Details.java} | 34 +++++++++---- .../shop/common/pojo/HotGoodsList/HotGood.java} | 29 +++++++---- .../org/apache/dubbo/shop/service/AdsService.java} | 14 ++--- .../dubbo-shop/dubbo-shop-service-ads/pom.xml | 32 ++++++++++++ .../dubbo/shop/service/ads/AdsServiceImpl.java | 43 ++++++++++++++++ .../service/ads/AdsServiceImplApplication.java} | 21 ++++---- .../src/main/resources/application.yml | 36 +++++++++++++ .../checkout/CheckoutServiceImplApplication.java} | 21 ++++---- .../src/main/resources/application.yml | 36 +++++++++++++ .../GoodsDetailServiceImplApplication.java} | 21 ++++---- .../src/main/resources/application.yml | 36 +++++++++++++ .../shop/service/hotGoods/HotGoodsServiceImpl.java | 44 ++++++++++++++++ .../hotGoods/HotGoodsServiceImplApplication.java} | 21 ++++---- .../src/main/resources/application.yml | 36 +++++++++++++ .../shop/web/ads/AdsControllerApplication.java} | 19 +++---- .../src/main/resources/application.yml | 28 ++++++++++ .../src/main/resources/application.yml | 28 ++++++++++ .../GoodsDetailsControllerApplication.java} | 19 +++---- .../src/main/resources/application.yml | 28 ++++++++++ .../hotGoods/HotGoodsControllerApplication.java} | 19 +++---- .../src/main/resources/application.yml | 28 ++++++++++ dubbo-samples-shop/dubbo-shop/script/db/goods.sql | 34 +++++++++++++ dubbo-samples-shop/onlineShopping/index.html | 3 +- dubbo-samples-shop/onlineShopping/src/App.vue | 1 + .../onlineShopping/src/apis/checkout.js | 2 +- .../onlineShopping/src/apis/detail.js | 7 +-- dubbo-samples-shop/onlineShopping/src/apis/home.js | 2 +- .../src/components/imageView/index.vue | 3 +- .../onlineShopping/src/components/sku/index.vue | 6 +-- .../onlineShopping/src/components/sku/power-set.js | 2 +- .../onlineShopping/src/directives/index.js | 2 +- .../onlineShopping/src/router/index.js | 2 +- .../onlineShopping/src/stores/cartStore.js | 3 +- .../onlineShopping/src/styles/element/index.scss | 2 +- .../onlineShopping/src/styles/element/var.scss | 2 +- .../onlineShopping/src/utils/http.js | 2 +- .../onlineShopping/src/views/CartList/index.vue | 2 +- .../onlineShopping/src/views/Checkout/index.vue | 59 ++++++++++++++-------- .../src/views/Detail/components/DetailHot.vue | 10 ++-- .../onlineShopping/src/views/Detail/index.vue | 50 ++++++++++-------- .../src/views/Home/components/GoodItem.vue | 3 +- .../src/views/Home/components/HomeHot.vue | 19 ++----- .../src/views/Home/components/HomeNew.vue | 8 ++- .../src/views/Home/components/HomePanel.vue | 2 +- .../onlineShopping/src/views/Home/index.vue | 2 +- .../src/views/Layout/components/HeaderCart.vue | 2 +- .../src/views/Layout/components/LayoutFixed.vue | 2 +- .../src/views/Layout/components/LayoutFooter.vue | 6 +-- .../src/views/Layout/components/LayoutHeader.vue | 2 +- .../src/views/Layout/components/LayoutNav.vue | 2 +- .../onlineShopping/src/views/Layout/index.vue | 2 +- .../onlineShopping/src/views/Pay/index.vue | 2 +- dubbo-samples-shop/onlineShopping/vite.config.js | 39 +++++++------- 56 files changed, 716 insertions(+), 228 deletions(-) diff --git a/dubbo-samples-shop/onlineShopping/src/App.vue b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/Ads/AdsServiceMapper.java similarity index 66% copy from dubbo-samples-shop/onlineShopping/src/App.vue copy to dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/Ads/AdsServiceMapper.java index 79eecb058..d5d9ea86c 100644 --- a/dubbo-samples-shop/onlineShopping/src/App.vue +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-mapper/src/main/java/org/apache/dubbo/shop/mapper/Ads/AdsServiceMapper.java @@ -1,4 +1,3 @@ -<script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,14 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -</script> +package org.apache.dubbo.shop.mapper.Ads; -<template> -<router-view/> -</template> +import org.apache.dubbo.shop.common.pojo.Ads.AdsGood; +import org.apache.dubbo.shop.common.pojo.HotGoodsList.HotGood; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Select; -<style scoped lang="scss"> -header{ - color: $priceColor +@Mapper +public interface AdsServiceMapper { + @Select("select * from goods where id = #{orderId}") + public AdsGood getAdsGoods(Integer orderId); } -</style> diff --git a/dubbo-samples-shop/onlineShopping/src/App.vue b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/Ads/AdsGood.java similarity index 68% copy from dubbo-samples-shop/onlineShopping/src/App.vue copy to dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/Ads/AdsGood.java index 79eecb058..1550f5b98 100644 --- a/dubbo-samples-shop/onlineShopping/src/App.vue +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/Ads/AdsGood.java @@ -1,4 +1,3 @@ -<script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,14 +14,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -</script> +package org.apache.dubbo.shop.common.pojo.Ads; -<template> -<router-view/> -</template> +import lombok.Data; -<style scoped lang="scss"> -header{ - color: $priceColor +@Data +public class AdsGood { + /** + * id + */ + private String id; + /** + * 图片 + */ + private String picture; + /** + * 名字 + */ + private String name; + /** + * 介绍 + */ + private String desc; + /** + * 价格 + */ + private String price; } -</style> diff --git a/dubbo-samples-shop/onlineShopping/src/App.vue b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/Ads/AdsGoodsList.java similarity index 80% copy from dubbo-samples-shop/onlineShopping/src/App.vue copy to dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/Ads/AdsGoodsList.java index 79eecb058..bb19006b7 100644 --- a/dubbo-samples-shop/onlineShopping/src/App.vue +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/Ads/AdsGoodsList.java @@ -1,4 +1,3 @@ -<script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,14 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -</script> +package org.apache.dubbo.shop.common.pojo.Ads; -<template> -<router-view/> -</template> +import lombok.Data; +import org.apache.dubbo.shop.common.pojo.HotGoodsList.HotGood; -<style scoped lang="scss"> -header{ - color: $priceColor +@Data +public class AdsGoodsList { + private AdsGood[] adsGoods; } -</style> diff --git a/dubbo-samples-shop/onlineShopping/src/App.vue b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/GoodsDetails/Details.java similarity index 65% copy from dubbo-samples-shop/onlineShopping/src/App.vue copy to dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/GoodsDetails/Details.java index 79eecb058..fcea7f375 100644 --- a/dubbo-samples-shop/onlineShopping/src/App.vue +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/GoodsDetails/Details.java @@ -1,4 +1,3 @@ -<script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,14 +14,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -</script> +package org.apache.dubbo.shop.common.pojo.GoodsDetails; -<template> -<router-view/> -</template> +import lombok.Data; -<style scoped lang="scss"> -header{ - color: $priceColor +@Data +public class Details { + /** + * 商品详细的主图集合 + */ + private String mainPictures; + /** + * 商品id + */ + private String id; + /** + * 商品价格 + */ + private String price; + + /** + * 商品名称 + */ + private String name; + /** + * 商品图片 + */ + private String picture; } -</style> diff --git a/dubbo-samples-shop/onlineShopping/src/App.vue b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/HotGoodsList/HotGood.java similarity index 71% copy from dubbo-samples-shop/onlineShopping/src/App.vue copy to dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/HotGoodsList/HotGood.java index 79eecb058..d9dc5ea72 100644 --- a/dubbo-samples-shop/onlineShopping/src/App.vue +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-common-pojo/src/main/java/org/apache/dubbo/shop/common/pojo/HotGoodsList/HotGood.java @@ -1,4 +1,3 @@ -<script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,14 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -</script> +package org.apache.dubbo.shop.common.pojo.HotGoodsList; -<template> -<router-view/> -</template> +import lombok.Data; -<style scoped lang="scss"> -header{ - color: $priceColor +@Data +public class HotGood { + /** + * id + */ + private String id; + /** + * 图片 + */ + private String picture; + /** + * 名字 + */ + private String name; + /** + * 价格 + */ + private String price; } -</style> diff --git a/dubbo-samples-shop/onlineShopping/src/App.vue b/dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/AdsService.java similarity index 77% copy from dubbo-samples-shop/onlineShopping/src/App.vue copy to dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/AdsService.java index 79eecb058..b9b04662b 100644 --- a/dubbo-samples-shop/onlineShopping/src/App.vue +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-interface/src/main/java/org/apache/dubbo/shop/service/AdsService.java @@ -1,4 +1,3 @@ -<script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,14 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -</script> +package org.apache.dubbo.shop.service; -<template> -<router-view/> -</template> +import org.apache.dubbo.shop.common.pojo.Ads.AdsGood; +import org.apache.dubbo.shop.common.pojo.Ads.AdsGoodsList; -<style scoped lang="scss"> -header{ - color: $priceColor +public interface AdsService { + public AdsGoodsList adsGoodsListResult(); } -</style> diff --git a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-ads/pom.xml b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-ads/pom.xml new file mode 100644 index 000000000..0bfbf7ffa --- /dev/null +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-ads/pom.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <parent> + <artifactId>dubbo-shop</artifactId> + <groupId>org.apache.dubbo</groupId> + <version>1.0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + + <artifactId>dubbo-shop-service-ads</artifactId> + + <properties> + <maven.compiler.source>17</maven.compiler.source> + <maven.compiler.target>17</maven.compiler.target> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + <dependencies> + <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> + <version>1.0-SNAPSHOT</version> + </dependency> + </dependencies> +</project> diff --git a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-ads/src/main/java/org/apache/dubbo/shop/service/ads/AdsServiceImpl.java b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-ads/src/main/java/org/apache/dubbo/shop/service/ads/AdsServiceImpl.java new file mode 100644 index 000000000..9fdb942f6 --- /dev/null +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-ads/src/main/java/org/apache/dubbo/shop/service/ads/AdsServiceImpl.java @@ -0,0 +1,43 @@ +/* + * 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.service.ads; + +import org.apache.dubbo.config.annotation.DubboService; +import org.apache.dubbo.shop.common.pojo.Ads.AdsGood; +import org.apache.dubbo.shop.common.pojo.Ads.AdsGoodsList; +import org.apache.dubbo.shop.mapper.Ads.AdsServiceMapper; +import org.apache.dubbo.shop.service.AdsService; +import org.springframework.beans.factory.annotation.Autowired; + +@DubboService +public class AdsServiceImpl implements AdsService { + @Autowired + AdsServiceMapper adsServiceMapper; + + @Override + public AdsGoodsList adsGoodsListResult() { + AdsGood[] adsGoods = new AdsGood[3]; + for (int i = 7; i <= 9; i++) { + AdsGood adsGood = adsServiceMapper.getAdsGoods(i); + adsGoods[i-7] = adsGood; + } + AdsGoodsList adsGoodsList = new AdsGoodsList(); + adsGoodsList.setAdsGoods(adsGoods); + return adsGoodsList; + } + +} diff --git a/dubbo-samples-shop/onlineShopping/src/App.vue b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-ads/src/main/java/org/apache/dubbo/shop/service/ads/AdsServiceImplApplication.java similarity index 59% copy from dubbo-samples-shop/onlineShopping/src/App.vue copy to dubbo-samples-shop/dubbo-shop/dubbo-shop-service-ads/src/main/java/org/apache/dubbo/shop/service/ads/AdsServiceImplApplication.java index 79eecb058..c4faeb2ee 100644 --- a/dubbo-samples-shop/onlineShopping/src/App.vue +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-ads/src/main/java/org/apache/dubbo/shop/service/ads/AdsServiceImplApplication.java @@ -1,4 +1,3 @@ -<script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,14 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -</script> +package org.apache.dubbo.shop.service.ads; -<template> -<router-view/> -</template> +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; -<style scoped lang="scss"> -header{ - color: $priceColor +@SpringBootApplication +@EnableDubbo +@MapperScan(basePackages = "org.apache.dubbo.shop.mapper") +public class AdsServiceImplApplication { + public static void main(String[] args) { + SpringApplication.run(AdsServiceImplApplication.class,args); + } } -</style> 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 new file mode 100644 index 000000000..79ecd5651 --- /dev/null +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-ads/src/main/resources/application.yml @@ -0,0 +1,36 @@ +# 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. +server: + port: 8083 +spring: + application: + name: HotGoodsServiceImpl + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/test_shop + username: root + password: root +dubbo: + application: + logger: slf4j + name: ${spring.application.name} + qos-enable: false + check-serializable: false + registry: + address: nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos + protocol: + port: 20887 + name: dubbo diff --git a/dubbo-samples-shop/onlineShopping/src/App.vue b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-checkout/src/main/java/org/apache/duubo/shop/service/checkout/CheckoutServiceImplApplication.java similarity index 59% copy from dubbo-samples-shop/onlineShopping/src/App.vue copy to dubbo-samples-shop/dubbo-shop/dubbo-shop-service-checkout/src/main/java/org/apache/duubo/shop/service/checkout/CheckoutServiceImplApplication.java index 79eecb058..4155026c6 100644 --- a/dubbo-samples-shop/onlineShopping/src/App.vue +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-checkout/src/main/java/org/apache/duubo/shop/service/checkout/CheckoutServiceImplApplication.java @@ -1,4 +1,3 @@ -<script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,14 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -</script> +package org.apache.duubo.shop.service.checkout; -<template> -<router-view/> -</template> +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; -<style scoped lang="scss"> -header{ - color: $priceColor +@SpringBootApplication +@EnableDubbo +@MapperScan(basePackages = "org.apache.dubbo.shop.mapper") +public class CheckoutServiceImplApplication { + public static void main(String[] args) { + SpringApplication.run(CheckoutServiceImplApplication.class,args); + } } -</style> diff --git a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-checkout/src/main/resources/application.yml b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-checkout/src/main/resources/application.yml new file mode 100644 index 000000000..f8de0f8c5 --- /dev/null +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-checkout/src/main/resources/application.yml @@ -0,0 +1,36 @@ +# 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. +server: + port: 8084 +spring: + application: + name: CheckoutServiceImpl + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/test_shop + username: root + password: root +dubbo: + application: + logger: slf4j + name: ${spring.application.name} + qos-enable: false + check-serializable: false + registry: + address: nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos + protocol: + port: 20889 + name: dubbo diff --git a/dubbo-samples-shop/onlineShopping/src/App.vue b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-goodsDetails/src/main/java/org/apache/dubbo/shop/service/goodsDetails/GoodsDetailServiceImplApplication.java similarity index 58% copy from dubbo-samples-shop/onlineShopping/src/App.vue copy to dubbo-samples-shop/dubbo-shop/dubbo-shop-service-goodsDetails/src/main/java/org/apache/dubbo/shop/service/goodsDetails/GoodsDetailServiceImplApplication.java index 79eecb058..7f3d38113 100644 --- a/dubbo-samples-shop/onlineShopping/src/App.vue +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-goodsDetails/src/main/java/org/apache/dubbo/shop/service/goodsDetails/GoodsDetailServiceImplApplication.java @@ -1,4 +1,3 @@ -<script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,14 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -</script> +package org.apache.dubbo.shop.service.goodsDetails; -<template> -<router-view/> -</template> +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; -<style scoped lang="scss"> -header{ - color: $priceColor +@SpringBootApplication +@EnableDubbo +@MapperScan(basePackages = "org.apache.dubbo.shop.mapper") +public class GoodsDetailServiceImplApplication { + public static void main(String[] args) { + SpringApplication.run(GoodsDetailServiceImplApplication.class,args); + } } -</style> diff --git a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-goodsDetails/src/main/resources/application.yml b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-goodsDetails/src/main/resources/application.yml new file mode 100644 index 000000000..2626b2e91 --- /dev/null +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-goodsDetails/src/main/resources/application.yml @@ -0,0 +1,36 @@ +# 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. +server: + port: 8082 +spring: + application: + name: GoodsDetailServiceImpl + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/test_shop + username: root + password: root +dubbo: + application: + logger: slf4j + name: ${spring.application.name} + qos-enable: false + check-serializable: false + registry: + address: nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos + protocol: + port: 20884 + name: dubbo 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 new file mode 100644 index 000000000..786bd01c9 --- /dev/null +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-hotGoods/src/main/java/org/apache/dubbo/shop/service/hotGoods/HotGoodsServiceImpl.java @@ -0,0 +1,44 @@ +/* + * 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.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; +import org.apache.dubbo.shop.mapper.HotGoods.HotGoodsMapper; +import org.apache.dubbo.shop.mapper.NewGoods.NewGoodsMapper; +import org.apache.dubbo.shop.service.HotGoodsService; +import org.springframework.beans.factory.annotation.Autowired; +@DubboService +public class HotGoodsServiceImpl implements HotGoodsService { + @Autowired + HotGoodsMapper hotGoodsMapper; + @Override + public HotGoodsList hotGoodsListResult() { + HotGood[] hotGoods = new HotGood[4]; + for (int i = 5; i <= 8; i++){ + HotGood hotGood = hotGoodsMapper.getHotGoods(i); + hotGoods[i-5] = hotGood; + } + + HotGoodsList hotGoodsList = new HotGoodsList(); + hotGoodsList.setHotGoods(hotGoods); + System.out.println(hotGoodsList); + return hotGoodsList; + } +} diff --git a/dubbo-samples-shop/onlineShopping/src/App.vue b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-hotGoods/src/main/java/org/apache/dubbo/shop/service/hotGoods/HotGoodsServiceImplApplication.java similarity index 59% copy from dubbo-samples-shop/onlineShopping/src/App.vue copy to dubbo-samples-shop/dubbo-shop/dubbo-shop-service-hotGoods/src/main/java/org/apache/dubbo/shop/service/hotGoods/HotGoodsServiceImplApplication.java index 79eecb058..7fb5a43e7 100644 --- a/dubbo-samples-shop/onlineShopping/src/App.vue +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-hotGoods/src/main/java/org/apache/dubbo/shop/service/hotGoods/HotGoodsServiceImplApplication.java @@ -1,4 +1,3 @@ -<script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,14 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -</script> +package org.apache.dubbo.shop.service.hotGoods; -<template> -<router-view/> -</template> +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; -<style scoped lang="scss"> -header{ - color: $priceColor +@SpringBootApplication +@EnableDubbo +@MapperScan(basePackages = "org.apache.dubbo.shop.mapper") +public class HotGoodsServiceImplApplication { + public static void main(String[] args) { + SpringApplication.run(HotGoodsServiceImplApplication.class,args); + } } -</style> diff --git a/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-hotGoods/src/main/resources/application.yml b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-hotGoods/src/main/resources/application.yml new file mode 100644 index 000000000..e5196d658 --- /dev/null +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-service-hotGoods/src/main/resources/application.yml @@ -0,0 +1,36 @@ +# 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. +server: + port: 8081 +spring: + application: + name: AdsGoodsServiceImpl + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/test_shop + username: root + password: root +dubbo: + application: + logger: slf4j + name: ${spring.application.name} + qos-enable: false + check-serializable: false + registry: + address: nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos + protocol: + port: 20886 + name: dubbo diff --git a/dubbo-samples-shop/onlineShopping/src/App.vue b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-ads/src/main/java/org/apache/dubbo/shop/web/ads/AdsControllerApplication.java similarity index 65% copy from dubbo-samples-shop/onlineShopping/src/App.vue copy to dubbo-samples-shop/dubbo-shop/dubbo-shop-web-ads/src/main/java/org/apache/dubbo/shop/web/ads/AdsControllerApplication.java index 79eecb058..9718864a6 100644 --- a/dubbo-samples-shop/onlineShopping/src/App.vue +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-ads/src/main/java/org/apache/dubbo/shop/web/ads/AdsControllerApplication.java @@ -1,4 +1,3 @@ -<script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,14 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -</script> +package org.apache.dubbo.shop.web.ads; -<template> -<router-view/> -</template> +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; -<style scoped lang="scss"> -header{ - color: $priceColor +@SpringBootApplication +@EnableDubbo +public class AdsControllerApplication { + public static void main(String[] args) { + SpringApplication.run(AdsControllerApplication.class,args); + } } -</style> diff --git a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-ads/src/main/resources/application.yml b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-ads/src/main/resources/application.yml new file mode 100644 index 000000000..9496d91b4 --- /dev/null +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-ads/src/main/resources/application.yml @@ -0,0 +1,28 @@ +# 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. +server: + port: 50003 + +dubbo: + application: + logger: slf4j + qos-enable: false + check-serializable: false + registry: + address: nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos + protocol: + port: 20888 + name: dubbo diff --git a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-checkout/src/main/resources/application.yml b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-checkout/src/main/resources/application.yml new file mode 100644 index 000000000..1739de2c7 --- /dev/null +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-checkout/src/main/resources/application.yml @@ -0,0 +1,28 @@ +# 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. +server: + port: 50004 + +dubbo: + application: + logger: slf4j + qos-enable: false + check-serializable: false + registry: + address: nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos + protocol: + port: 20900 + name: dubbo diff --git a/dubbo-samples-shop/onlineShopping/src/App.vue b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-goodsDetails/src/main/java/oeg/apache/dubbo/shop/web/goodsDetails/GoodsDetailsControllerApplication.java similarity index 64% copy from dubbo-samples-shop/onlineShopping/src/App.vue copy to dubbo-samples-shop/dubbo-shop/dubbo-shop-web-goodsDetails/src/main/java/oeg/apache/dubbo/shop/web/goodsDetails/GoodsDetailsControllerApplication.java index 79eecb058..c06b42190 100644 --- a/dubbo-samples-shop/onlineShopping/src/App.vue +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-goodsDetails/src/main/java/oeg/apache/dubbo/shop/web/goodsDetails/GoodsDetailsControllerApplication.java @@ -1,4 +1,3 @@ -<script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,14 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -</script> +package oeg.apache.dubbo.shop.web.goodsDetails; -<template> -<router-view/> -</template> +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; -<style scoped lang="scss"> -header{ - color: $priceColor +@SpringBootApplication +@EnableDubbo +public class GoodsDetailsControllerApplication { + public static void main(String[] args) { + SpringApplication.run(GoodsDetailsControllerApplication.class,args); + } } -</style> diff --git a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-goodsDetails/src/main/resources/application.yml b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-goodsDetails/src/main/resources/application.yml new file mode 100644 index 000000000..00a862e65 --- /dev/null +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-goodsDetails/src/main/resources/application.yml @@ -0,0 +1,28 @@ +# 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. +server: + port: 50002 + +dubbo: + application: + logger: slf4j + qos-enable: false + check-serializable: false + registry: + address: nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos + protocol: + port: 20885 + name: dubbo diff --git a/dubbo-samples-shop/onlineShopping/src/App.vue b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-hotGoods/src/main/java/org/apache/dubbo/shop/web/hotGoods/HotGoodsControllerApplication.java similarity index 64% copy from dubbo-samples-shop/onlineShopping/src/App.vue copy to dubbo-samples-shop/dubbo-shop/dubbo-shop-web-hotGoods/src/main/java/org/apache/dubbo/shop/web/hotGoods/HotGoodsControllerApplication.java index 79eecb058..b53c0eeb7 100644 --- a/dubbo-samples-shop/onlineShopping/src/App.vue +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-hotGoods/src/main/java/org/apache/dubbo/shop/web/hotGoods/HotGoodsControllerApplication.java @@ -1,4 +1,3 @@ -<script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,14 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -</script> +package org.apache.dubbo.shop.web.hotGoods; -<template> -<router-view/> -</template> +import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; -<style scoped lang="scss"> -header{ - color: $priceColor +@SpringBootApplication +@EnableDubbo +public class HotGoodsControllerApplication { + public static void main(String[] args){ + SpringApplication.run(HotGoodsControllerApplication.class,args); + } } -</style> diff --git a/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-hotGoods/src/main/resources/application.yml b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-hotGoods/src/main/resources/application.yml new file mode 100644 index 000000000..19b495f21 --- /dev/null +++ b/dubbo-samples-shop/dubbo-shop/dubbo-shop-web-hotGoods/src/main/resources/application.yml @@ -0,0 +1,28 @@ +# 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. +server: + port: 50001 + +dubbo: + application: + logger: slf4j + qos-enable: false + check-serializable: false + registry: + address: nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos + protocol: + port: 20883 + name: dubbo diff --git a/dubbo-samples-shop/dubbo-shop/script/db/goods.sql b/dubbo-samples-shop/dubbo-shop/script/db/goods.sql new file mode 100644 index 000000000..67ade66c1 --- /dev/null +++ b/dubbo-samples-shop/dubbo-shop/script/db/goods.sql @@ -0,0 +1,34 @@ +-- +-- 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. +-- +create table goods +( + id int not null + primary key, + picture varchar(255) null, + name varchar(255) null, + price decimal(10, 2) null, + `desc` varchar(255) null +); +INSERT INTO `goods`(`id`, `picture`, `name`, `price`, `desc`) VALUES (1, '/assets/images/products/mug.jpg', '马克杯', 15.00, NULL); +INSERT INTO `goods`(`id`, `picture`, `name`, `price`, `desc`) VALUES (2, '/assets/images/products/bamboo-glass-jar.jpg', '杯子', 16.00, NULL); +INSERT INTO `goods`(`id`, `picture`, `name`, `price`, `desc`) VALUES (3, '/assets/images/products/candle-holder.jpg', '蜡烛架子', 26.00, NULL); +INSERT INTO `goods`(`id`, `picture`, `name`, `price`, `desc`) VALUES (4, '/assets/images/products/hairdryer.jpg', '吹风机', 58.00, NULL); +INSERT INTO `goods`(`id`, `picture`, `name`, `price`, `desc`) VALUES (5, '/assets/images/products/loafers.jpg', '平底便鞋', 56.00, NULL); +INSERT INTO `goods`(`id`, `picture`, `name`, `price`, `desc`) VALUES (6, '/assets/images/products/salt-and-pepper-shakers.jpg', '摇壶', 30.00, '好货啊'); +INSERT INTO `goods`(`id`, `picture`, `name`, `price`, `desc`) VALUES (7, '/assets/images/products/sunglasses.jpg', '太阳镜', 23.00, '遮阳专用'); +INSERT INTO `goods`(`id`, `picture`, `name`, `price`, `desc`) VALUES (8, '/assets/images/products/tank-top.jpg', '吊带衫', 95.00, '方便易穿'); +INSERT INTO `goods`(`id`, `picture`, `name`, `price`, `desc`) VALUES (9, '/assets/images/products/watch.jpg', '手表', 106.00, '彰显时尚'); diff --git a/dubbo-samples-shop/onlineShopping/index.html b/dubbo-samples-shop/onlineShopping/index.html index 8d86be947..644bcbd54 100644 --- a/dubbo-samples-shop/onlineShopping/index.html +++ b/dubbo-samples-shop/onlineShopping/index.html @@ -1,4 +1,3 @@ -<!DOCTYPE html> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -17,6 +16,8 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> +<!DOCTYPE html> + <html lang="en"> <head> <meta charset="UTF-8"> diff --git a/dubbo-samples-shop/onlineShopping/src/App.vue b/dubbo-samples-shop/onlineShopping/src/App.vue index 79eecb058..c77e13a20 100644 --- a/dubbo-samples-shop/onlineShopping/src/App.vue +++ b/dubbo-samples-shop/onlineShopping/src/App.vue @@ -1,3 +1,4 @@ + <script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/dubbo-samples-shop/onlineShopping/src/apis/checkout.js b/dubbo-samples-shop/onlineShopping/src/apis/checkout.js index 3f4bf4907..85ffb9fae 100644 --- a/dubbo-samples-shop/onlineShopping/src/apis/checkout.js +++ b/dubbo-samples-shop/onlineShopping/src/apis/checkout.js @@ -18,5 +18,5 @@ import http from '@/utils/http' // 获取详情接口 export const getCheckInfoAPI = () => { - return http.get('http://localhost:8080/member/order'); + return http.get('http://localhost:50004/member/order'); } diff --git a/dubbo-samples-shop/onlineShopping/src/apis/detail.js b/dubbo-samples-shop/onlineShopping/src/apis/detail.js index 5b479bfe3..9ab669c9c 100644 --- a/dubbo-samples-shop/onlineShopping/src/apis/detail.js +++ b/dubbo-samples-shop/onlineShopping/src/apis/detail.js @@ -22,7 +22,8 @@ import http from "@/utils/http"; * @return {*} */ export function getDetail(id){ - return http.get('/goods',{params:{id}}); + return http.get('http://localhost:50002/detail/id',{params:{id}}); + // return http.get('http://localhost:50002/goods',{params:{id}}) } /** * 获取热榜商品 @@ -31,9 +32,9 @@ export function getDetail(id){ * @param {Number} limit - 获取个数 */ export const getHotGoodsAPI = ({ id, type, limit = 3 }) => { - return http.get('/goods/hot',{params:{ + return http.get('http://localhost:50003/goods/hot',{params:{ id, type, limit }}); -} +} \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/apis/home.js b/dubbo-samples-shop/onlineShopping/src/apis/home.js index f23b494b9..9264f7330 100644 --- a/dubbo-samples-shop/onlineShopping/src/apis/home.js +++ b/dubbo-samples-shop/onlineShopping/src/apis/home.js @@ -30,5 +30,5 @@ export const getNewAPI = () => { * @return {*} */ export const getHotAPI = () => { - return http.get('/home/hot') + return http.get('http://localhost:50001/good/hot') } diff --git a/dubbo-samples-shop/onlineShopping/src/components/imageView/index.vue b/dubbo-samples-shop/onlineShopping/src/components/imageView/index.vue index e656102c9..2b5081737 100644 --- a/dubbo-samples-shop/onlineShopping/src/components/imageView/index.vue +++ b/dubbo-samples-shop/onlineShopping/src/components/imageView/index.vue @@ -1,3 +1,4 @@ + <script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -111,4 +112,4 @@ defineProps({ } } } -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/components/sku/index.vue b/dubbo-samples-shop/onlineShopping/src/components/sku/index.vue index 720411a8f..392d06b0d 100644 --- a/dubbo-samples-shop/onlineShopping/src/components/sku/index.vue +++ b/dubbo-samples-shop/onlineShopping/src/components/sku/index.vue @@ -1,5 +1,5 @@ <template> - <!-- + <!-- 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 @@ -8,7 +8,7 @@ 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 + 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 @@ -217,4 +217,4 @@ export default { } } } -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/components/sku/power-set.js b/dubbo-samples-shop/onlineShopping/src/components/sku/power-set.js index d421aa670..824fbf86c 100644 --- a/dubbo-samples-shop/onlineShopping/src/components/sku/power-set.js +++ b/dubbo-samples-shop/onlineShopping/src/components/sku/power-set.js @@ -41,4 +41,4 @@ export default function bwPowerSet (originalSet) { } return subSets -} +} \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/directives/index.js b/dubbo-samples-shop/onlineShopping/src/directives/index.js index 648e47ef0..b506c161f 100644 --- a/dubbo-samples-shop/onlineShopping/src/directives/index.js +++ b/dubbo-samples-shop/onlineShopping/src/directives/index.js @@ -39,4 +39,4 @@ export const lazyPlugin = { } }) } -} +} \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/router/index.js b/dubbo-samples-shop/onlineShopping/src/router/index.js index 4ed0dabda..c577f296e 100644 --- a/dubbo-samples-shop/onlineShopping/src/router/index.js +++ b/dubbo-samples-shop/onlineShopping/src/router/index.js @@ -54,4 +54,4 @@ const router = createRouter({ ] }) -export default router +export default router \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/stores/cartStore.js b/dubbo-samples-shop/onlineShopping/src/stores/cartStore.js index a235ccc8f..218ddb6de 100644 --- a/dubbo-samples-shop/onlineShopping/src/stores/cartStore.js +++ b/dubbo-samples-shop/onlineShopping/src/stores/cartStore.js @@ -21,6 +21,7 @@ export const useCartStore = defineStore( ()=>{ const cartList = ref([]); const addCart = (goods) => { + console.log(goods) //判断商品是否在购物车 const findItem = cartList.value.find(item=>goods.skuId === item.skuId); if(findItem){ @@ -72,4 +73,4 @@ export const useCartStore = defineStore( { persist:true } -) +) \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/styles/element/index.scss b/dubbo-samples-shop/onlineShopping/src/styles/element/index.scss index b1c47bf24..4a91c5ac8 100644 --- a/dubbo-samples-shop/onlineShopping/src/styles/element/index.scss +++ b/dubbo-samples-shop/onlineShopping/src/styles/element/index.scss @@ -38,4 +38,4 @@ 'base': #cf4444, ), ) -); +); \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/styles/element/var.scss b/dubbo-samples-shop/onlineShopping/src/styles/element/var.scss index b073ccdda..d095b8d68 100644 --- a/dubbo-samples-shop/onlineShopping/src/styles/element/var.scss +++ b/dubbo-samples-shop/onlineShopping/src/styles/element/var.scss @@ -18,4 +18,4 @@ $xtxColor: #27ba9b; $helpColor: #e26237; $sucColor: #1dc779; $warnColor: #ffb302; -$priceColor: #cf4444; +$priceColor: #cf4444; \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/utils/http.js b/dubbo-samples-shop/onlineShopping/src/utils/http.js index 4b815308d..fb7c0c5b6 100644 --- a/dubbo-samples-shop/onlineShopping/src/utils/http.js +++ b/dubbo-samples-shop/onlineShopping/src/utils/http.js @@ -35,4 +35,4 @@ http.interceptors.response.use(res => res.data, e => { }) -export default http +export default http \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/CartList/index.vue b/dubbo-samples-shop/onlineShopping/src/views/CartList/index.vue index baa17f977..c062b7cbc 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/CartList/index.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/CartList/index.vue @@ -223,4 +223,4 @@ const cartStore = useCartStore() } } -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/Checkout/index.vue b/dubbo-samples-shop/onlineShopping/src/views/Checkout/index.vue index 818066e8e..f062963b0 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Checkout/index.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Checkout/index.vue @@ -69,25 +69,42 @@ onMounted(() => getCheckInfo()) <th width="170">单价</th> <th width="170">数量</th> <th width="170">小计</th> - <th width="170">实付</th> +<!-- <th width="170">实付</th>--> </tr> </thead> <tbody> - <tr v-for="i in checkInfo.goods" :key="i.id"> - <td> - <a href="javascript:;" class="info"> - <img :src="i.picture" alt=""> - <div class="right"> - <p>{{ i.name }}</p> - <p>{{ i.attrsText }}</p> - </div> - </a> - </td> - <td>¥{{ i.price }}</td> - <td>{{ i.count }}</td> - <td>¥{{ i.totalPrice }}</td> - <td>¥{{ i.totalPayPrice }}</td> - </tr> +<!-- <tr v-for="i in checkInfo.goods" :key="i.id">--> +<!-- <td>--> +<!-- <a href="javascript:;" class="info">--> +<!-- <img :src="i.picture" alt="">--> +<!-- <div class="right">--> +<!-- <p>{{ i.name }}</p>--> +<!-- <p>{{ i.attrsText }}</p>--> +<!-- </div>--> +<!-- </a>--> +<!-- </td>--> +<!-- <td>¥{{ i.price }}</td>--> +<!-- <td>{{ i.count }}</td>--> +<!-- <td>¥{{ i.totalPrice }}</td>--> +<!-- <td>¥{{ i.totalPayPrice }}</td>--> +<!-- </tr>--> + <tr v-for="i in cartStore.cartList" :key="i.id"> + <td> + <a href="javascript:;" class="info"> + <img :src="i.picture" alt=""> + <div class="right"> + <p>{{ i.name }}</p> + <p>{{ i.attrsText }}</p> + </div> + </a> + </td> + <td>¥{{ i.price }}</td> + <td>{{ i.count }}</td> + <td class="tc"> + <p class="f16 red">¥{{ (i.price * i.count).toFixed(2) }}</p> + </td> +<!-- <td>¥{{ i.totalPayPrice }}</td>--> + </tr> <!-- <tr>--> <!-- <td>--> <!-- <img src="/assets/images/liuying.png">--> @@ -116,19 +133,19 @@ onMounted(() => getCheckInfo()) <div class="total"> <dl> <dt>商品件数:</dt> - <dd>{{ checkInfo.summary?.goodsCount }}件</dd> + <dd>{{cartStore.allCount}}件</dd> </dl> <dl> <dt>商品总价:</dt> - <dd>¥{{ checkInfo.summary?.totalPrice.toFixed(2) }}</dd> + <dd>¥{{ cartStore.selectedPrice.toFixed(2) }}</dd> </dl> <dl> <dt>运<i></i>费:</dt> - <dd>¥{{ checkInfo.summary?.postFee.toFixed(2) }}</dd> + <dd>¥{{ checkInfo.postFee }}</dd> </dl> <dl> <dt>应付总额:</dt> - <dd class="price">{{ checkInfo.summary?.totalPayPrice.toFixed(2) }}</dd> + <dd class="price">{{ (cartStore.selectedPrice + checkInfo.postFee).toFixed(2) }}</dd> </dl> </div> </div> @@ -355,4 +372,4 @@ onMounted(() => getCheckInfo()) } } } -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/Detail/components/DetailHot.vue b/dubbo-samples-shop/onlineShopping/src/views/Detail/components/DetailHot.vue index c0b2625c9..8ddd90a9c 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Detail/components/DetailHot.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Detail/components/DetailHot.vue @@ -27,7 +27,9 @@ const getHotList = async () => { id: route.params.id, type: 1 }) - goodList.value = res.result + + goodList.value = res.data + console.log(goodList.value) } onMounted(()=>getHotList()) </script> @@ -37,7 +39,7 @@ onMounted(()=>getHotList()) <h3> 24小时热榜 </h3> <div class="pic-box"> <!-- 商品区块 --> - <RouterLink :to="`/detail/${item.id}`" class="goods-item" v-for="item in goodList" :key="item.id"> + <RouterLink :to="`/detail/${item.id}`" class="goods-item" v-for="item in goodList.adsGoods" :key="item.id"> <img :src="item.picture" alt="" /> <p class="name ellipsis">{{ item.name }}</p> <p class="desc ellipsis">{{ item.desc }}</p> @@ -50,7 +52,9 @@ onMounted(()=>getHotList()) <style scoped lang="scss"> .goods-hot { + width:100%; h3 { + width:280px; height: 70px; background: $helpColor; color: #fff; @@ -97,4 +101,4 @@ onMounted(()=>getHotList()) width: 100%; display: flex; } -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/Detail/index.vue b/dubbo-samples-shop/onlineShopping/src/views/Detail/index.vue index a56952d81..a72d61cb3 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Detail/index.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Detail/index.vue @@ -17,12 +17,22 @@ */ import { getDetail } from '@/apis/detail' import { useRoute } from 'vue-router' +import { watch} from 'vue'; import DetailHot from "@/views/Detail/components/DetailHot.vue"; import Sku from "@/components/sku/index.vue"; import {useCartStore} from "@/stores/cartStore.js"; import {ElMessage} from "element-plus"; import 'element-plus/theme-chalk/el-message.css' const cartStore = useCartStore(); +const route = useRoute(); + +const wat = watch( + route, + (to, from) => { + getGoods() + //console.log(to.params.id,from.params.id); + } +); //sku组件触发方法 let skuObj = {}; @@ -38,13 +48,14 @@ const addCart = () => { console.log(skuObj) if (true || skuObj.skuId) { // 规则已经选择 触发action + //console.log(goods.value.id) cartStore.addCart({ id: goods.value.id, name: goods.value.name, - picture: goods.value.mainPictures[0], + picture: goods.value.mainPictures, price: goods.value.price, count: count.value, - skuId: skuObj.skuId, + skuId: goods.value.id, attrsText: skuObj.specsText, selected: true }) @@ -55,11 +66,10 @@ const addCart = () => { } } const goods = ref({}) -const route = useRoute() + const getGoods = async () => { const res = await getDetail(route.params.id) - console.log(res) - goods.value = res.result + goods.value = res.data } onMounted(() => getGoods()) @@ -84,7 +94,7 @@ onMounted(() => getGoods()) <div class="goods-info"> <div class="media"> <!-- 图片预览区 --> - <ImageView :image-list="goods.mainPictures"/> + <img :src="goods.mainPictures"/> <!-- <!– 统计数量 –>--> <!-- <ul class="goods-sales">--> <!-- <li>--> @@ -111,12 +121,11 @@ onMounted(() => getGoods()) </div> <div class="spec"> <!-- 商品信息区 --> - <p class="g-name">{{goods.name}}</p> - <p class="g-desc">好穿</p> + <p class="g-desc">好货</p> <p class="g-price"> - <span>200</span> - <span> 100</span> + <span>{{ goods.price }}</span> +<!-- <span></span>--> </p> <div class="g-service"> <dl> @@ -186,9 +195,9 @@ onMounted(() => getGoods()) display: flex; .media { - width: 580px; - height: 300px; - padding: 30px 50px; + width: 400px; + height: 450px; + padding: 30px 30px; } .spec { @@ -207,7 +216,7 @@ onMounted(() => getGoods()) } .goods-aside { - width: 280px; + width: 100%; min-height: 100px; } } @@ -253,16 +262,17 @@ onMounted(() => getGoods()) } &:first-child { + content: "¥"; color: $priceColor; margin-right: 10px; font-size: 22px; } - &:last-child { - color: #999; - text-decoration: line-through; - font-size: 16px; - } + //&:last-child { + // color: #999; + // text-decoration: line-through; + // font-size: 16px; + //} } } @@ -416,4 +426,4 @@ onMounted(() => getGoods()) .bread-container { padding: 25px 0; } -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/Home/components/GoodItem.vue b/dubbo-samples-shop/onlineShopping/src/views/Home/components/GoodItem.vue index d3fc45abb..9ca3da107 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Home/components/GoodItem.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Home/components/GoodItem.vue @@ -1,3 +1,4 @@ + <script setup> /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -69,4 +70,4 @@ defineProps({ font-size: 20px; } } -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/Home/components/HomeHot.vue b/dubbo-samples-shop/onlineShopping/src/views/Home/components/HomeHot.vue index 1926dbc07..b827446a9 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Home/components/HomeHot.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Home/components/HomeHot.vue @@ -20,30 +20,21 @@ import { getHotAPI } from '@/apis/home' const hotList = ref([]) const getHotList = async () => { const res = await getHotAPI() - hotList.value = res.result + hotList.value = res.data.hotGoods + console.log("开始打印hotList结果") + console.log(hotList.value) } onMounted(()=>getHotList()) </script> <template> -<!-- <HomePanel title="人气推荐" sub-title="人气爆款 不容错过">--> -<!-- <ul class="goods-list">--> -<!-- <li v-for="item in hotList" :key="item.id">--> -<!-- <RouterLink :to="`/detail/${item.id}`">--> -<!-- <img :src="item.picture" alt="" />--> -<!-- <p class="name">{{ item.name }}</p>--> -<!-- <p class="price">{{item.price}}</p>--> -<!-- </RouterLink>--> -<!-- </li>--> -<!-- </ul>--> -<!-- </HomePanel>--> <HomePanel title="人气推荐" sub-title="人气爆款 不容错过"> <ul class="goods-list"> <li v-for="item in hotList" :key="item.id"> <RouterLink :to="`/detail/${item.id}`"> <img v-img-lazy="item.picture" alt=""> - <p class="name">{{ item.title }}</p> - <p class="desc">{{ item.alt }}</p> + <p class="name">{{ item.name }}</p> + <p class="price">¥{{ item.price }}</p> </RouterLink> </li> </ul> diff --git a/dubbo-samples-shop/onlineShopping/src/views/Home/components/HomeNew.vue b/dubbo-samples-shop/onlineShopping/src/views/Home/components/HomeNew.vue index becd451fa..442eeafa0 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Home/components/HomeNew.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Home/components/HomeNew.vue @@ -16,7 +16,6 @@ * limitations under the License. */ import HomePanel from "@/views/Home/components/HomePanel.vue"; - import {getNewAPI} from '@/apis/home' const newList = ref([]) @@ -24,11 +23,10 @@ const getNewList = async () => { console.log('方法已执行') const res = await getNewAPI() console.log("开始打印输出结果") - console.log(res) - newList.value = res.data + console.log(res.data) + newList.value = res.data.newGoods console.log("开始打印newList结果") console.log(newList.value) - console.log(newList.value.picture) } onMounted(() => getNewList()) </script> @@ -84,4 +82,4 @@ onMounted(() => getNewList()) } } } -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/Home/components/HomePanel.vue b/dubbo-samples-shop/onlineShopping/src/views/Home/components/HomePanel.vue index 55cfbf416..01aa23a75 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Home/components/HomePanel.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Home/components/HomePanel.vue @@ -69,4 +69,4 @@ defineProps({ } } } -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/Home/index.vue b/dubbo-samples-shop/onlineShopping/src/views/Home/index.vue index 0e7d4ae79..d88a4f388 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Home/index.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Home/index.vue @@ -28,4 +28,4 @@ import HomeNew from "@/views/Home/components/HomeNew.vue"; <style scoped> -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/Layout/components/HeaderCart.vue b/dubbo-samples-shop/onlineShopping/src/views/Layout/components/HeaderCart.vue index dc3d3e756..2a8b80cda 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Layout/components/HeaderCart.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Layout/components/HeaderCart.vue @@ -233,4 +233,4 @@ const cartStore = useCartStore() } } } -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutFixed.vue b/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutFixed.vue index 9489e6ac6..01caeb2e8 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutFixed.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutFixed.vue @@ -130,4 +130,4 @@ const { y } = useScroll(window) } } } -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutFooter.vue b/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutFooter.vue index afbd02cf3..44e1ca0f0 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutFooter.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutFooter.vue @@ -1,5 +1,5 @@ <template> - <!-- + <!-- 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 @@ -8,7 +8,7 @@ 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 + 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 @@ -250,4 +250,4 @@ under the License. } </style> <script setup lang="ts"> -</script> +</script> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutHeader.vue b/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutHeader.vue index 16d80377f..3291ae299 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutHeader.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutHeader.vue @@ -165,4 +165,4 @@ import HeaderCart from "@/views/Layout/components/HeaderCart.vue"; } } } -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutNav.vue b/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutNav.vue index 68c19e26a..7ff69509f 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutNav.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Layout/components/LayoutNav.vue @@ -77,4 +77,4 @@ } } } -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/Layout/index.vue b/dubbo-samples-shop/onlineShopping/src/views/Layout/index.vue index a5c494953..a11b2c0bc 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Layout/index.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Layout/index.vue @@ -31,4 +31,4 @@ import LayoutFixed from "@/views/Layout/components/LayoutFixed.vue"; <style scoped> -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/src/views/Pay/index.vue b/dubbo-samples-shop/onlineShopping/src/views/Pay/index.vue index 726f727e5..7892e5891 100644 --- a/dubbo-samples-shop/onlineShopping/src/views/Pay/index.vue +++ b/dubbo-samples-shop/onlineShopping/src/views/Pay/index.vue @@ -144,4 +144,4 @@ } } } -</style> +</style> \ No newline at end of file diff --git a/dubbo-samples-shop/onlineShopping/vite.config.js b/dubbo-samples-shop/onlineShopping/vite.config.js index e03f88170..90ad3402d 100644 --- a/dubbo-samples-shop/onlineShopping/vite.config.js +++ b/dubbo-samples-shop/onlineShopping/vite.config.js @@ -1,19 +1,21 @@ /* - * 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. - */ +* 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. +*/ // import { fileURLToPath, URL } from 'node:url' // import { defineConfig } from 'vite' @@ -43,12 +45,13 @@ // scss: { // // 自动导入定制化样式文件进行样式覆盖 // additionalData: ` -// @use "@/styles/element/index.scss" as *; +// @use "@/styles/element/index.scss" as *; // `, // } // } // } // }) + import { fileURLToPath, URL } from 'node:url' import { defineConfig } from 'vite' @@ -85,9 +88,9 @@ export default defineConfig({ // 自动导入定制化样式文件进行样式覆盖 additionalData: ` @use "@/styles/element/index.scss" as *; - @use "@/styles/element/var.scss" as *; + @use "@/styles/element/var.scss" as *; `, } } } -}) +}) \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org