Commit 7ec5bbc5 authored by machengbo's avatar machengbo

no message

parent d4c8f46a
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.entity.User;
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.stereotype.Controller;
import org.springframework.ui.Model;
......@@ -12,22 +18,33 @@ import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/*
*
* 测试样例
* */
*
* 测试样例
* */
@RestController
@RequestMapping("/user")
@Api(tags = "测试样例API")
public class UserController extends BaseController {
@Autowired
private UserService userService;
@PostMapping("/getTest")
public List<Map> getTest(){
// System.out.print(userService.getTest().toString());
public List<Map> getTest() {
System.out.print("117576575" + userService.getTest().toString());
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;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jz.common.base.BaseMapper;
import com.jz.manage.admin.entity.User;
import org.apache.ibatis.annotations.Mapper;
......@@ -10,4 +12,6 @@ import java.util.Map;
public interface UserMapper extends BaseMapper<User> {
List<Map> getTest();
IPage<User> queryPage(Page<User> userPage, User event);
}
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.Map;
public interface UserService {
List<Map> getTest();
IPage<User> queryPage(Page<User> userPage, User event);
}
......@@ -2,7 +2,8 @@ package com.jz.manage.admin.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
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.jz.manage.admin.dao.UserMapper;
import com.jz.manage.admin.entity.User;
......@@ -55,4 +56,9 @@ public class UserServiceImpl implements UserService {
return userMapper.getTest();
}
@Override
public IPage<User> queryPage(Page<User> userPage, User event) {
return userMapper.queryPage(userPage,event);
}
}
......@@ -6,4 +6,8 @@
select * from tb_user;
</select>
<select id="queryPage" resultType="com.jz.manage.admin.entity.User">
select * from tb_user
</select>
</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