Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚本章
dm_project
Commits
7ec5bbc5
Commit
7ec5bbc5
authored
Nov 27, 2020
by
machengbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
d4c8f46a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
6 deletions
+43
-6
UserController.java
...n/java/com/jz/manage/admin/controller/UserController.java
+22
-5
UserMapper.java
...age/src/main/java/com/jz/manage/admin/dao/UserMapper.java
+4
-0
UserService.java
...rc/main/java/com/jz/manage/admin/service/UserService.java
+6
-0
UserServiceImpl.java
...ava/com/jz/manage/admin/service/impl/UserServiceImpl.java
+7
-1
UserMapper.xml
jz-dm-manage/src/main/resources/mapper/UserMapper.xml
+4
-0
No files found.
jz-dm-manage/src/main/java/com/jz/manage/admin/controller/UserController.java
View file @
7ec5bbc5
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
;
}
}
jz-dm-manage/src/main/java/com/jz/manage/admin/dao/UserMapper.java
View file @
7ec5bbc5
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
);
}
jz-dm-manage/src/main/java/com/jz/manage/admin/service/UserService.java
View file @
7ec5bbc5
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
);
}
jz-dm-manage/src/main/java/com/jz/manage/admin/service/impl/UserServiceImpl.java
View file @
7ec5bbc5
...
...
@@ -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
);
}
}
jz-dm-manage/src/main/resources/mapper/UserMapper.xml
View file @
7ec5bbc5
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment