Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elleai
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
ai-tech
E
ellehuis-group
backend
elleai
Commits
c5c894d5
Commit
c5c894d5
authored
Oct 18, 2024
by
陈立彬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
66c3f577
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
92 additions
and
10 deletions
+92
-10
WikiCategoryMobileRequestDto.java
...application/dto/request/WikiCategoryMobileRequestDto.java
+1
-1
WikiCategoryRequestDto.java
...lleai/application/dto/request/WikiCategoryRequestDto.java
+9
-2
WikiRequestDto.java
...breeze/elleai/application/dto/request/WikiRequestDto.java
+2
-2
WikiListMobileDto.java
...ze/elleai/application/dto/response/WikiListMobileDto.java
+14
-0
AppExamineService.java
.../breeze/elleai/application/service/AppExamineService.java
+58
-0
WikiMobileController.java
.../breeze/elleai/controller/front/WikiMobileController.java
+4
-4
WikiRequestModel.java
...lleai/domain/sparring/model/request/WikiRequestModel.java
+1
-1
ExamineServiceImpl.java
...ze/elleai/domain/sparring/service/ExamineServiceImpl.java
+3
-0
No files found.
src/main/java/cn/breeze/elleai/application/dto/request/WikiCategoryMobileRequestDto.java
View file @
c5c894d5
...
...
@@ -18,6 +18,6 @@ public class WikiCategoryMobileRequestDto implements Serializable {
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
=
10
;
@Schema
(
description
=
"
知识库
名称"
)
@Schema
(
description
=
"名称"
)
private
String
name
;
}
src/main/java/cn/breeze/elleai/application/dto/request/WikiCategoryRequestDto.java
View file @
c5c894d5
package
cn
.
breeze
.
elleai
.
application
.
dto
.
request
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -7,10 +9,15 @@ import java.io.Serializable;
@Data
public
class
WikiCategoryRequestDto
implements
Serializable
{
private
Integer
pageNo
;
@Schema
(
description
=
"页码"
)
@JsonProperty
(
"page_no"
)
private
Integer
pageNo
=
1
;
private
Integer
pageSize
;
@Schema
(
description
=
"分页数量"
)
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
=
10
;
@Schema
(
description
=
"名称"
)
private
String
name
;
...
...
src/main/java/cn/breeze/elleai/application/dto/request/WikiRequestDto.java
View file @
c5c894d5
...
...
@@ -11,11 +11,11 @@ public class WikiRequestDto implements Serializable {
@Schema
(
description
=
"页码"
)
@JsonProperty
(
"page_no"
)
private
Integer
pageNo
;
private
Integer
pageNo
=
1
;
@Schema
(
description
=
"分页数量"
)
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
;
private
Integer
pageSize
=
10
;
@Schema
(
description
=
"资料名称"
)
private
String
name
;
...
...
src/main/java/cn/breeze/elleai/application/dto/response/WikiListMobileDto.java
View file @
c5c894d5
...
...
@@ -26,6 +26,20 @@ public class WikiListMobileDto implements Serializable {
@Schema
(
description
=
"资料描述"
)
private
String
description
;
/**
* 资料分类ID
*/
@Schema
(
description
=
"资料分类ID"
)
@JsonProperty
(
"wiki_category_id"
)
private
Integer
wikiCategoryId
;
/**
* 资料分类名称
*/
@Schema
(
description
=
"资料分类名称"
)
@JsonProperty
(
"wiki_category_name"
)
private
String
wikiCategoryName
;
@Schema
(
description
=
"浏览次数"
)
@JsonProperty
(
"view_count"
)
private
String
viewCount
;
...
...
src/main/java/cn/breeze/elleai/application/service/AppExamineService.java
View file @
c5c894d5
...
...
@@ -811,6 +811,30 @@ public class AppExamineService {
return
pageResult
;
}
/**
* 资料库分类分页查询
* @param request
* @return
*/
public
PageResult
<
WikiCategoryMobileDto
>
wikiCategoryMobilePaginQuery
(
WikiCategoryRequestDto
request
)
{
WikiCategoryRequestModel
requestModel
=
BeanUtil
.
copyProperties
(
request
,
WikiCategoryRequestModel
.
class
);
Page
<
WikiCategoryResponseModel
>
page
=
examineService
.
wikiCategoryPaginQuery
(
requestModel
);
PageResult
<
WikiCategoryMobileDto
>
pageResult
=
PageResult
.
of
(
request
.
getPageNo
(),
request
.
getPageSize
(),
(
int
)
page
.
getTotalRow
(),
null
);
if
(
CollectionUtil
.
isNotEmpty
(
page
.
getRecords
()))
{
List
<
WikiCategoryMobileDto
>
dtoList
=
page
.
getRecords
().
stream
().
map
(
v
->
{
WikiCategoryMobileDto
dto
=
BeanUtil
.
copyProperties
(
v
,
WikiCategoryMobileDto
.
class
);
return
dto
;
}).
collect
(
Collectors
.
toList
());
pageResult
.
setItems
(
dtoList
);
}
return
pageResult
;
}
/**
* 资料库分类列表查询
...
...
@@ -864,6 +888,10 @@ public class AppExamineService {
return
BeanUtil
.
copyProperties
(
model
,
WikiDto
.
class
);
}
public
WikiMobileDto
wikiMobileDetail
(
Integer
id
)
{
WikiResponseModel
model
=
examineService
.
wikiDetail
(
id
);
return
BeanUtil
.
copyProperties
(
model
,
WikiMobileDto
.
class
);
}
/**
* 保存资料库
...
...
@@ -912,6 +940,36 @@ public class AppExamineService {
}
/**
* 资料库分页查询
* @param request
* @return
*/
public
PageResult
<
WikiListMobileDto
>
wikiMobilePaginQuery
(
WikiRequestDto
request
)
{
WikiRequestModel
requestModel
=
BeanUtil
.
copyProperties
(
request
,
WikiRequestModel
.
class
);
Page
<
WikiResponseModel
>
page
=
examineService
.
wikiPaginQuery
(
requestModel
);
PageResult
<
WikiListMobileDto
>
pageResult
=
PageResult
.
of
(
request
.
getPageNo
(),
request
.
getPageSize
(),
(
int
)
page
.
getTotalRow
(),
null
);
if
(
CollectionUtil
.
isNotEmpty
(
page
.
getRecords
()))
{
List
<
WikiListMobileDto
>
dtoList
=
page
.
getRecords
().
stream
().
map
(
v
->
{
WikiListMobileDto
dto
=
BeanUtil
.
copyProperties
(
v
,
WikiListMobileDto
.
class
);
WikiCategoryDto
wikiCategoryDto
=
wikiCategoryDetail
(
dto
.
getWikiCategoryId
());
if
(
Objects
.
nonNull
(
wikiCategoryDto
))
{
dto
.
setWikiCategoryName
(
wikiCategoryDto
.
getName
());
}
return
dto
;
}).
collect
(
Collectors
.
toList
());
pageResult
.
setItems
(
dtoList
);
}
return
pageResult
;
}
/**
* 资料库列表查询
* @param request
...
...
src/main/java/cn/breeze/elleai/controller/front/WikiMobileController.java
View file @
c5c894d5
...
...
@@ -27,8 +27,8 @@ public class WikiMobileController {
@GetMapping
(
"/category/list"
)
public
ApiResponse
<
PageResult
<
WikiCategoryMobileDto
>>
list
(
@Parameter
(
hidden
=
true
)
UserPrincipal
userPrincipal
,
@QueryParam
WikiCategory
Mobile
RequestDto
request
)
{
PageResult
<
WikiCategoryMobileDto
>
pageResult
=
new
PageResult
<>(
);
@QueryParam
WikiCategoryRequestDto
request
)
{
PageResult
<
WikiCategoryMobileDto
>
pageResult
=
examineService
.
wikiCategoryMobilePaginQuery
(
request
);
return
ApiResponse
.
ok
(
pageResult
);
}
...
...
@@ -37,14 +37,14 @@ public class WikiMobileController {
public
ApiResponse
<
PageResult
<
WikiListMobileDto
>>
list
(
@Parameter
(
hidden
=
true
)
UserPrincipal
userPrincipal
,
@QueryParam
WikiRequestDto
request
)
{
PageResult
<
WikiListMobileDto
>
pageResult
=
new
PageResult
<>(
);
PageResult
<
WikiListMobileDto
>
pageResult
=
examineService
.
wikiMobilePaginQuery
(
request
);
return
ApiResponse
.
ok
(
pageResult
);
}
@Operation
(
summary
=
"获取资料详情"
)
@GetMapping
(
"/detail/{id}"
)
public
ApiResponse
<
WikiMobileDto
>
detail
(
@Schema
(
description
=
"资料ID"
)
@PathVariable
(
"id"
)
Integer
id
)
{
WikiMobileDto
detail
=
new
WikiMobileDto
(
);
WikiMobileDto
detail
=
examineService
.
wikiMobileDetail
(
id
);
return
ApiResponse
.
ok
(
detail
);
}
}
src/main/java/cn/breeze/elleai/domain/sparring/model/request/WikiRequestModel.java
View file @
c5c894d5
...
...
@@ -13,5 +13,5 @@ public class WikiRequestModel implements Serializable {
private
String
name
;
private
Integer
categoryId
;
}
src/main/java/cn/breeze/elleai/domain/sparring/service/ExamineServiceImpl.java
View file @
c5c894d5
...
...
@@ -530,6 +530,9 @@ public class ExamineServiceImpl implements ExamineService {
if
(
StrUtil
.
isNotEmpty
(
request
.
getName
()))
{
queryWrapper
.
where
(
WIKI_ENTITY
.
NAME
.
like
(
"%"
+
request
.
getName
()+
"%"
));
}
if
(
Objects
.
nonNull
(
request
.
getCategoryId
()))
{
queryWrapper
.
where
(
WIKI_ENTITY
.
WIKI_CATEGORY_ID
.
eq
(
request
.
getCategoryId
()));
}
Page
<
WikiResponseModel
>
page
=
wikiMapper
.
paginateAs
(
pageNo
,
pageSize
,
queryWrapper
,
WikiResponseModel
.
class
);
...
...
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