重复领取问题
This commit is contained in:
parent
1f3de4c9ae
commit
867b3a284e
|
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue