Commit 7ec5bbc5 authored by machengbo's avatar machengbo

no message

parent d4c8f46a
package com.jz.manage.admin.controller; package com.jz.manage.admin.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jz.common.utils.Result;
import com.jz.manage.admin.controller.BaseController; import com.jz.manage.admin.controller.BaseController;
import com.jz.manage.admin.entity.User;
import com.jz.manage.admin.service.UserService; import com.jz.manage.admin.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
...@@ -12,22 +18,33 @@ import javax.servlet.http.HttpServletRequest; ...@@ -12,22 +18,33 @@ import javax.servlet.http.HttpServletRequest;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/* /*
* *
* 测试样例 * 测试样例
* */ * */
@RestController @RestController
@RequestMapping("/user") @RequestMapping("/user")
@Api(tags = "测试样例API")
public class UserController extends BaseController { public class UserController extends BaseController {
@Autowired @Autowired
private UserService userService; private UserService userService;
@PostMapping("/getTest") @PostMapping("/getTest")
public List<Map> getTest(){ public List<Map> getTest() {
// System.out.print(userService.getTest().toString()); System.out.print("117576575" + userService.getTest().toString());
return userService.getTest(); return userService.getTest();
} }
@GetMapping(value = "/events")
@ApiOperation(value = "测试样例列表(分页查询)", notes = "事件列表(分页查询)")
public Result<IPage<User>> queryPageList(User event, HttpServletRequest req) throws Exception {
Result<IPage<User>> result = new Result<IPage<User>>();
IPage<User> pageList = userService.queryPage(new Page<User>(1, 2), event);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
} }
package com.jz.manage.admin.dao; package com.jz.manage.admin.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.manage.admin.entity.User; import com.jz.manage.admin.entity.User;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -10,4 +12,6 @@ import java.util.Map; ...@@ -10,4 +12,6 @@ import java.util.Map;
public interface UserMapper extends BaseMapper<User> { public interface UserMapper extends BaseMapper<User> {
List<Map> getTest(); List<Map> getTest();
IPage<User> queryPage(Page<User> userPage, User event);
} }
package com.jz.manage.admin.service; package com.jz.manage.admin.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jz.manage.admin.entity.User;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public interface UserService { public interface UserService {
List<Map> getTest(); List<Map> getTest();
IPage<User> queryPage(Page<User> userPage, User event);
} }
...@@ -2,7 +2,8 @@ package com.jz.manage.admin.service.impl; ...@@ -2,7 +2,8 @@ package com.jz.manage.admin.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.Page; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.jz.manage.admin.dao.UserMapper; import com.jz.manage.admin.dao.UserMapper;
import com.jz.manage.admin.entity.User; import com.jz.manage.admin.entity.User;
...@@ -55,4 +56,9 @@ public class UserServiceImpl implements UserService { ...@@ -55,4 +56,9 @@ public class UserServiceImpl implements UserService {
return userMapper.getTest(); return userMapper.getTest();
} }
@Override
public IPage<User> queryPage(Page<User> userPage, User event) {
return userMapper.queryPage(userPage,event);
}
} }
...@@ -6,4 +6,8 @@ ...@@ -6,4 +6,8 @@
select * from tb_user; select * from tb_user;
</select> </select>
<select id="queryPage" resultType="com.jz.manage.admin.entity.User">
select * from tb_user
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment