订单模块
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
<module>service-user-client</module>
|
||||
<module>service-search-client</module>
|
||||
<module>service-activity-client</module>
|
||||
<module>service-cart-client</module>
|
||||
</modules>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@@ -1,5 +1,9 @@
|
||||
package com.atguigu.ssyx.client.activity;
|
||||
|
||||
import com.atguigu.ssyx.model.activity.CouponInfo;
|
||||
import com.atguigu.ssyx.model.order.CartInfo;
|
||||
import com.atguigu.ssyx.vo.order.CartInfoVo;
|
||||
import com.atguigu.ssyx.vo.order.OrderConfirmVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -20,10 +24,30 @@ import java.util.Map;
|
||||
@FeignClient(value = "service-activity")
|
||||
public interface ActivityFeignClient {
|
||||
|
||||
@ApiOperation(value = "根据skuId列表获取促销信息")
|
||||
@PostMapping("/api/activity/inner/findActivity")
|
||||
Map<Long, List<String>> findActivity(@RequestBody List<Long> skuIdList);
|
||||
|
||||
@ApiOperation("根据skuID获取营销数据和优惠卷")
|
||||
@GetMapping("/api/activity/inner/findActivityAndCoupon/{skuId}/{userId}")
|
||||
Map<String, Object> findActivityAndCoupon(@PathVariable("skuId") Long skuId, @PathVariable("userId") Long userId);
|
||||
|
||||
@ApiOperation("获取购物车中满足条件优惠券和活动")
|
||||
@PostMapping("/api/activity/inner/findCartActivityAndCoupon/{userId}")
|
||||
OrderConfirmVo findCartActivityAndCoupon(
|
||||
@RequestBody List<CartInfo> cartInfoList, @PathVariable("userId") Long userId);
|
||||
|
||||
@ApiOperation("获取购物车对应规则数据")
|
||||
@PostMapping("/api/activity/inner/findCartActivityList")
|
||||
List<CartInfoVo> findCartActivityList(@RequestBody List<CartInfo> cartInfoList);
|
||||
|
||||
@ApiOperation("获取购物车对应优惠券数据")
|
||||
@PostMapping("/api/activity/inner/findRangeSkuIdList")
|
||||
CouponInfo findRangeSkuIdList(@RequestBody List<CartInfo> cartInfoList, @PathVariable("couponId") Long couponId);
|
||||
|
||||
@ApiOperation(value = "更新优惠卷使用状态")
|
||||
@GetMapping("/api/activity/inner/updateCouponInfoUseStatus/{couponId}/{userId}/{orderId}")
|
||||
Boolean updateCouponInfoUseStatus(@PathVariable("couponId") Long couponId,
|
||||
@PathVariable("userId") Long userId,
|
||||
@PathVariable("orderId") Long orderId);
|
||||
}
|
||||
|
20
guigu-ssyx-parent/service-client/service-cart-client/pom.xml
Normal file
20
guigu-ssyx-parent/service-client/service-cart-client/pom.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.atguigu</groupId>
|
||||
<artifactId>service-client</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>service-cart-client</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
</project>
|
@@ -0,0 +1,24 @@
|
||||
package com.atguigu.ssyx.client.cart;
|
||||
|
||||
import com.atguigu.ssyx.model.order.CartInfo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ClassName: CartFeignClient
|
||||
* Package: com.atguigu.ssyx.client.cart
|
||||
*
|
||||
* @author yovinchen
|
||||
* @Create 2023/10/12 15:49
|
||||
*/
|
||||
@FeignClient(value = "service-cart")
|
||||
public interface CartFeignClient {
|
||||
|
||||
@ApiOperation(value = "根据用户Id查询购物车列表")
|
||||
@PostMapping("/api/cart/inner/getCartCheckedList/{userId}")
|
||||
List<CartInfo> getCartCheckedList(@PathVariable("userId") Long userId);
|
||||
}
|
@@ -3,6 +3,7 @@ package com.atguigu.ssyx.client.product;
|
||||
import com.atguigu.ssyx.model.product.Category;
|
||||
import com.atguigu.ssyx.model.product.SkuInfo;
|
||||
import com.atguigu.ssyx.vo.product.SkuInfoVo;
|
||||
import com.atguigu.ssyx.vo.product.SkuStockLockVo;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -53,7 +54,7 @@ public interface ProductFeignClient {
|
||||
* @param skuIdList
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/api/product/inner/findSkuInfoList")
|
||||
@PostMapping("/api/product/inner/findSkuInfoList")
|
||||
List<SkuInfo> findSkuInfoList(@RequestBody List<Long> skuIdList);
|
||||
|
||||
/**
|
||||
@@ -89,4 +90,7 @@ public interface ProductFeignClient {
|
||||
*/
|
||||
@GetMapping("/api/product/inner/getSkuInfoVo/{skuId}")
|
||||
SkuInfoVo getSkuInfoVo(@PathVariable Long skuId);
|
||||
|
||||
@PostMapping("/api/product/inner/checkAndLock/{orderNo}")
|
||||
Boolean checkAndLock(@RequestBody List<SkuStockLockVo> commonStockLockVoList, @PathVariable("orderNo") String orderNo);
|
||||
}
|
||||
|
Reference in New Issue
Block a user