@@ -7,25 +7,24 @@ import io.github.talelin.core.annotation.LoginRequired;
7
7
</#if >
8
8
import io.github.talelin.latticy.common.mybatis.Page;
9
9
import io.github.talelin.latticy.common.util.PageUtil;
10
+ import io.github.talelin.latticy.dto.query.BasePageDTO;
10
11
import ${package.Service} .${table.serviceName} ;
11
12
import org.springframework.beans.BeanUtils;
12
13
import org.springframework.beans.factory.annotation.Autowired;
14
+ import org.springframework.validation.annotation.Validated;
13
15
import org.springframework.web.bind.annotation.PostMapping;
14
16
import org.springframework.web.bind.annotation.PutMapping;
15
17
import org.springframework.web.bind.annotation.DeleteMapping;
16
18
import org.springframework.web.bind.annotation.GetMapping;
17
19
import org.springframework.web.bind.annotation.RequestMapping;
18
20
import org.springframework.web.bind.annotation.PathVariable;
19
- import org.springframework.web.bind.annotation.RequestParam;
20
21
import org.springframework.web.bind.annotation.RequestBody;
21
22
import ${package.Entity} .${entity} ;
22
23
import io.github.talelin.latticy.vo.CreatedVO;
23
24
import io.github.talelin.latticy.vo.DeletedVO;
24
25
import io.github.talelin.latticy.vo.PageResponseVO;
25
26
import io.github.talelin.latticy.vo.UpdatedVO;
26
27
27
- import javax.validation.constraints.Min;
28
- import javax.validation.constraints.Max;
29
28
import javax.validation.constraints.Positive;
30
29
31
30
<#if restControllerStyle >
@@ -116,13 +115,9 @@ public class ${table.controllerName} {
116
115
@LoginRequired
117
116
</#if >
118
117
public PageResponseVO<${entity} > page(
119
- @RequestParam(name = "page", required = false, defaultValue = "0")
120
- @Min(value = 0, message = "{page.number.min}") Integer page,
121
- @RequestParam(name = "count", required = false, defaultValue = "10")
122
- @Min(value = 1, message = "{page.count.min}")
123
- @Max(value = 30, message = "{page.count.max}") Integer count
118
+ @Validated BasePageDTO dto
124
119
) {
125
- return PageUtil.build(${table.serviceName?uncap_first } .page(new Page<> (page, count ), null));
120
+ return PageUtil.build(${table.serviceName?uncap_first } .page(new Page<> (dto.getPage(), dto.getCount() ), null));
126
121
}
127
122
128
123
}
0 commit comments