Skip to content

Commit

Permalink
add time out redpacket
Browse files Browse the repository at this point in the history
  • Loading branch information
liberhe committed Dec 19, 2023
1 parent ec0f8e8 commit 60c71ab
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/com/dl/officialsite/member/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import javax.validation.constraints.NotNull;
import java.io.Serializable;

import static com.dl.officialsite.common.privacy.PrivacyTypeEnum.CUSTOMER;

@Getter
@Setter
@AllArgsConstructor
Expand Down Expand Up @@ -71,8 +73,11 @@ public class Member implements Serializable
//todo
private Long workStatus;

@JsonIgnore
@PrivacyEncrypt(type= CUSTOMER)
private String resume;

//todo



}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ BaseResponse getRedPacketByAddress(@RequestParam String address, @RequestParam(r
return BaseResponse.successWithData(result);
}

@RequestMapping(value = "/query/user/timeout", method = RequestMethod.GET)
BaseResponse getTimeoutRedPacketByAddress(@RequestParam String address) {
List<RedPacket> result;
result = redPacketRepository.findByUnclaimedTimeOutPacket("%" + address + "%");
return BaseResponse.successWithData(result);
}

@PostMapping(value = "/query/all")
BaseResponse getAllRedPacketByCriteria(@RequestParam String address,
@RequestBody RedPacketVo redPacket,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public interface RedPacketRepository extends JpaRepository<RedPacket, String>,
List<RedPacket> findByClaimedPacket(@Param("address") String address);


@Query(value = "select * from red_packet where address_list like ?1 and claimed_address not like ?1 and expire_time < UNIX_TIMESTAMP(current_timestamp()) ", nativeQuery = true)
List<RedPacket> findByUnclaimedTimeOutPacket(@Param("address") String address);

// @Query(value = "select * from red_packet where address_list like ?1 and claimed_address not like ?1 and status = ?2 and expire_time > UNIX_TIMESTAMP(current_timestamp()) ", nativeQuery = true)
@Query(value = "select * from red_packet where address_list like ?1 and claimed_address not like ?1 and status = ?2 and expire_time > UNIX_TIMESTAMP(current_timestamp()) ", nativeQuery = true)
List<RedPacket> findByUnclaimedPacket(@Param("address") String address, @Param("status") Integer status);

Expand Down

0 comments on commit 60c71ab

Please sign in to comment.