Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vehicle-quality-review
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
王飞
vehicle-quality-review
Commits
33fdd0d5
Commit
33fdd0d5
authored
Dec 28, 2023
by
王飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feat
1、swagger兼容分页查询。 Reference N/A
parent
38aaca5f
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
118 additions
and
27 deletions
+118
-27
Book.java
quality-review/src/main/java/com/ruoyi/domain/Book.java
+5
-0
BookMapper.java
...ity-review/src/main/java/com/ruoyi/mapper/BookMapper.java
+1
-1
BookService.java
...y-review/src/main/java/com/ruoyi/service/BookService.java
+2
-2
BookServiceImpl.java
...src/main/java/com/ruoyi/service/impl/BookServiceImpl.java
+3
-3
BookController.java
...ty-review/src/main/java/com/ruoyi/web/BookController.java
+28
-13
ReviewSceneChangeTaskController.java
...n/java/com/ruoyi/web/ReviewSceneChangeTaskController.java
+7
-8
BookDeleteRequest.java
...rc/main/java/com/ruoyi/web/request/BookDeleteRequest.java
+14
-0
BookListRequest.java
.../src/main/java/com/ruoyi/web/request/BookListRequest.java
+15
-0
ReviewSceneChangeTaskFindCreateRequest.java
...i/web/request/ReviewSceneChangeTaskFindCreateRequest.java
+8
-0
ReviewSceneChangeTaskFindFinishRequest.java
...i/web/request/ReviewSceneChangeTaskFindFinishRequest.java
+8
-0
ReviewSceneChangeTaskFindPendingRequest.java
.../web/request/ReviewSceneChangeTaskFindPendingRequest.java
+8
-0
BaseController.java
...java/com/ruoyi/common/core/controller/BaseController.java
+12
-0
PageDomain.java
.../src/main/java/com/ruoyi/common/core/page/PageDomain.java
+7
-0
No files found.
quality-review/src/main/java/com/ruoyi/domain/Book.java
View file @
33fdd0d5
...
...
@@ -3,12 +3,15 @@ package com.ruoyi.domain;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.ruoyi.common.core.domain.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 书籍
* @TableName t_book
*/
@ApiModel
@TableName
(
value
=
"t_book"
)
@Data
public
class
Book
extends
BaseEntity
{
...
...
@@ -17,12 +20,14 @@ public class Book extends BaseEntity {
/**
* 主键
*/
@ApiModelProperty
(
"主键"
)
@TableId
private
Long
id
;
/**
* 书名
*/
@ApiModelProperty
(
"书名"
)
private
String
name
;
}
\ No newline at end of file
quality-review/src/main/java/com/ruoyi/mapper/BookMapper.java
View file @
33fdd0d5
...
...
@@ -18,7 +18,7 @@ import java.util.List;
*/
@Repository
public
interface
BookMapper
extends
BaseMapper
<
Book
>
{
List
<
Book
>
selectBookList
(
Book
book
);
List
<
Book
>
selectBookList
(
@Param
(
"name"
)
String
name
);
}
...
...
quality-review/src/main/java/com/ruoyi/service/BookService.java
View file @
33fdd0d5
...
...
@@ -15,8 +15,8 @@ import java.util.List;
*/
public
interface
BookService
extends
IService
<
Book
>
{
List
<
Book
>
selectBookList
(
Book
book
);
List
<
Book
>
selectBookList
(
String
name
);
List
<
Book
>
selectBookListException
(
Book
book
);
List
<
Book
>
selectBookListException
(
String
name
);
}
quality-review/src/main/java/com/ruoyi/service/impl/BookServiceImpl.java
View file @
33fdd0d5
...
...
@@ -27,12 +27,12 @@ public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements Bo
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@Override
public
List
<
Book
>
selectBookList
(
Book
book
)
{
return
bookMapper
.
selectBookList
(
book
);
public
List
<
Book
>
selectBookList
(
String
name
)
{
return
bookMapper
.
selectBookList
(
name
);
}
@Override
public
List
<
Book
>
selectBookListException
(
Book
book
)
{
public
List
<
Book
>
selectBookListException
(
String
name
)
{
if
(
1
==
1
)
{
throw
new
ServiceException
(
"测试异常处理"
);
}
...
...
quality-review/src/main/java/com/ruoyi/web/BookController.java
View file @
33fdd0d5
package
com
.
ruoyi
.
web
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.
AjaxResult
;
import
com.ruoyi.common.core.domain.
R
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.domain.Book
;
import
com.ruoyi.service.BookService
;
import
com.ruoyi.web.request.BookDeleteRequest
;
import
com.ruoyi.web.request.BookListRequest
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.skywalking.apm.toolkit.trace.Tag
;
import
org.apache.skywalking.apm.toolkit.trace.Tags
;
import
org.apache.skywalking.apm.toolkit.trace.Trace
;
...
...
@@ -16,45 +20,56 @@ import java.util.Arrays;
import
java.util.List
;
@Api
(
"书籍管理"
)
@RestController
@RequestMapping
(
"/book"
)
public
class
BookController
extends
BaseController
{
@Autowired
private
BookService
bookService
;
@ApiOperation
(
"添加书籍"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/add"
)
public
AjaxResult
add
(
@Validated
@RequestBody
Book
book
)
{
return
toAjax
(
bookService
.
save
(
book
));
public
R
add
(
@Validated
@RequestBody
Book
book
)
{
bookService
.
save
(
book
);
return
R
.
ok
();
}
@ApiOperation
(
"修改书籍"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/edit"
)
public
AjaxResult
edit
(
@Validated
@RequestBody
Book
book
)
{
return
toAjax
(
bookService
.
updateById
(
book
));
public
R
edit
(
@Validated
@RequestBody
Book
book
)
{
bookService
.
updateById
(
book
);
return
R
.
ok
();
}
@ApiOperation
(
"查询书籍列表"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/list"
)
public
TableDataInfo
list
(
@Validated
@RequestBody
Book
book
)
{
startPage
();
List
<
Book
>
books
=
bookService
.
selectBookList
(
book
);
public
TableDataInfo
list
(
@Validated
@RequestBody
Book
ListRequest
request
)
{
startPage
(
request
);
List
<
Book
>
books
=
bookService
.
selectBookList
(
request
.
getName
()
);
return
getDataTable
(
books
);
}
@ApiOperation
(
"删除书籍"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/remove"
)
public
AjaxResult
remove
(
@Validated
@RequestBody
Long
[]
userIds
)
{
return
toAjax
(
bookService
.
removeBatchByIds
(
Arrays
.
asList
(
userIds
)));
public
R
remove
(
@Validated
@RequestBody
BookDeleteRequest
request
)
{
bookService
.
removeBatchByIds
(
Arrays
.
asList
(
request
.
getIds
()));
return
R
.
ok
();
}
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/listException"
)
public
TableDataInfo
listException
(
@Validated
@RequestBody
Book
book
)
{
startPage
();
List
<
Book
>
books
=
bookService
.
selectBookListException
(
book
);
public
TableDataInfo
listException
(
@Validated
@RequestBody
Book
ListRequest
request
)
{
startPage
(
request
);
List
<
Book
>
books
=
bookService
.
selectBookListException
(
request
.
getName
()
);
return
getDataTable
(
books
);
}
...
...
quality-review/src/main/java/com/ruoyi/web/ReviewSceneChangeTaskController.java
View file @
33fdd0d5
...
...
@@ -8,8 +8,7 @@ import com.ruoyi.common.enums.BusinessType;
import
com.ruoyi.common.utils.bean.BeanUtils
;
import
com.ruoyi.domain.ReviewSceneChangeTask
;
import
com.ruoyi.service.ReviewSceneChangeTaskService
;
import
com.ruoyi.web.request.ReviewSceneChangeTaskCreateRequest
;
import
com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest
;
import
com.ruoyi.web.request.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.skywalking.apm.toolkit.trace.Tag
;
...
...
@@ -74,8 +73,8 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/findPending"
)
public
TableDataInfo
<
ReviewSceneChangeTask
>
findPending
()
{
startPage
();
public
TableDataInfo
<
ReviewSceneChangeTask
>
findPending
(
@Validated
@RequestBody
ReviewSceneChangeTaskFindPendingRequest
request
)
{
startPage
(
request
);
return
getDataTable
(
reviewSceneChangeTaskService
.
findPendingListByUserId
(
getUserId
()));
}
...
...
@@ -87,8 +86,8 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/findFinish"
)
public
TableDataInfo
<
ReviewSceneChangeTask
>
findFinish
()
{
startPage
();
public
TableDataInfo
<
ReviewSceneChangeTask
>
findFinish
(
ReviewSceneChangeTaskFindFinishRequest
request
)
{
startPage
(
request
);
return
getDataTable
(
reviewSceneChangeTaskService
.
findFinishListByUserId
(
getUserId
()));
}
...
...
@@ -100,8 +99,8 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/findCreate"
)
public
TableDataInfo
<
ReviewSceneChangeTask
>
findCreate
()
{
startPage
();
public
TableDataInfo
<
ReviewSceneChangeTask
>
findCreate
(
ReviewSceneChangeTaskFindCreateRequest
request
)
{
startPage
(
request
);
return
getDataTable
(
reviewSceneChangeTaskService
.
findCreateListByUserId
(
getUserId
()));
}
...
...
quality-review/src/main/java/com/ruoyi/web/request/BookDeleteRequest.java
0 → 100644
View file @
33fdd0d5
package
com
.
ruoyi
.
web
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
public
class
BookDeleteRequest
{
@ApiModelProperty
(
"书籍id"
)
private
Long
[]
ids
;
}
quality-review/src/main/java/com/ruoyi/web/request/BookListRequest.java
0 → 100644
View file @
33fdd0d5
package
com
.
ruoyi
.
web
.
request
;
import
com.ruoyi.common.core.page.PageDomain
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@ApiModel
@Data
public
class
BookListRequest
extends
PageDomain
{
@ApiModelProperty
(
"数名"
)
private
String
name
;
}
quality-review/src/main/java/com/ruoyi/web/request/ReviewSceneChangeTaskFindCreateRequest.java
0 → 100644
View file @
33fdd0d5
package
com
.
ruoyi
.
web
.
request
;
import
com.ruoyi.common.core.page.PageDomain
;
import
io.swagger.annotations.ApiModel
;
@ApiModel
public
class
ReviewSceneChangeTaskFindCreateRequest
extends
PageDomain
{
}
quality-review/src/main/java/com/ruoyi/web/request/ReviewSceneChangeTaskFindFinishRequest.java
0 → 100644
View file @
33fdd0d5
package
com
.
ruoyi
.
web
.
request
;
import
com.ruoyi.common.core.page.PageDomain
;
import
io.swagger.annotations.ApiModel
;
@ApiModel
public
class
ReviewSceneChangeTaskFindFinishRequest
extends
PageDomain
{
}
quality-review/src/main/java/com/ruoyi/web/request/ReviewSceneChangeTaskFindPendingRequest.java
0 → 100644
View file @
33fdd0d5
package
com
.
ruoyi
.
web
.
request
;
import
com.ruoyi.common.core.page.PageDomain
;
import
io.swagger.annotations.ApiModel
;
@ApiModel
public
class
ReviewSceneChangeTaskFindPendingRequest
extends
PageDomain
{
}
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java
View file @
33fdd0d5
...
...
@@ -55,6 +55,18 @@ public class BaseController
PageUtils
.
startPage
();
}
/**
* 设置请求分页数据
*/
protected
void
startPage
(
PageDomain
pageDomain
)
{
Integer
pageNum
=
pageDomain
.
getPageNum
();
Integer
pageSize
=
pageDomain
.
getPageSize
();
String
orderBy
=
SqlUtil
.
escapeOrderBySql
(
pageDomain
.
getOrderBy
());
Boolean
reasonable
=
pageDomain
.
getReasonable
();
PageHelper
.
startPage
(
pageNum
,
pageSize
,
orderBy
).
setReasonable
(
reasonable
);
}
/**
* 设置请求排序数据
*/
...
...
ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java
View file @
33fdd0d5
package
com
.
ruoyi
.
common
.
core
.
page
;
import
com.ruoyi.common.utils.StringUtils
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* 分页数据
*
* @author ruoyi
*/
@ApiModel
public
class
PageDomain
{
/** 当前记录起始索引 */
@ApiModelProperty
(
"当前记录起始索引"
)
private
Integer
pageNum
;
/** 每页显示记录数 */
@ApiModelProperty
(
"每页显示记录数"
)
private
Integer
pageSize
;
/** 排序列 */
@ApiModelProperty
(
"排序列"
)
private
String
orderByColumn
;
/** 排序的方向desc或者asc */
@ApiModelProperty
(
"排序的方向desc或者asc"
)
private
String
isAsc
=
"asc"
;
/** 分页参数合理化 */
...
...
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