|
@@ -1,7 +1,9 @@
|
1
|
1
|
package com.xhkjedu.sstudy.controller.bk;
|
2
|
2
|
|
|
3
|
+import com.github.pagehelper.PageHelper;
|
3
|
4
|
import com.github.pagehelper.PageInfo;
|
4
|
5
|
import com.xhkjedu.annotation.Action;
|
|
6
|
+import com.xhkjedu.constant.PlatformConstant;
|
5
|
7
|
import com.xhkjedu.sstudy.model.bk.TBk;
|
6
|
8
|
import com.xhkjedu.sstudy.service.bk.BkService;
|
7
|
9
|
import com.xhkjedu.utils.N_Utils;
|
|
@@ -14,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
14
|
16
|
import org.springframework.web.bind.annotation.RestController;
|
15
|
17
|
|
16
|
18
|
import javax.annotation.Resource;
|
|
19
|
+import javax.servlet.http.HttpServletRequest;
|
17
|
20
|
import java.util.List;
|
18
|
21
|
import java.util.Map;
|
19
|
22
|
|
|
@@ -36,9 +39,12 @@ public class BkController {
|
36
|
39
|
* @Return com.xhkjedu.vo.ResultVo
|
37
|
40
|
**/
|
38
|
41
|
@PostMapping("list")
|
39
|
|
- public ResultVo list(@RequestBody TBk bk) {
|
|
42
|
+ public ResultVo list(@RequestBody TBk bk, HttpServletRequest request) {
|
|
43
|
+ Integer createid = request.getIntHeader(PlatformConstant.XH_USER_ID);
|
40
|
44
|
N_Utils.validation(new Object[]{
|
41
|
45
|
bk.getPage(), "显示页码", 1, bk.getPageSize(), "显示条数", 1,bk.getLsbid(),"教材",2});
|
|
46
|
+ bk.setCreateid(createid);
|
|
47
|
+ PageHelper.startPage(bk.getPage(), bk.getPageSize());
|
42
|
48
|
List<Map<String,Object>> list = bkService.listBks(bk);
|
43
|
49
|
PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
|
44
|
50
|
return new ResultVo(0, "获取列表成功", pageResult);
|