红包校验抛出错误码
This commit is contained in:
parent
cdd73bfc03
commit
d5d28bc6a1
@ -106,15 +106,9 @@ public class GrabRoomRedPacketCmdExe {
|
||||
* 检查红包状态
|
||||
*/
|
||||
private void checkRedPacketStatus(RoomRedPacket redPacket) {
|
||||
if (RoomRedPacketStatus.FINISHED.getCode().equals(redPacket.getStatus())) {
|
||||
throw new RuntimeException(OtherErrorCode.RED_PACKET_FINISHED.getMessage());
|
||||
}
|
||||
if (RoomRedPacketStatus.EXPIRED.getCode().equals(redPacket.getStatus())) {
|
||||
throw new RuntimeException(OtherErrorCode.RED_PACKET_EXPIRED.getMessage());
|
||||
}
|
||||
if (LocalDateTime.now().isAfter(redPacket.getExpireTime())) {
|
||||
throw new RuntimeException(OtherErrorCode.RED_PACKET_EXPIRED.getMessage());
|
||||
}
|
||||
ResponseAssert.isFalse(OtherErrorCode.RED_PACKET_FINISHED, RoomRedPacketStatus.FINISHED.getCode().equals(redPacket.getStatus()));
|
||||
ResponseAssert.isFalse(OtherErrorCode.RED_PACKET_EXPIRED, RoomRedPacketStatus.EXPIRED.getCode().equals(redPacket.getStatus()));
|
||||
ResponseAssert.isFalse(OtherErrorCode.RED_PACKET_EXPIRED, LocalDateTime.now().isAfter(redPacket.getExpireTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM room_red_packet
|
||||
WHERE room_id = #{roomId} AND status != 3
|
||||
WHERE room_id = #{roomId} AND status = 1
|
||||
ORDER BY create_time DESC
|
||||
LIMIT #{offset}, #{size}
|
||||
</select>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user