|
@@ -11,10 +11,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -232,4 +229,33 @@ public class CartClubApi {
|
|
|
return cartClubService.updateUserInvoice(invoiceDto);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 供应商优惠券
|
|
|
+ *
|
|
|
+ * @param userId 用户id
|
|
|
+ * @param shopId 供应商id
|
|
|
+ * @param source 来源 : 1 网站 ; 2 小程序
|
|
|
+ * @param status 状态: 1未领取 2已领取
|
|
|
+ */
|
|
|
+ @ApiOperation("领取供应商优惠券(旧:/shoppingCart/get/coupon)")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(required = false, name = "userId", value = "用户Id"),
|
|
|
+ @ApiImplicitParam(required = false, name = "shopId", value = "供应商Id"),
|
|
|
+ @ApiImplicitParam(required = false, name = "status", value = "状态: 1未领取, 2已领取"),
|
|
|
+ @ApiImplicitParam(required = false, name = "source", value = "来源: 1网站, 2小程序")
|
|
|
+ })
|
|
|
+ @GetMapping("/coupon")
|
|
|
+ public ResponseJson<Map<String, Object>> getShopCoupons(Integer userId, Integer shopId, Integer source,
|
|
|
+ @RequestParam(name = "status", defaultValue = "1") Integer status) {
|
|
|
+ if (null == userId) {
|
|
|
+ return ResponseJson.error("用户Id不能为空!", null);
|
|
|
+ }
|
|
|
+ if (null == shopId) {
|
|
|
+ return ResponseJson.error("供应商Id不能为空!", null);
|
|
|
+ }
|
|
|
+ if (null == source) {
|
|
|
+ return ResponseJson.error("来源source不能为空!", null);
|
|
|
+ }
|
|
|
+ return cartClubService.getShopCoupons(userId, shopId, source, status);
|
|
|
+ }
|
|
|
}
|