调整合并代码出现的问题

main
whb 5 months ago
parent ce275c1d12
commit ac9d24e475

@ -30,8 +30,8 @@ import java.util.List;
@Api(tags = "商品交易中心")
public class StuGoodsTradingCenterController {
@Autowired
private StuGoodsTradingCenterService stuGoodsTradingCenterService;
@Resource
StuGoodsTradingCenterService tradingCenterService;
@ -41,7 +41,7 @@ public class StuGoodsTradingCenterController {
public ResultEntity getSmallAdPlacement(String userId) {
//销量前10位的商品
return stuGoodsTradingCenterService.getSmallAdPlacement(userId);
return tradingCenterService.getSmallAdPlacement(userId);
}
@ -51,7 +51,7 @@ public class StuGoodsTradingCenterController {
public ResultEntity getAllProductInquiries(String userId) {
return stuGoodsTradingCenterService.AllProductInquiries(userId);
return tradingCenterService.AllProductInquiries(userId);
}
@ -61,7 +61,7 @@ public class StuGoodsTradingCenterController {
@GetMapping("/productInquiry")
public ResultEntity getProductInquiry(String userId,String keyWord) {
return stuGoodsTradingCenterService.getProductInquiry(userId,keyWord);
return tradingCenterService.getProductInquiry(userId,keyWord);
}
@ -69,6 +69,14 @@ public class StuGoodsTradingCenterController {
//todo 查询购物车数量
@ApiOperation("购物车数量")
@AnonymousAccess
@GetMapping("/numberOfShopping")
public ResultEntity getNumberOfShopping(String userId) {
return tradingCenterService.getNumberOfShopping(userId);
}
//大广告招租
@ -77,7 +85,7 @@ public class StuGoodsTradingCenterController {
@GetMapping("/bigAdPlacement")
public ResultEntity getBigAdPlacement(String userId) {
return stuGoodsTradingCenterService.getBigAdPlacement(userId);
return tradingCenterService.getBigAdPlacement(userId);
}
@ -86,7 +94,7 @@ public class StuGoodsTradingCenterController {
@GetMapping("/getTypeQuery")
public ResultEntity getTypeQuery(String userId,String type) {
return stuGoodsTradingCenterService.getTypeQuery(userId,type);
return tradingCenterService.getTypeQuery(userId,type);
}
@ -94,8 +102,7 @@ public class StuGoodsTradingCenterController {
@Resource
StuGoodsTradingCenterService tradingCenterService;
@ApiOperation("购物车信息展示")
@PostMapping("/getShoppingCartInfo")
@ -106,4 +113,9 @@ public class StuGoodsTradingCenterController {
return new ResultEntity(HttpStatus.OK,"购物车信息", tradingCenterService.getShoppingCartInfo(userId,index,size));
}
}

@ -27,4 +27,7 @@ public interface StuGoodsTradingCenterService {
//根据类型展示数据
ResultEntity getTypeQuery(String userId, String type);
//购物车数量
ResultEntity getNumberOfShopping(String userId);
}

@ -102,7 +102,7 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
}
//大广告招租
@Override
public PageInfo<StuShoppingCartInfo> getShoppingCartInfo(String userId, Integer index, Integer size) {
StuShoppingCartInfoExample cartInfoExample=new StuShoppingCartInfoExample();
@ -113,7 +113,7 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
}
//大广告招租
@Override
public ResultEntity getBigAdPlacement(String userId) {
//查询用户商品销售管理数据
@ -156,4 +156,23 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe
}
//购物车数量
@Override
public ResultEntity getNumberOfShopping(String userId) {
StuShoppingCartInfoExample cartInfoExample=new StuShoppingCartInfoExample();
cartInfoExample.createCriteria().andUserIdEqualTo(userId);
List<StuShoppingCartInfo> stuShoppingCartInfos = shoppingCartInfoMapper.selectByExample(cartInfoExample);
if (stuShoppingCartInfos != null && stuShoppingCartInfos.size() > 0) {
return new ResultEntity(HttpStatus.OK,stuShoppingCartInfos.size());
}else {
return new ResultEntity<>(HttpStatus.OK,0);
}
}
}

Loading…
Cancel
Save