|
@@ -1,12 +1,18 @@
|
|
|
package com.qunzhixinxi.hnqz.admin.oe.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.qunzhixinxi.hnqz.admin.oe.entity.dto.OeUserRequest;
|
|
|
import com.qunzhixinxi.hnqz.admin.oe.entity.vo.OeUserVO;
|
|
|
import com.qunzhixinxi.hnqz.common.core.util.R;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* oe用户管理控制器
|
|
|
*
|
|
@@ -18,6 +24,30 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RequestMapping("/oe/user")
|
|
|
public class OeUserController {
|
|
|
|
|
|
-// public R<IPage<OeUserVO>>
|
|
|
+ /**
|
|
|
+ * 分页查询
|
|
|
+ *
|
|
|
+ * @param page 分页参数
|
|
|
+ * @param toPage 查询参数
|
|
|
+ * @return {@link R}<{@link IPage}<{@link OeUserVO}>>
|
|
|
+ */
|
|
|
+ @GetMapping("/page")
|
|
|
+ public R<IPage<OeUserVO>> pageUser(Page<OeUserVO> page, OeUserRequest.ToPage toPage) {
|
|
|
+ int total = 20;
|
|
|
+ List<OeUserVO> list = new ArrayList<>();
|
|
|
+ for (int i = Math.toIntExact(page.getCurrent()); i <= page.getSize() && i <= total; i++) {
|
|
|
+ OeUserVO vo = new OeUserVO();
|
|
|
+ vo.setUserId((long) i);
|
|
|
+ vo.setUsername("user"+i);
|
|
|
+ // TODO
|
|
|
+ list.add(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ page.setRecords(list);
|
|
|
+ page.setTotal(total);
|
|
|
+ page.setPages((total + page.getSize() - 1) / page.getSize());
|
|
|
+
|
|
|
+ return R.ok(page);
|
|
|
+ }
|
|
|
|
|
|
}
|