Commit b9d47982 authored by zhangfeng's avatar zhangfeng

接口幂等

parent 9f3e916f
......@@ -3,10 +3,9 @@ package cn.iocoder.yudao.module.member.controller.admin.scoreRule;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.depository.service.warehouse.WarehouseService;
import cn.iocoder.yudao.module.depository.vo.warehouse.WarehouseTreeRegionVO;
import cn.iocoder.yudao.module.member.api.ScoreProducerApi;
import cn.iocoder.yudao.module.member.convert.scoreRule.ScoreRuleConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.scoreRule.ScoreRuleDO;
......@@ -16,7 +15,6 @@ import cn.iocoder.yudao.module.member.vo.scoreRule.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.ListUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
......@@ -49,6 +47,7 @@ public class ScoreRuleController {
@PostMapping("/create")
@ApiOperation("创建积分规则")
@Idempotent(timeout = 3)
@PreAuthorize("@ss.hasPermission('member:score-rule:create')")
public CommonResult<Long> createScoreRule(@Valid @RequestBody ScoreRuleCreateReqVO createReqVO) {
return success(scoreRuleService.createScoreRule(createReqVO));
......@@ -105,6 +104,7 @@ public class ScoreRuleController {
@PostMapping("/copy")
@ApiOperation("复制规则")
@Idempotent(timeout = 3)
@PreAuthorize("@ss.hasPermission('member:score-rule:create')")
public CommonResult<Long> copyScoreRule(@Valid @RequestBody IdReqVo idReqVo) {
return success(scoreRuleService.copyScoreRule(idReqVo.getId()));
......
......@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.member.controller.admin.userScore;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.module.member.api.score.MemberUserScoreApiImpl;
import cn.iocoder.yudao.module.member.api.score.dto.MemberUserScoreBatchOperateReqDTO;
import cn.iocoder.yudao.module.member.api.score.dto.MemberUserScoreOperateRespDTO;
......@@ -50,6 +51,7 @@ public class MemberUserScoreController {
@PostMapping("/operate")
@ApiOperation("操作积分")
@Idempotent(timeout = 5)
@PreAuthorize("@ss.hasPermission('member:user-score:operate')")
public CommonResult<Boolean> operate(@Valid @RequestBody MemberUserScoreOperateQueryVO query) {
Map<String,Object> extParam = new HashMap<>();
......
package cn.iocoder.yudao.module.member.controller.app.address;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.module.member.convert.address.UserAddressConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.address.UserAddressDO;
import cn.iocoder.yudao.module.member.service.address.UserAddressService;
......@@ -30,6 +31,7 @@ public class UserAddressController {
@PostMapping("/create")
@ApiOperation("创建会员收货地址")
@Idempotent(timeout = 5)
//@PreAuthenticated
public CommonResult<Long> createUserAddress(@Valid @RequestBody UserAddressCreateReqVO createReqVO) {
return success(userAddressService.createUserAddress(createReqVO));
......
......@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.reward.controller.admin.redeem;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.module.reward.api.reward.RedeemRewardApi;
import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemRewardReqVO;
import cn.iocoder.yudao.module.reward.api.reward.dto.RedeemRewardRespDTO;
......@@ -124,6 +125,7 @@ public class RedeemRewardController {
@PostMapping("/single")
@ApiOperation("兑换礼品")
@Idempotent(timeout = 5)
@PreAuthorize("@ss.hasPermission('ecw:giftManagement:exchange')")
public CommonResult<Boolean> redeemReward(@Valid @RequestBody RedeemRewardReqVO redeemRewardReqVO) {
return success(redeemRewardApi.redeemReward(redeemRewardReqVO));
......@@ -131,6 +133,7 @@ public class RedeemRewardController {
@PostMapping("/batch")
@ApiOperation("批量兑换礼品")
@Idempotent(timeout = 5)
@PreAuthorize("@ss.hasPermission('ecw:giftManagement:exchange')")
public CommonResult<List<RedeemRewardRespDTO>> redeemRewards(@Valid @RequestBody List<RedeemRewardReqVO> redeemRewardReqVOList) {
return success(redeemRewardApi.redeemRewards(redeemRewardReqVOList));
......
......@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.reward.controller.admin.reward;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.reward.convert.reward.RewardConvert;
......@@ -38,6 +39,7 @@ public class RewardController {
@PostMapping("/create")
@ApiOperation("创建礼品")
@Idempotent(timeout = 3)
@PreAuthorize("@ss.hasPermission('ecw:giftManagement:add')")
public CommonResult<Long> create(@Valid @RequestBody RewardCreateReqVO createReqVO) {
return success(rewardService.create(createReqVO));
......@@ -99,6 +101,7 @@ public class RewardController {
@PostMapping("/copy/{id}")
@ApiOperation("复制礼品")
@Idempotent(timeout = 3)
@PreAuthorize("@ss.hasPermission('ecw:giftManagement:copy')")
public CommonResult<Long> copyReward(@NotNull @PathVariable Long id) {
return success(rewardService.copyReward(id));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment