diff --git a/src/main/java/com/dl/officialsite/redpacket/RedPacketController.java b/src/main/java/com/dl/officialsite/redpacket/RedPacketController.java index 085f54f..8ba2283 100644 --- a/src/main/java/com/dl/officialsite/redpacket/RedPacketController.java +++ b/src/main/java/com/dl/officialsite/redpacket/RedPacketController.java @@ -2,6 +2,14 @@ import com.dl.officialsite.common.base.BaseResponse; import com.dl.officialsite.member.MemberController; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Predicate; +import javax.persistence.criteria.Root; +import javax.validation.Valid; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -9,18 +17,12 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.data.jpa.domain.Specification; -import org.springframework.web.bind.annotation.*; - -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.Predicate; -import javax.persistence.criteria.Root; -import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -import static org.hibernate.criterion.Restrictions.in; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/red-packet") @@ -78,7 +80,7 @@ BaseResponse getTimeoutRedPacketByAddress(@RequestParam String address, @Request @PostMapping(value = "/query/all") BaseResponse getAllRedPacketByCriteria(@RequestParam String address, - @RequestBody RedPacketVo redPacket, + @RequestBody(required = false) RedPacketVo redPacket, @RequestParam(defaultValue = "1") Integer pageNumber, @RequestParam(defaultValue = "10") Integer pageSize) { Pageable pageable = PageRequest.of(pageNumber - 1, pageSize, Sort.by(Sort.Direction.DESC, "createTime"));