Skip to content

Commit

Permalink
optimise the code of redpacket
Browse files Browse the repository at this point in the history
  • Loading branch information
liberhe committed Dec 18, 2023
1 parent 1b0aea5 commit 291fe51
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ public void updateRedpacketStatus() throws IOException {
JsonObject jsonObject = JsonParser.parseString(jsonResponse).getAsJsonObject();
JsonObject data = jsonObject.getAsJsonObject("data");
JsonArray redpacketsArray = data.getAsJsonArray("redpackets");

// log.info("redpacket array : " + redpacketsArray.get(0));
List<RedPacket> redPacketList = redPacketRepository.findByStatus(0);

for (int i = 0; i < redpacketsArray.size(); i++) {
Expand All @@ -96,12 +94,12 @@ public void updateRedpacketStatus() throws IOException {
redPacket.setClaimedAddress(claimersList);

// redPacket.getAddressList() is the whole claimer.
if (claimers.size() == redPacket.getAddressList().size()) {
log.info("redpacket id: " + id + " aLL claimed ");
redPacket.setStatus(1);
redPacketRepository.save(redPacket);
continue;
}
// if (claimers.size() == redPacket.getAddressList().size()) {
// log.info("redpacket id: " + id + " aLL claimed ");
// redPacket.setStatus(1);
// redPacketRepository.save(redPacket);
// continue;
// }


// if (claimers.size() > redPacket.getClaimedAddress().size()) {
Expand Down

0 comments on commit 291fe51

Please sign in to comment.