- package com.jiawa.wiki.req;
-
- import javax.validation.constraints.Max;
- import javax.validation.constraints.NotNull;
- import javax.validation.constraints.Null;
-
- public class PageReq {
-
- /*增加权限校验规则-防止他人恶意对接口进行攻击*/
- @NotNull(message = "【页码】不能为空")
- private int page;
- @NotNull(message = "【页面条数】不能为空")
- @Max(value = 50, message = "【页面条数】不能超过50")
- private int size;
-
-
- public int getPage() {
- return page;
- }
-
- public void setPage(int page) {
- this.page = page;
- }
-
- public int getSize() {
- return size;
- }
-
- public void setSize(int size) {
- this.size = size;
- }
- @Override
- public String toString() {
- return "PageReq{" +
- "page=" + page +
- ", size=" + size +
- '}';
- }
- }
- @GetMapping("/bookresp")
- public CommonResp listresp(@Valid EbookResp resp){
- CommonResp
> resps = new CommonResp<>();
- List
list = ebookService.listresp(resp); - resps.setContent(list);
- return resps;
- }