|
@@ -1,6 +1,5 @@
|
|
|
package com.ynfy.buss.practice.userpractice.controller;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ynfy.buss.practice.userpractice.entity.UserPractice;
|
|
@@ -9,10 +8,11 @@ import com.ynfy.buss.practice.userpractice.service.IUserPracticeService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
-import org.jeecg.common.system.query.QueryGenerator;
|
|
|
+import org.jeecg.common.system.vo.LoginUser;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
@@ -49,11 +49,11 @@ public class UserPracticeController extends JeecgController<UserPractice, IUserP
|
|
|
@GetMapping(value = "/list")
|
|
|
public Result<IPage<UserPractice>> queryPageList(UserPractice userPractice,
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
- @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
- HttpServletRequest req) {
|
|
|
- QueryWrapper<UserPractice> queryWrapper = QueryGenerator.initQueryWrapper(userPractice, req.getParameterMap());
|
|
|
- Page<UserPractice> page = new Page<UserPractice>(pageNo, pageSize);
|
|
|
- IPage<UserPractice> pageList = userPracticeService.page(page, queryWrapper);
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
|
+ Page<UserPractice> page = new Page<>(pageNo, pageSize);
|
|
|
+ LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ userPractice.setUserId(user.getId());
|
|
|
+ IPage<UserPractice> pageList = userPracticeService.selectPageList(page, userPractice);
|
|
|
return Result.OK(pageList);
|
|
|
}
|
|
|
|