Kaynağa Gözat

fix 下掉优惠券接口

zoujiajian 6 saat önce
ebeveyn
işleme
49be28b3e6

+ 34 - 35
netflix-web/src/main/java/com/cyksj/web/controller/manage/coupon/CouponController.java

@@ -34,7 +34,6 @@ import com.ejlchina.searcher.util.MapUtils;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.dao.DuplicateKeyException;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.Assert;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -91,40 +90,40 @@ public class CouponController {
 
 	private final CouponUserPopupsOrderRelateMapper couponUserPopupsOrderRelateMapper;
 
-	/**
-	 * 新增优惠券
-	 */
-	@PostMapping
-	@Log(module = "优惠券/新增优惠券", businessType = BusinessType.POST, isSaveRequestData = true)
-	public Result<String> couponSave(@RequestBody @Validated Coupon coupon) throws Exception {
-		couponCommonService.saveCoupon(coupon);
-		return GatewayResponse.SUCCESS.newBuilder().toResult("新增优惠券成功");
-	}
-
-	/**
-	 * 删除优惠券
-	 */
-	@DeleteMapping("/{id}")
-	@Transactional(rollbackFor = Throwable.class)
-	@Log(module = "优惠券/删除优惠券", businessType = BusinessType.DELETE)
-	public Result<String> couponSave(@PathVariable Long id) throws Exception {
-		couponMapper.deleteById(id);
-		couponSkuMapper.deleteByCid(id);
-		couponActiveMapper.deleteByCouponId(id);
-		couponRecommendMapper.deleteByCouponId(id);
-		couponDistributePopularizeMapper.deleteByCouponId(id);
-		return GatewayResponse.SUCCESS.newBuilder().toResult("删除优惠券成功");
-	}
-
-	/**
-	 * 修改优惠券
-	 */
-	@PutMapping
-	@Log(module = "优惠券/编辑优惠券", businessType = BusinessType.PUT, isSaveRequestData = true)
-	public Result<String> putCoupon(@RequestBody @Validated Coupon coupon) throws Exception {
-		couponCommonService.updateCoupon(coupon);
-		return GatewayResponse.SUCCESS.newBuilder().toResult("修改优惠券成功");
-	}
+//	/**
+//	 * 新增优惠券
+//	 */
+//	@PostMapping
+//	@Log(module = "优惠券/新增优惠券", businessType = BusinessType.POST, isSaveRequestData = true)
+//	public Result<String> couponSave(@RequestBody @Validated Coupon coupon) throws Exception {
+//		couponCommonService.saveCoupon(coupon);
+//		return GatewayResponse.SUCCESS.newBuilder().toResult("新增优惠券成功");
+//	}
+
+//	/**
+//	 * 删除优惠券
+//	 */
+//	@DeleteMapping("/{id}")
+//	@Transactional(rollbackFor = Throwable.class)
+//	@Log(module = "优惠券/删除优惠券", businessType = BusinessType.DELETE)
+//	public Result<String> couponSave(@PathVariable Long id) throws Exception {
+//		couponMapper.deleteById(id);
+//		couponSkuMapper.deleteByCid(id);
+//		couponActiveMapper.deleteByCouponId(id);
+//		couponRecommendMapper.deleteByCouponId(id);
+//		couponDistributePopularizeMapper.deleteByCouponId(id);
+//		return GatewayResponse.SUCCESS.newBuilder().toResult("删除优惠券成功");
+//	}
+
+//	/**
+//	 * 修改优惠券
+//	 */
+//	@PutMapping
+//	@Log(module = "优惠券/编辑优惠券", businessType = BusinessType.PUT, isSaveRequestData = true)
+//	public Result<String> putCoupon(@RequestBody @Validated Coupon coupon) throws Exception {
+//		couponCommonService.updateCoupon(coupon);
+//		return GatewayResponse.SUCCESS.newBuilder().toResult("修改优惠券成功");
+//	}
 
 	/**
 	 * 发放优惠券