Skip to content

Commit

Permalink
fix: require body is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
cheng521521 committed Jul 31, 2024
1 parent 16bb873 commit 694e37d
Showing 1 changed file with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@

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;
import org.springframework.data.domain.PageRequest;
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")
Expand Down Expand Up @@ -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"));
Expand Down

0 comments on commit 694e37d

Please sign in to comment.