Commit 6aff1b9913aa6e0ecbfc5f8ef09be14917bd5a96

Authored by weiliwhereareyou@163.com
1 parent 0547b99b

首页推荐商品接口开发

Showing 16 changed files with 177 additions and 79 deletions
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/detail/GetProductRecommendReq.java
1 package com.diligrp.mobsite.getway.domain.protocol.detail; 1 package com.diligrp.mobsite.getway.domain.protocol.detail;
2 2
3 -import com.diligrp.mobsite.getway.domain.protocol.BaseReq; 3 +import com.diligrp.mobsite.getway.domain.base.BaseListReq;
4 4
5 /** 5 /**
6 * <B>Description</B> 获取商品推荐请求 <br /> 6 * <B>Description</B> 获取商品推荐请求 <br />
@@ -11,7 +11,7 @@ import com.diligrp.mobsite.getway.domain.protocol.BaseReq; @@ -11,7 +11,7 @@ import com.diligrp.mobsite.getway.domain.protocol.BaseReq;
11 * @author wujianjun 11 * @author wujianjun
12 */ 12 */
13 @SuppressWarnings("serial") 13 @SuppressWarnings("serial")
14 -public class GetProductRecommendReq extends BaseReq { 14 +public class GetProductRecommendReq extends BaseListReq {
15 15
16 /** 16 /**
17 * 店铺ID 17 * 店铺ID
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/detail/GetProductRecommendResp.java
1 package com.diligrp.mobsite.getway.domain.protocol.detail; 1 package com.diligrp.mobsite.getway.domain.protocol.detail;
2 2
3 -import com.diligrp.mobsite.getway.domain.protocol.BaseResp; 3 +import com.diligrp.mobsite.getway.domain.base.BaseListResp;
4 import com.diligrp.mobsite.getway.domain.protocol.GoodsSuper; 4 import com.diligrp.mobsite.getway.domain.protocol.GoodsSuper;
5 5
6 import java.util.List; 6 import java.util.List;
@@ -14,7 +14,7 @@ import java.util.List; @@ -14,7 +14,7 @@ import java.util.List;
14 * @author wujianjun 14 * @author wujianjun
15 */ 15 */
16 @SuppressWarnings("serial") 16 @SuppressWarnings("serial")
17 -public class GetProductRecommendResp extends BaseResp { 17 +public class GetProductRecommendResp extends BaseListResp {
18 18
19 /** 19 /**
20 * 商品列表 20 * 商品列表
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/GoodsRPC.java
@@ -15,6 +15,8 @@ import com.diligrp.titan.sdk.domain.Category; @@ -15,6 +15,8 @@ import com.diligrp.titan.sdk.domain.Category;
15 import com.diligrp.titan.sdk.domain.Product; 15 import com.diligrp.titan.sdk.domain.Product;
16 import com.diligrp.titan.sdk.input.CategoryInput; 16 import com.diligrp.titan.sdk.input.CategoryInput;
17 import com.diligrp.titan.sdk.input.PopProductView; 17 import com.diligrp.titan.sdk.input.PopProductView;
  18 +import com.diligrp.titan.sdk.input.ProductSearchInput;
  19 +import com.diligrp.titan.sdk.output.PageOutput;
18 20
19 import java.util.HashMap; 21 import java.util.HashMap;
20 import java.util.List; 22 import java.util.List;
@@ -123,4 +125,6 @@ public interface GoodsRPC { @@ -123,4 +125,6 @@ public interface GoodsRPC {
123 List<Category> searchProductCategory(String input, Long userId); 125 List<Category> searchProductCategory(String input, Long userId);
124 126
125 Object addGoods(PopProductView req, Long userId); 127 Object addGoods(PopProductView req, Long userId);
  128 +
  129 + PageOutput<List<Product>> getProductRecommend(ProductSearchInput input , Long userId);
126 } 130 }
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/UserRPC.java
@@ -97,4 +97,6 @@ public interface UserRPC { @@ -97,4 +97,6 @@ public interface UserRPC {
97 97
98 98
99 BuyerInfoOutput getUserByMobile(String accountName); 99 BuyerInfoOutput getUserByMobile(String accountName);
  100 +
  101 + void getDepositCardAmount();
100 } 102 }
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/GoodsRPCImpl.java
@@ -21,7 +21,9 @@ import com.diligrp.titan.sdk.domain.Category; @@ -21,7 +21,9 @@ import com.diligrp.titan.sdk.domain.Category;
21 import com.diligrp.titan.sdk.domain.Product; 21 import com.diligrp.titan.sdk.domain.Product;
22 import com.diligrp.titan.sdk.input.CategoryInput; 22 import com.diligrp.titan.sdk.input.CategoryInput;
23 import com.diligrp.titan.sdk.input.PopProductView; 23 import com.diligrp.titan.sdk.input.PopProductView;
  24 +import com.diligrp.titan.sdk.input.ProductSearchInput;
24 import com.diligrp.titan.sdk.output.BaseOutput; 25 import com.diligrp.titan.sdk.output.BaseOutput;
  26 +import com.diligrp.titan.sdk.output.PageOutput;
25 import com.diligrp.website.util.redis.RedisUtil; 27 import com.diligrp.website.util.redis.RedisUtil;
26 import com.diligrp.website.util.security.Validator; 28 import com.diligrp.website.util.security.Validator;
27 import org.slf4j.Logger; 29 import org.slf4j.Logger;
@@ -268,5 +270,19 @@ public class GoodsRPCImpl implements GoodsRPC { @@ -268,5 +270,19 @@ public class GoodsRPCImpl implements GoodsRPC {
268 return output.getData(); 270 return output.getData();
269 } 271 }
270 272
271 - 273 + public PageOutput<List<Product>> getProductRecommend(ProductSearchInput input, Long userId) {
  274 + PageOutput<List<Product>> output = null;
  275 + try {
  276 + output = titanClient.getProductService().searchListPopProducts(input);
  277 + }catch (Exception e){
  278 + logger.info("获取店铺热门推荐商品接口出错:",e);
  279 + throw new ServiceException(ResultCode.NETWORK_FAILED);
  280 + }
  281 + if (output.getCode()!=200) {
  282 + logger.error("获取店铺热门推荐商品失败[userId={},code={},result={}]",
  283 + new Object[]{ userId,output.getCode(),output.getResult()});
  284 + throw new ServiceException(ResultCode.BUSINESS_FAILED,output.getResult());
  285 + }
  286 + return output;
  287 + }
272 } 288 }
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/ShopRPCImpl.java
@@ -4,6 +4,7 @@ import com.b2c.myapp.common.api.shop.input.ShopListInput; @@ -4,6 +4,7 @@ import com.b2c.myapp.common.api.shop.input.ShopListInput;
4 import com.b2c.myapp.common.api.shop.input.ShopSaveInput; 4 import com.b2c.myapp.common.api.shop.input.ShopSaveInput;
5 import com.b2c.myapp.common.api.shop.input.ShopUpdateInput; 5 import com.b2c.myapp.common.api.shop.input.ShopUpdateInput;
6 import com.b2c.myapp.common.api.shop.output.ShopOutput; 6 import com.b2c.myapp.common.api.shop.output.ShopOutput;
  7 +import com.b2c.myapp.common.api.shopProductRecommend.output.ShopProductRecommendOutput;
7 import com.b2c.myapp.common.utils.BaseOutput; 8 import com.b2c.myapp.common.utils.BaseOutput;
8 import com.b2c.myapp.sdk.MyAppClient; 9 import com.b2c.myapp.sdk.MyAppClient;
9 import com.diligrp.mobsite.getway.domain.common.ResultCode; 10 import com.diligrp.mobsite.getway.domain.common.ResultCode;
@@ -14,6 +15,7 @@ import org.slf4j.LoggerFactory; @@ -14,6 +15,7 @@ import org.slf4j.LoggerFactory;
14 import org.springframework.stereotype.Service; 15 import org.springframework.stereotype.Service;
15 16
16 import javax.annotation.Resource; 17 import javax.annotation.Resource;
  18 +import java.util.List;
17 19
18 /** 20 /**
19 * <B>Description</B> <br /> 21 * <B>Description</B> <br />
@@ -144,4 +146,6 @@ public class ShopRPCImpl implements ShopRPC { @@ -144,4 +146,6 @@ public class ShopRPCImpl implements ShopRPC {
144 throw new ServiceException(ResultCode.NETWORK_FAILED); 146 throw new ServiceException(ResultCode.NETWORK_FAILED);
145 } 147 }
146 } 148 }
  149 +
  150 +
147 } 151 }
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/UserRPCImpl.java
@@ -101,6 +101,29 @@ public class UserRPCImpl implements UserRPC { @@ -101,6 +101,29 @@ public class UserRPCImpl implements UserRPC {
101 } 101 }
102 102
103 @Override 103 @Override
  104 + public void getDepositCardAmount() {
  105 + BaseOutput<BuyerInfoOutput> output = null;
  106 + boolean flag = false;
  107 + try {
  108 + // output = myAppClient.getFundTradeService()..getBuyerInfoByMobilePhone(accountName);
  109 + } catch (Exception e) {
  110 + logger.error("手机号查询买家接口挂掉:msg={}",e.getMessage());
  111 + throw new ServiceException();
  112 + }
  113 +
  114 + //if (output==null||!output.getCode().equals(ResultCode.SUCCESS)){
  115 + // logger.error("手机号查询买家接口失败:[userId={},code={},result={}]",new Object[]{accountName,output.getCode(),output.getResult()});
  116 + // throw new ServiceException();
  117 + //}
  118 + //
  119 + //if(Validator.isNull(output.getData())){
  120 + // logger.info("查询用户为空:[mobile={}]",new Object[]{accountName});
  121 + // throw new ServiceException(ResultCode.BUSINESS_FAILED, ErrorMessage.USER_NOT_EXIST);
  122 + //}
  123 +
  124 + }
  125 +
  126 + @Override
104 public boolean modifyPwd(String accountName, String newPassword) { 127 public boolean modifyPwd(String accountName, String newPassword) {
105 return false; 128 return false;
106 } 129 }
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/goods/GoodsService.java
@@ -13,6 +13,8 @@ import com.diligrp.mobsite.getway.domain.protocol.common.GetProductCategoryReq; @@ -13,6 +13,8 @@ import com.diligrp.mobsite.getway.domain.protocol.common.GetProductCategoryReq;
13 import com.diligrp.mobsite.getway.domain.protocol.common.GetProductCategoryResp; 13 import com.diligrp.mobsite.getway.domain.protocol.common.GetProductCategoryResp;
14 import com.diligrp.mobsite.getway.domain.protocol.detail.GetProductIntroductionReq; 14 import com.diligrp.mobsite.getway.domain.protocol.detail.GetProductIntroductionReq;
15 import com.diligrp.mobsite.getway.domain.protocol.detail.GetProductIntroductionResp; 15 import com.diligrp.mobsite.getway.domain.protocol.detail.GetProductIntroductionResp;
  16 +import com.diligrp.mobsite.getway.domain.protocol.detail.GetProductRecommendReq;
  17 +import com.diligrp.mobsite.getway.domain.protocol.detail.GetProductRecommendResp;
16 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByCategoryReq; 18 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByCategoryReq;
17 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByCategoryResp; 19 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByCategoryResp;
18 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByKeywordReq; 20 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByKeywordReq;
@@ -35,4 +37,6 @@ public interface GoodsService { @@ -35,4 +37,6 @@ public interface GoodsService {
35 SearchProductByCategoryResp searchByCategory(SearchProductByCategoryReq req); 37 SearchProductByCategoryResp searchByCategory(SearchProductByCategoryReq req);
36 38
37 GetProductIntroductionResp getIntroductionById(GetProductIntroductionReq req); 39 GetProductIntroductionResp getIntroductionById(GetProductIntroductionReq req);
  40 +
  41 + GetProductRecommendResp getProductRecommend(GetProductRecommendReq req);
38 } 42 }
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/goods/impl/GoodsServiceImpl.java
1 package com.diligrp.mobsite.getway.service.buyer.goods.impl; 1 package com.diligrp.mobsite.getway.service.buyer.goods.impl;
2 2
  3 +import com.diligrp.mobsite.getway.domain.common.enums.PageEnum;
  4 +import com.diligrp.mobsite.getway.domain.protocol.Goods;
  5 +import com.diligrp.mobsite.getway.domain.protocol.GoodsSuper;
3 import com.diligrp.mobsite.getway.domain.protocol.common.GetProductCategoryReq; 6 import com.diligrp.mobsite.getway.domain.protocol.common.GetProductCategoryReq;
4 import com.diligrp.mobsite.getway.domain.protocol.common.GetProductCategoryResp; 7 import com.diligrp.mobsite.getway.domain.protocol.common.GetProductCategoryResp;
5 import com.diligrp.mobsite.getway.domain.protocol.detail.GetProductIntroductionReq; 8 import com.diligrp.mobsite.getway.domain.protocol.detail.GetProductIntroductionReq;
6 import com.diligrp.mobsite.getway.domain.protocol.detail.GetProductIntroductionResp; 9 import com.diligrp.mobsite.getway.domain.protocol.detail.GetProductIntroductionResp;
  10 +import com.diligrp.mobsite.getway.domain.protocol.detail.GetProductRecommendReq;
  11 +import com.diligrp.mobsite.getway.domain.protocol.detail.GetProductRecommendResp;
7 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByCategoryReq; 12 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByCategoryReq;
8 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByCategoryResp; 13 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByCategoryResp;
9 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByKeywordReq; 14 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByKeywordReq;
10 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByKeywordResp; 15 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByKeywordResp;
  16 +import com.diligrp.mobsite.getway.rpc.GoodsRPC;
11 import com.diligrp.mobsite.getway.service.buyer.goods.GoodsService; 17 import com.diligrp.mobsite.getway.service.buyer.goods.GoodsService;
  18 +import com.diligrp.titan.sdk.domain.Product;
  19 +import com.diligrp.titan.sdk.input.ProductSearchInput;
  20 +import com.diligrp.titan.sdk.output.PageOutput;
  21 +import com.diligrp.website.util.security.Validator;
12 import org.springframework.stereotype.Service; 22 import org.springframework.stereotype.Service;
13 23
  24 +import javax.annotation.Resource;
  25 +import java.util.ArrayList;
  26 +import java.util.List;
  27 +
14 /** 28 /**
15 * @author zhangshirui 29 * @author zhangshirui
16 * @ClassName: GoodsServiceImpl 30 * @ClassName: GoodsServiceImpl
@@ -20,6 +34,10 @@ import org.springframework.stereotype.Service; @@ -20,6 +34,10 @@ import org.springframework.stereotype.Service;
20 @Service("goodsService") 34 @Service("goodsService")
21 public class GoodsServiceImpl implements GoodsService { 35 public class GoodsServiceImpl implements GoodsService {
22 36
  37 + @Resource
  38 + private GoodsRPC goodsRPC;
  39 +
  40 +
23 @Override 41 @Override
24 public SearchProductByKeywordResp searchGoodList(SearchProductByKeywordReq req) { 42 public SearchProductByKeywordResp searchGoodList(SearchProductByKeywordReq req) {
25 return null; 43 return null;
@@ -39,4 +57,34 @@ public class GoodsServiceImpl implements GoodsService { @@ -39,4 +57,34 @@ public class GoodsServiceImpl implements GoodsService {
39 public GetProductIntroductionResp getIntroductionById(GetProductIntroductionReq req) { 57 public GetProductIntroductionResp getIntroductionById(GetProductIntroductionReq req) {
40 return null; 58 return null;
41 } 59 }
  60 +
  61 + @Override
  62 + public GetProductRecommendResp getProductRecommend(GetProductRecommendReq req) {
  63 + ProductSearchInput input = new ProductSearchInput();
  64 + input.setIndexTop(0);
  65 + input.setPageSize(PageEnum.MINPAGESIZE.getValue());
  66 + input.setPage(Validator.isNull(req.getPageNum()) ? PageEnum.PAGENUM.getValue() : req.getPageNum());
  67 + PageOutput<List<Product>> recommendGoods = goodsRPC.getProductRecommend(input, req.getUserId());
  68 + GetProductRecommendResp resp = new GetProductRecommendResp();
  69 + if (!Validator.isEmpty(recommendGoods.getData())){
  70 + resp.setGoods(buildRecommendGoods(recommendGoods.getData()));
  71 + }
  72 + resp.setMaxPageNum(recommendGoods.getTotalPage());
  73 + return resp;
  74 + }
  75 +
  76 +
  77 +
  78 + private List<GoodsSuper> buildRecommendGoods(List<Product> recommendGoods) {
  79 + List<GoodsSuper> goodsList = new ArrayList<>();
  80 + for(Product goodsInfo:recommendGoods){
  81 + GoodsSuper goods = new Goods();
  82 + goods.setPid(goodsInfo.getPid());
  83 + goods.setName("");
  84 + goods.setDefaultPic("");
  85 + goodsList.add(goods);
  86 + }
  87 + return goodsList;
  88 + }
  89 +
42 } 90 }
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/shop/ShopService.java
1 package com.diligrp.mobsite.getway.service.buyer.shop; 1 package com.diligrp.mobsite.getway.service.buyer.shop;
2 2
3 -import com.diligrp.mobsite.getway.domain.protocol.GetShopDeliveryTimeReq;  
4 -import com.diligrp.mobsite.getway.domain.protocol.GetShopDeliveryTimeResp;  
5 import com.diligrp.mobsite.getway.domain.protocol.detail.*; 3 import com.diligrp.mobsite.getway.domain.protocol.detail.*;
6 -import com.diligrp.mobsite.getway.domain.protocol.search.*;  
7 -import com.diligrp.mobsite.getway.domain.protocol.shop.*;  
8 4
9 5
10 /** 6 /**
@@ -20,4 +16,5 @@ public interface ShopService { @@ -20,4 +16,5 @@ public interface ShopService {
20 BindToShopResp bindToShop(BindToShopReq req); 16 BindToShopResp bindToShop(BindToShopReq req);
21 17
22 GetShopByIdResp getShopById(GetShopByIdReq req); 18 GetShopByIdResp getShopById(GetShopByIdReq req);
  19 +
23 } 20 }
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/shop/impl/ShopServiceImpl.java
@@ -5,15 +5,12 @@ import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerOutput; @@ -5,15 +5,12 @@ import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerOutput;
5 import com.diligrp.mobsite.getway.domain.common.ErrorMessage; 5 import com.diligrp.mobsite.getway.domain.common.ErrorMessage;
6 import com.diligrp.mobsite.getway.domain.common.ResultCode; 6 import com.diligrp.mobsite.getway.domain.common.ResultCode;
7 import com.diligrp.mobsite.getway.domain.except.ServiceException; 7 import com.diligrp.mobsite.getway.domain.except.ServiceException;
8 -import com.diligrp.mobsite.getway.domain.protocol.GetShopDeliveryTimeReq;  
9 -import com.diligrp.mobsite.getway.domain.protocol.GetShopDeliveryTimeResp;  
10 import com.diligrp.mobsite.getway.domain.protocol.detail.BindToShopReq; 8 import com.diligrp.mobsite.getway.domain.protocol.detail.BindToShopReq;
11 import com.diligrp.mobsite.getway.domain.protocol.detail.BindToShopResp; 9 import com.diligrp.mobsite.getway.domain.protocol.detail.BindToShopResp;
12 import com.diligrp.mobsite.getway.domain.protocol.detail.GetShopByIdReq; 10 import com.diligrp.mobsite.getway.domain.protocol.detail.GetShopByIdReq;
13 import com.diligrp.mobsite.getway.domain.protocol.detail.GetShopByIdResp; 11 import com.diligrp.mobsite.getway.domain.protocol.detail.GetShopByIdResp;
14 -import com.diligrp.mobsite.getway.rpc.DeliveryTimeRPC;  
15 import com.diligrp.mobsite.getway.rpc.ShopBuyerRPC; 12 import com.diligrp.mobsite.getway.rpc.ShopBuyerRPC;
16 -import com.diligrp.mobsite.getway.rpc.impl.ShopRPCImpl; 13 +import com.diligrp.mobsite.getway.rpc.ShopRPC;
17 import com.diligrp.mobsite.getway.service.buyer.shop.ShopService; 14 import com.diligrp.mobsite.getway.service.buyer.shop.ShopService;
18 import com.diligrp.website.util.security.Validator; 15 import com.diligrp.website.util.security.Validator;
19 import org.slf4j.Logger; 16 import org.slf4j.Logger;
@@ -22,7 +19,6 @@ import org.springframework.stereotype.Service; @@ -22,7 +19,6 @@ import org.springframework.stereotype.Service;
22 19
23 import javax.annotation.Resource; 20 import javax.annotation.Resource;
24 import java.util.ArrayList; 21 import java.util.ArrayList;
25 -import java.util.Arrays;  
26 import java.util.List; 22 import java.util.List;
27 23
28 24
@@ -38,7 +34,7 @@ import java.util.List; @@ -38,7 +34,7 @@ import java.util.List;
38 public class ShopServiceImpl implements ShopService { 34 public class ShopServiceImpl implements ShopService {
39 35
40 @Resource 36 @Resource
41 - private ShopRPCImpl shopRPC; 37 + private ShopRPC shopRPC;
42 @Resource 38 @Resource
43 private ShopBuyerRPC shopBuyerRPC; 39 private ShopBuyerRPC shopBuyerRPC;
44 40
@@ -82,4 +78,6 @@ public class ShopServiceImpl implements ShopService { @@ -82,4 +78,6 @@ public class ShopServiceImpl implements ShopService {
82 return resp; 78 return resp;
83 } 79 }
84 80
  81 +
  82 +
85 } 83 }
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/user/impl/UserServiceImpl.java
@@ -363,6 +363,9 @@ public class UserServiceImpl implements UserService { @@ -363,6 +363,9 @@ public class UserServiceImpl implements UserService {
363 363
364 @Override 364 @Override
365 public GetDepositCardAmountResp getDepositCardAmount(GetDepositCardAmountReq req) { 365 public GetDepositCardAmountResp getDepositCardAmount(GetDepositCardAmountReq req) {
  366 +
  367 + userRPC.getDepositCardAmount();
  368 +
366 return null; 369 return null;
367 } 370 }
368 371
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/base/CommonController.java
@@ -24,7 +24,7 @@ import javax.annotation.Resource; @@ -24,7 +24,7 @@ import javax.annotation.Resource;
24 */ 24 */
25 @Controller 25 @Controller
26 @RequestMapping("/mobsiteApp/common") 26 @RequestMapping("/mobsiteApp/common")
27 -@Api(value = "/mobsiteApp/common", description = "公共:城市信息,上传图片等") 27 +@Api(value = "/mobsiteApp-common", description = "公共:城市信息,上传图片等")
28 28
29 public class CommonController extends BaseApiController { 29 public class CommonController extends BaseApiController {
30 30
@@ -55,7 +55,7 @@ public class CommonController extends BaseApiController { @@ -55,7 +55,7 @@ public class CommonController extends BaseApiController {
55 /** 55 /**
56 * 根据城市id查询城市信息 56 * 根据城市id查询城市信息
57 */ 57 */
58 - @ApiOperation(value = "根据城市id查询城市信息", httpMethod = "POST",response = GetCitysResp.class) 58 + @ApiOperation(value = "根据城市id数组查询城市信息", httpMethod = "POST",response = GetCitysResp.class)
59 @RequestMapping(value = "/getCitys",method = RequestMethod.POST) 59 @RequestMapping(value = "/getCitys",method = RequestMethod.POST)
60 @ResponseBody 60 @ResponseBody
61 public void getCitys(@ModelAttribute GetCitysReq temp) { 61 public void getCitys(@ModelAttribute GetCitysReq temp) {
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/goods/GoodsController.java
@@ -3,8 +3,7 @@ package com.diligrp.mobsite.getway.web.api.buyer.goods; @@ -3,8 +3,7 @@ package com.diligrp.mobsite.getway.web.api.buyer.goods;
3 import com.diligrp.mobsite.getway.domain.except.ServiceException; 3 import com.diligrp.mobsite.getway.domain.except.ServiceException;
4 import com.diligrp.mobsite.getway.domain.protocol.common.GetProductCategoryReq; 4 import com.diligrp.mobsite.getway.domain.protocol.common.GetProductCategoryReq;
5 import com.diligrp.mobsite.getway.domain.protocol.common.GetProductCategoryResp; 5 import com.diligrp.mobsite.getway.domain.protocol.common.GetProductCategoryResp;
6 -import com.diligrp.mobsite.getway.domain.protocol.detail.GetProductIntroductionReq;  
7 -import com.diligrp.mobsite.getway.domain.protocol.detail.GetProductIntroductionResp; 6 +import com.diligrp.mobsite.getway.domain.protocol.detail.*;
8 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByCategoryReq; 7 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByCategoryReq;
9 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByCategoryResp; 8 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByCategoryResp;
10 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByKeywordReq; 9 import com.diligrp.mobsite.getway.domain.protocol.search.SearchProductByKeywordReq;
@@ -148,6 +147,24 @@ public class GoodsController extends BaseApiController { @@ -148,6 +147,24 @@ public class GoodsController extends BaseApiController {
148 147
149 } 148 }
150 149
  150 + /**
  151 + * 获取热门推荐
  152 + */
  153 + @ApiOperation(value = "热门推荐", httpMethod = "POST",response = BindToShopResp.class)
  154 + @RequestMapping(value = "/getProductRecommend",method = RequestMethod.POST)
  155 + @ResponseBody
  156 + public void getProductRecommend(@RequestBody GetProductRecommendReq temp) {
  157 + GetProductRecommendReq req = getRequest(GetProductRecommendReq.class);
  158 + GetProductRecommendResp resp = null;
  159 + try {
  160 + resp = goodsService.getProductRecommend(req);
  161 + sendSuccessResp(resp);
  162 + }
  163 + catch(Exception e) {
  164 + log.error(String.format("ErrorMessage=%s,UserId=%s",e.getMessage(),req.getUserId()), e);
  165 + sendError(e.getMessage());
  166 + }
  167 + }
151 168
152 169
153 } 170 }
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/shop/ShopController.java
@@ -79,24 +79,6 @@ public class ShopController extends BaseApiController { @@ -79,24 +79,6 @@ public class ShopController extends BaseApiController {
79 } 79 }
80 } 80 }
81 81
82 - /**  
83 - * 获取热门推荐  
84 - */  
85 - @ApiOperation(value = "热门推荐", httpMethod = "POST",response = BindToShopResp.class)  
86 - @RequestMapping(value = "/getProductRecommend",method = RequestMethod.POST)  
87 - @ResponseBody  
88 - public void getProductRecommend(@RequestBody GetProductRecommendReq temp) {  
89 - GetProductRecommendReq req = getRequest(GetProductRecommendReq.class);  
90 - GetProductRecommendResp resp = null;  
91 - try {  
92 - BeanValidator.validator(req);  
93 - sendSuccessResp(resp);  
94 - }  
95 - catch(Exception e) {  
96 - log.error(String.format("ErrorMessage=%s,UserId=%s",e.getMessage(),req.getUserId()), e);  
97 - sendError(e.getMessage());  
98 - }  
99 - }  
100 82
101 83
102 /** 84 /**
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/user/UserController.java
@@ -341,50 +341,50 @@ public class UserController extends BaseApiController { @@ -341,50 +341,50 @@ public class UserController extends BaseApiController {
341 } 341 }
342 342
343 343
344 - /**  
345 - * 查询用户信息  
346 - * GetUserInfoReq  
347 - */  
348 - @ApiOperation(value = "查询买家用户信息", httpMethod = "POST" ,response = GetDepositCardAmountResp.class)  
349 - @RequestMapping(value = "/getBuyerInfo",method = RequestMethod.POST)  
350 - @ResponseBody  
351 - public void getBuyerInfo() {  
352 - GetUserInfoReq req = getRequest(GetUserInfoReq.class);  
353 - try {  
354 - GetUserInfoResp resp = userService.getUserIntroduction(req);  
355 - super.sendSuccessResp(resp);  
356 - } catch (ServiceException e){  
357 - LOGGER.error(String.format("Code=%s,ErrorMessage=%s,UserId=%s",  
358 - e.getCode(), e.getMessage(), req.getUserId()), e);  
359 - sendError(e.getCode(), e.getMessage());  
360 - } catch (Exception e) {  
361 - LOGGER.error(String.format("ErrorMessage=%s,UserId=%s", e.getMessage(), req.getUserId()), e);  
362 - sendError(e.getMessage());  
363 - }  
364 - } 344 + ///**
  345 + // * 查询用户信息
  346 + // * GetUserInfoReq
  347 + // */
  348 + //@ApiOperation(value = "查询买家用户信息", httpMethod = "POST" ,response = GetDepositCardAmountResp.class)
  349 + //@RequestMapping(value = "/getBuyerInfo",method = RequestMethod.POST)
  350 + //@ResponseBody
  351 + //public void getBuyerInfo() {
  352 + // GetUserInfoReq req = getRequest(GetUserInfoReq.class);
  353 + // try {
  354 + // GetUserInfoResp resp = userService.getUserIntroduction(req);
  355 + // super.sendSuccessResp(resp);
  356 + // } catch (ServiceException e){
  357 + // LOGGER.error(String.format("Code=%s,ErrorMessage=%s,UserId=%s",
  358 + // e.getCode(), e.getMessage(), req.getUserId()), e);
  359 + // sendError(e.getCode(), e.getMessage());
  360 + // } catch (Exception e) {
  361 + // LOGGER.error(String.format("ErrorMessage=%s,UserId=%s", e.getMessage(), req.getUserId()), e);
  362 + // sendError(e.getMessage());
  363 + // }
  364 + //}
365 365
366 366
367 - /**  
368 - * 搜索买家用户信息  
369 - * GetUserInfoReq  
370 - */  
371 - @ApiOperation(value = "搜索买家用户信息", httpMethod = "POST" ,response = SearchUserInfoResp.class)  
372 - @RequestMapping(value = "/searchBuyerInfo",method = RequestMethod.POST)  
373 - @ResponseBody  
374 - public void searchBuyerInfo(@RequestBody SearchUserInfoReq temp) {  
375 - SearchUserInfoReq req = getRequest(SearchUserInfoReq.class);  
376 - try {  
377 - SearchUserInfoResp resp = userService.searchBuyerInfo(req);  
378 - super.sendSuccessResp(resp);  
379 - } catch (ServiceException e){  
380 - LOGGER.error(String.format("Code=%s,ErrorMessage=%s,UserId=%s",  
381 - e.getCode(), e.getMessage(), req.getUserId()), e);  
382 - sendError(e.getCode(), e.getMessage());  
383 - } catch (Exception e) {  
384 - LOGGER.error(String.format("ErrorMessage=%s,UserId=%s", e.getMessage(), req.getUserId()), e);  
385 - sendError(e.getMessage());  
386 - }  
387 - } 367 + ///**
  368 + // * 搜索买家用户信息
  369 + // * GetUserInfoReq
  370 + // */
  371 + //@ApiOperation(value = "搜索买家用户信息", httpMethod = "POST" ,response = SearchUserInfoResp.class)
  372 + //@RequestMapping(value = "/searchBuyerInfo",method = RequestMethod.POST)
  373 + //@ResponseBody
  374 + //public void searchBuyerInfo(@RequestBody SearchUserInfoReq temp) {
  375 + // SearchUserInfoReq req = getRequest(SearchUserInfoReq.class);
  376 + // try {
  377 + // SearchUserInfoResp resp = userService.searchBuyerInfo(req);
  378 + // super.sendSuccessResp(resp);
  379 + // } catch (ServiceException e){
  380 + // LOGGER.error(String.format("Code=%s,ErrorMessage=%s,UserId=%s",
  381 + // e.getCode(), e.getMessage(), req.getUserId()), e);
  382 + // sendError(e.getCode(), e.getMessage());
  383 + // } catch (Exception e) {
  384 + // LOGGER.error(String.format("ErrorMessage=%s,UserId=%s", e.getMessage(), req.getUserId()), e);
  385 + // sendError(e.getMessage());
  386 + // }
  387 + //}
388 388
389 389
390 /** 390 /**