重复领取问题
This commit is contained in:
@@ -231,6 +231,9 @@ public class DiscSpinningController {
|
|||||||
@PostMapping("/app/discSpinning/receive")
|
@PostMapping("/app/discSpinning/receive")
|
||||||
public Result receive(@RequestBody DiscSpinningRecord receive) {
|
public Result receive(@RequestBody DiscSpinningRecord receive) {
|
||||||
DiscSpinningRecord record = recordService.getById(receive.getId());
|
DiscSpinningRecord record = recordService.getById(receive.getId());
|
||||||
|
if (record.getTargetId() != null) {
|
||||||
|
return Result.error("不可重复领取");
|
||||||
|
}
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
discSpinningService.receiveAsync(record);
|
discSpinningService.receiveAsync(record);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user