|
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import shop.alien.entity.result.R;
|
|
import shop.alien.entity.result.R;
|
|
|
import shop.alien.entity.store.StorePlatformBenefits;
|
|
import shop.alien.entity.store.StorePlatformBenefits;
|
|
@@ -112,27 +111,6 @@ public class StorePlatformBenefitsController {
|
|
|
return R.fail("审核失败");
|
|
return R.fail("审核失败");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @ApiOperation("领取福利(优惠券或U币)")
|
|
|
|
|
- @ApiOperationSupport(order = 7)
|
|
|
|
|
- @PostMapping("/receive")
|
|
|
|
|
- @ApiImplicitParams({
|
|
|
|
|
- @ApiImplicitParam(name = "id", value = "福利ID", dataType = "int", paramType = "query", required = true),
|
|
|
|
|
- @ApiImplicitParam(name = "userId", value = "用户ID", dataType = "int", paramType = "query", required = true)
|
|
|
|
|
- })
|
|
|
|
|
- @Transactional
|
|
|
|
|
- public R<String> receiveBenefits(@RequestParam Integer id,@RequestParam(required = false) Integer userId) {
|
|
|
|
|
- log.info("StorePlatformBenefitsController.receiveBenefits - id={},userId={}", id,userId);
|
|
|
|
|
- try {
|
|
|
|
|
- String result = benefitsService.receiveBenefits(id,userId);
|
|
|
|
|
- return R.success(result);
|
|
|
|
|
- } catch (RuntimeException e) {
|
|
|
|
|
- log.error("StorePlatformBenefitsController.receiveBenefits - error: {}", e.getMessage());
|
|
|
|
|
- return R.fail(e.getMessage());
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.error("StorePlatformBenefitsController.receiveBenefits - error: ", e);
|
|
|
|
|
- return R.fail("领取失败,请稍后重试");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|