chao 4 years ago
parent
commit
87faa39391

+ 0 - 44
src/main/java/com/caimei/www/controller/unlimited/ProductController.java

@@ -52,48 +52,4 @@ public class ProductController extends BaseController {
         return PRODUCT_DETAIL_PATH;
     }
 
-    /**
-     * 详情-图片
-     * @return
-     */
-    @GetMapping("/product/images")
-    @ResponseBody
-    public JsonModel<List<String>> getProductDetailImages(Integer productId) {
-        return productService.getProductDetailImages(productId);
-    }
-
-
-    /**
-     * 详情-相关推荐
-     * @return
-     */
-    @GetMapping("/product/recommend")
-    @ResponseBody
-    public JsonModel<List<ProductList>> getProductDetailRecommends(Integer productId, Integer recommendType) {
-        return productService.getProductDetailRecommends(productId, recommendType);
-    }
-
-    /**
-     * 详情-相关参数
-     * @return
-     */
-    @GetMapping("/product/parameter")
-    @ResponseBody
-    public JsonModel<List<Parameter>> getProductParameters(Integer productId) {
-        return productService.getProductParameters(productId);
-    }
-
-    /**
-     * 详情-价格
-     * @return
-     */
-    @GetMapping("/product/price")
-    @ResponseBody
-    public JsonModel<CartItem> getProductPrice(Integer productId, Integer userId) {
-        return productService.getProductPrice(productId, userId);
-    }
-
-
-
-
 }

+ 0 - 35
src/main/java/com/caimei/www/service/ProductService.java

@@ -1,12 +1,7 @@
 package com.caimei.www.service;
 
-import com.caimei.www.pojo.JsonModel;
-import com.caimei.www.pojo.order.CartItem;
 import com.caimei.www.pojo.page.ProductDetail;
-import com.caimei.www.pojo.page.ProductList;
-import com.caimei.www.pojo.page.Parameter;
 
-import java.util.List;
 
 /**
  * Description
@@ -22,34 +17,4 @@ public interface ProductService {
      */
     ProductDetail getProductDetailById(Integer productId);
 
-    /**
-     * 详情-相关推荐
-     * @param productId
-     * @param recommendType
-     * @return
-     */
-    JsonModel<List<ProductList>> getProductDetailRecommends(Integer productId, Integer recommendType);
-
-    /**
-     * 详情-相关参数
-     * @param productId
-     * @return
-     */
-    JsonModel<List<Parameter>> getProductParameters(Integer productId);
-
-    /**
-     * 详情-图片
-     * @param productId
-     * @return
-     */
-    JsonModel<List<String>> getProductDetailImages(Integer productId);
-
-    /**
-     * 详情-价格
-     * @param productId
-     * @param userId
-     * @return
-     */
-    JsonModel<CartItem> getProductPrice(Integer productId, Integer userId);
-
 }

+ 2 - 73
src/main/java/com/caimei/www/service/impl/ProductServiceImpl.java

@@ -1,21 +1,15 @@
 package com.caimei.www.service.impl;
 
-import com.caimei.www.pojo.JsonModel;
 import com.caimei.www.mapper.ProductDao;
-import com.caimei.www.pojo.order.CartItem;
 import com.caimei.www.pojo.page.ProductDetail;
-import com.caimei.www.pojo.page.ProductList;
-import com.caimei.www.pojo.page.Parameter;
-import com.caimei.www.service.CommonServiceUtil;
 import com.caimei.www.service.ProductService;
-import com.caimei.www.utils.ImageUtil;
 import io.netty.util.internal.StringUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.List;
+
 
 /**
  * Description
@@ -30,8 +24,7 @@ public class ProductServiceImpl implements ProductService {
     private String domain;
     @Resource
     private ProductDao productDao;
-    @Resource
-    private CommonServiceUtil commonServiceUtil;
+
     /**
      * 根据商品Id获取详情
      *
@@ -59,68 +52,4 @@ public class ProductServiceImpl implements ProductService {
         return product;
     }
 
-    /**
-     * 详情-相关推荐
-     *
-     * @return
-     */
-    @Override
-    public JsonModel<List<ProductList>> getProductDetailRecommends(Integer productId, Integer recommendType) {
-        List<ProductList> list = null;
-        //相关推荐类型 0自动选择; 1手动推荐
-        if (1 == recommendType) {
-            list = productDao.getProductRecommendsById(productId);
-        } else {
-            list = productDao.getAutoProductRecommends(productId);
-        }
-		return JsonModel.success(list);
-    }
-
-    /**
-     * 详情-相关参数
-     *
-     * @param productId
-     * @return
-     */
-    @Override
-    public JsonModel<List<Parameter>> getProductParameters(Integer productId) {
-        if (productId == null) { return JsonModel.error("参数异常", null);}
-        List<Parameter> list = productDao.getProductParameters(productId);
-		return JsonModel.success(list);
-    }
-
-    /**
-     * 详情-图片
-     *
-     * @param productId
-     * @return
-     */
-    @Override
-    public JsonModel<List<String>> getProductDetailImages(Integer productId) {
-        if (productId == null) { return JsonModel.error("参数异常", null);}
-        List<String> list = productDao.getProductDetailImages(productId);
-        if (list.size() > 0) {
-            // 设置价格等级 及 老图片路径
-            list.forEach(image -> {
-                image = ImageUtil.getImageURL("product", image, 0, domain);
-            });
-        }
-		return JsonModel.success(list);
-    }
-
-    /**
-     * 详情-价格
-     *
-     * @param productId
-     * @param userId
-     * @return
-     */
-    @Override
-    public JsonModel<CartItem> getProductPrice(Integer productId, Integer userId) {
-        if (productId == null || userId == null || userId == 0) { return JsonModel.error("参数异常", null);}
-        CartItem priceItem = productDao.getPriceItemById(productId);
-        // 设置商品价格
-        commonServiceUtil.setCartItemPrice(priceItem, userId);
-		return JsonModel.success(priceItem);
-    }
 }

+ 1 - 1
src/main/resources/config/dev/application-dev.yml

@@ -2,7 +2,7 @@ spring:
   #数据源连接--start
   datasource:
     #driverClassName: com.mysql.jdbc.Driver
-    url: jdbc:mysql://192.168.1.11:3306/caimei?characterEncoding=UTF8&serverTimezone=Asia/Shanghai
+    url: jdbc:mysql://192.168.2.101:3306/caimei?characterEncoding=UTF8&serverTimezone=Asia/Shanghai
     username: developer
     password: 05bZ/OxTB:X+yd%1
 #    url: jdbc:mysql://119.29.0.46:3306/caimei?characterEncoding=UTF8&serverTimezone=Asia/Shanghai

+ 3 - 3
src/main/resources/static/js/product/detail.js

@@ -19,7 +19,7 @@ var productDetail = new Vue({
         getImages: function(){
             var _self = this;
             if(this.productId ===0){return;}
-            $.getJSON("/product/images",{productId: this.productId}).done(function (r) {
+            $.getJSON(spiServer + "/product/detail/images",{productId: this.productId}).done(function (r) {
                 if (r.code === 0 && r.data) {
                     _self.images = r.data;
                     setTimeout(function(){
@@ -52,7 +52,7 @@ var productDetail = new Vue({
         getRecommends: function(){
             var _self = this;
             if(this.productId ===0){return;}
-            $.getJSON("/product/recommend",{
+            $.getJSON(spiServer + "/product/detail/recommend",{
                 productId: this.productId,
                 recommendType: this.recommendType
             }).done(function (r) {
@@ -85,7 +85,7 @@ var productDetail = new Vue({
         getParameters: function(){
             var _self = this;
             if(this.productId ===0){return;}
-            $.getJSON("/product/parameter",{
+            $.getJSON(spiServer + "/product/detail/parameter",{
                 productId: this.productId
             }).done(function (r) {
                 if (r.code === 0 && r.data) {

+ 1 - 1
src/main/resources/templates/error/404.html

@@ -11,7 +11,7 @@
 
 <!-- 帮助页面 -->
 <div id="errorPage">
-    <h1 style="text-align:center">404(二期)</h1>
+    <h1 style="text-align:center">404</h1>
 </div>
 
 <!-- 引入底部 -->

+ 3 - 3
src/main/resources/templates/supplier/list.html

@@ -27,10 +27,10 @@
     <ul v-else class="supplierList">
         <li class="supplierItem clear" v-for="shop in listData">
             <div class="left">
-                <a :href="'/supplier/prolist-'+shop.id+'.html'" target="_blank" class="logo">
+                <a :href="'/supplier/index.html?id='+shop.id" target="_blank" class="logo">
                     <img :src="shop.logo">
                 </a>
-                <h5><a :href="'/supplier/prolist-'+shop.id+'.html'" :title="shop.name" target="_blank">
+                <h5><a :href="'/supplier/index.html?id='+shop.id" :title="shop.name" target="_blank">
                     <span v-html="shop.name"></span>
                 </a>
                 <a v-if="shop.license" :href="shop.license" target="_blank" class="icon mIcon shop"></a>
@@ -52,7 +52,7 @@
                     </template>
                     <li v-else-if="isPC" v-for="i in 3"></li>
                 </ul>
-                <a v-if="isPC" :href="'/supplier/productlist-'+shop.sid+'.html'" target="_blank" class="four">进入本店铺>>></a>
+                <a v-if="isPC" :href="'/supplier/index.html?id='+shop.id" target="_blank" class="four">进入本店铺>>></a>
             </div>
         </li>
     </ul>